[igt-dev] [PATCH i-g-t v2] runner: Only show the kmsg overflow message once

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 25 12:58:23 UTC 2020


Instead of repeating every single time we overflow the read from kmsg,
just once per test is enough warning.

v2: Just suppress the multiple s/underflow/overflow/ messages. Having a
buffer smaller than a single kmsg packet is unlikely.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala at intel.com>
---
 runner/executor.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/runner/executor.c b/runner/executor.c
index a56cb5d66..d72a59376 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -549,6 +549,7 @@ static int dump_dmesg(int kmsgfd, int outfd)
 	int comparefd;
 	unsigned flags;
 	unsigned long long seq, cmpseq, usec;
+	bool underflow_once = false;
 	char cont;
 	char buf[2048];
 	ssize_t r;
@@ -586,7 +587,10 @@ static int dump_dmesg(int kmsgfd, int outfd)
 		r = read(kmsgfd, buf, sizeof(buf));
 		if (r < 0) {
 			if (errno == EPIPE) {
-				errf("Warning: kernel log ringbuffer underflow, some records lost.\n");
+				if (!underflow_once) {
+					errf("Warning: kernel log ringbuffer underflow, some records lost.\n");
+					underflow_once = true;
+				}
 				continue;
 			} else if (errno == EINVAL) {
 				errf("Warning: Buffer too small for kernel log record, record lost.\n");
-- 
2.26.0



More information about the igt-dev mailing list