public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] runner: Only show the kmsg underflow/overflow message once
Date: Wed, 25 Mar 2020 14:52:53 +0200	[thread overview]
Message-ID: <20200325125253.GZ9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200325123318.240545-1-chris@chris-wilson.co.uk>

On Wed, Mar 25, 2020 at 12:33:18PM +0000, Chris Wilson wrote:
> Instead of repeating every single time we underflow the read from kmsg,
> just once per test is enough warning.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Petri Latvala <petri.latvala@intel.com>
> ---
>  runner/executor.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index a56cb5d66..b26cb7bc7 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -549,6 +549,8 @@ static int dump_dmesg(int kmsgfd, int outfd)
>  	int comparefd;
>  	unsigned flags;
>  	unsigned long long seq, cmpseq, usec;
> +	bool underflow_once = false;
> +	bool overflow_once = false;
>  	char cont;
>  	char buf[2048];
>  	ssize_t r;
> @@ -586,10 +588,16 @@ 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 (!overflow_once) {
> +					errf("Warning: kernel log ringbuffer underflow, some records lost.\n");
> +					overflow_once = true;
> +				}

if (!overflow_once)
Warning: underflow


And then


if (!underflow_once)
Warning: overflow




>  				continue;
>  			} else if (errno == EINVAL) {
> -				errf("Warning: Buffer too small for kernel log record, record lost.\n");
> +				if (!underflow_once) {
> +					errf("Warning: Buffer too small for kernel log record, record lost.\n");
> +					underflow_once = true;
> +				}

I'd just not bother with once-proofing this case here. If it happens,
we will fix it by increasing buf to 4k from 2k.

For those in the audience, EINVAL happens when the next single kernel
log record is larger than the read() buffer. Whereas EPIPE is about
the number of log records that are unread.


tl;dr: Just once-proof the EPIPE-underflow and call it underflow_once.

Next order of business is hooking that underflow to cause dmesg-warn.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-03-25 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 12:33 [igt-dev] [PATCH i-g-t] runner: Only show the kmsg underflow/overflow message once Chris Wilson
2020-03-25 12:41 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2020-03-25 12:52 ` Petri Latvala [this message]
2020-03-25 12:58 ` [igt-dev] [PATCH i-g-t v2] runner: Only show the kmsg overflow " Chris Wilson
2020-03-25 13:14   ` Petri Latvala
2020-03-25 13:06 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Only show the kmsg underflow/overflow " Patchwork
2020-03-25 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Only show the kmsg underflow/overflow message once (rev2) Patchwork
2020-03-25 14:56 ` [igt-dev] ✓ Fi.CI.IGT: success for runner: Only show the kmsg underflow/overflow message once Patchwork
2020-03-25 15:38 ` [igt-dev] ✗ Fi.CI.IGT: failure for runner: Only show the kmsg underflow/overflow message once (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325125253.GZ9497@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox