public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org, Arkadiusz Hiler <arek@hiler.eu>
Subject: Re: [igt-dev] [PATCH i-g-t 1/6] runner: Use a bigger buffer for receiving test outputs
Date: Tue, 8 Nov 2022 11:39:43 +0200	[thread overview]
Message-ID: <Y2oj39os69lVwUk/@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <Y2k2Ju/p+ZTBQ+Dz@kamilkon-desk1>

On Mon, Nov 07, 2022 at 05:45:26PM +0100, Kamil Konieczny wrote:
> Hi Petri,
> 
> On 2022-11-07 at 14:01:46 +0200, Petri Latvala wrote:
> > Stream-based receiving was able to use buffers of any size for read(),
> > but with datagrams we actually need to prepare for actual sizes. In
> > practice, some file dumps from tests come as single log packets of a
> > couple of kB.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Arkadiusz Hiler <arek@hiler.eu>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > ---
> >  runner/executor.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/runner/executor.c b/runner/executor.c
> > index a79a34e0..1fcc9afe 100644
> > --- a/runner/executor.c
> > +++ b/runner/executor.c
> > @@ -857,7 +857,8 @@ static int monitor_output(pid_t child,
> >  			  char **abortreason)
> >  {
> >  	fd_set set;
> > -	char buf[2048];
> > +	char *buf;
> > +	size_t bufsize;
> >  	char *outbuf = NULL;
> >  	size_t outbufsize = 0;
> >  	char current_subtest[256] = {};
> > @@ -910,6 +911,9 @@ static int monitor_output(pid_t child,
> >  		}
> >  	}
> >  
> > +	bufsize = 262144; /* 256 kiB */
> 
> imho it is better to use define and also write this as 256*1024
> and put it in header.

Sure.

> If you increase this size maybe you can drop splitting ?

Splitting is only done for log packets. Currently there's no obvious
way for other packet types to be larger than reasonable but for
futureproofing it's good to be defensive in both ends.

Having e.g. assertion failure reason fields (when that is stuffed into
the subtest result packet) go multiple kilobytes sounds wild but who
knows what kind of autogenerated igt_assert macros people will attempt
to write...


-- 
Petri Latvala

      reply	other threads:[~2022-11-08  9:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 12:01 [igt-dev] [PATCH i-g-t 1/6] runner: Use a bigger buffer for receiving test outputs Petri Latvala
2022-11-07 12:01 ` [igt-dev] [PATCH i-g-t 2/6] igt_core: Split too long log lines when sending to runner with comms Petri Latvala
2022-11-07 14:16   ` Kamil Konieczny
2022-11-07 15:14     ` Petri Latvala
2022-11-07 16:40       ` Kamil Konieczny
2022-11-07 16:45         ` Petri Latvala
2022-11-07 12:01 ` [igt-dev] [PATCH i-g-t 3/6] runner: Continue using socket comms when getting an invalid packet Petri Latvala
2022-11-07 16:16   ` Kamil Konieczny
2022-11-07 12:01 ` [igt-dev] [PATCH i-g-t 4/6] igt_core: Make sure test result gets to runner when test has no subtests Petri Latvala
2022-11-07 13:57   ` Kamil Konieczny
2022-11-07 12:01 ` [igt-dev] [PATCH i-g-t 5/6] lib/runnercomms: Report empty comms dump as empty Petri Latvala
2022-11-07 13:59   ` Kamil Konieczny
2022-11-07 12:01 ` [igt-dev] [PATCH i-g-t 6/6] Revert "runner: Disable socket communications for now" Petri Latvala
2022-11-07 14:00   ` Kamil Konieczny
2022-11-07 13:40 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/6] runner: Use a bigger buffer for receiving test outputs Patchwork
2022-11-07 16:45 ` [igt-dev] [PATCH i-g-t 1/6] " Kamil Konieczny
2022-11-08  9:39   ` Petri Latvala [this message]

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=Y2oj39os69lVwUk/@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=arek@hiler.eu \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    /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