summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-03-25 12:27:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-03-25 17:43:09 +0000
commitbfdc99d440c4eb950e3a6a36374c3c30bdbd82d9 (patch)
tree818474372fa0d4067e7b950c1a0c7c7dffc83a0e /runner
parentdfd861de1e00f1e1656f837b4d5b08628eba48c6 (diff)
runner: Only show the kmsg overflow message once
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@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'runner')
-rw-r--r--runner/executor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/runner/executor.c b/runner/executor.c
index a56cb5d6..d72a5937 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");