From: John Levon <john.levon@nutanix.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] app/test: flush stdout after forking
Date: Mon, 26 Jul 2021 12:33:01 +0000 [thread overview]
Message-ID: <20210726123301.GK1120967@movementarian.org> (raw)
In-Reply-To: <YP6qRE24ahRJxn/u@bricha3-MOBL.ger.corp.intel.com>
On Mon, Jul 26, 2021 at 01:27:48PM +0100, Bruce Richardson wrote:
> On Mon, Jul 26, 2021 at 01:16:27PM +0100, John Levon wrote:
> > meson test was not capturing the intended output from the child
> > process; force a flush to ensure it reaches the test log.
> >
> > Signed-off-by: John Levon <john.levon@nutanix.com>
> > ---
> > app/test/process.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test/process.h b/app/test/process.h
> > index a09a088477..0ed91a939e 100644
> > --- a/app/test/process.h
> > +++ b/app/test/process.h
> > @@ -110,6 +110,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
> > for (i = 0; i < num; i++)
> > printf("'%s' ", argv_cpy[i]);
> > printf("\n");
> > + fflush(stdout);
> >
> I thought that "\n" normally flushes in most cases, but if explicit flush
> is necessary for some cases, let's add it.
stdout is only line-buffered if it's to a tty, but regardless, meson test
appears to wrap all output into tmp files. I didn't dig into exactly what's
going on with meson (or why the fork() matters), but certainly you don't get
this output *at all* under meson test (even with -v), but you do running
dpdk_test directly.
Furthermore, looks like others have found the same thing as there are several
other direct fflush()es.
regards
john
next prev parent reply other threads:[~2021-07-26 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 12:16 John Levon
2021-07-26 12:27 ` Bruce Richardson
2021-07-26 12:33 ` John Levon [this message]
2021-07-31 17:44 ` Thomas Monjalon
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=20210726123301.GK1120967@movementarian.org \
--to=john.levon@nutanix.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).