DPDK usage discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: John Ousterhout <ouster@cs.stanford.edu>
Cc: users@dpdk.org, Matthew Hall <mhall@mhcomputing.net>
Subject: Re: [dpdk-users] Redirect DPDK log?
Date: Thu, 15 Sep 2016 08:49:49 +0200	[thread overview]
Message-ID: <6167786.8dthCUDyoR@xps13> (raw)
In-Reply-To: <CAGXJAmyy87zUK9X69dEw3Qgt99zAhXq4oPr_A24ETfuLcQ4+Qg@mail.gmail.com>

Hi,

2016-09-14 17:52, John Ousterhout:
> On Wed, Sep 14, 2016 at 2:24 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
> > On Wed, Sep 14, 2016 at 02:08:27PM -0700, John Ousterhout wrote:
> > > 
> > > Is there a mechanism in DPDK that can interpose on the log output? I see
> > > the function rte_openlog_stream to specify a different FILE* for output,
> > > but that isn't quite general enough. I'd like for a method in my
> > > application to receive all of the log messages, so I can wrap them
> > > appropriately and then add them to an application-specific log. Does
> > such a
> > > hooking mechanism exist?
> >
> > http://www.gnu.org/software/libc/manual/html_node/String-Streams.html
> 
> At first I thought this approach (fmemopen) might work, but now I'm not so
> sure. The problem is that fmemopen doesn't provide any sort of notification
> when it adds data to the buffer. My application can use a polling approach
> where it occasionally checks to see if data has been added, but this has a
> serious flaw. Some of the DPDK functions, such as rte_eal_init, can panic
> in the face of severe errors: they write information to the log and then
> exit the application. In a situation like this, the application will not
> have a chance to check for the log messages and relay them onto the
> appropriate place, so the log data will be dropped and the application will
> exit without leaving behind any information about what happened.
> 
> If there were a way to intercept calls to rte_panic, then I could take that
> opportunity to flush information from the fmemopen buffer, but I don't see
> a way to do that...?

The same issues were discussed here recently:
	http://dpdk.org/ml/archives/dev/2016-August/044940.html
In short, yes we should have a log hook or custom handler,
and yes, the panics/exit must be removed.

You are welcome to work on such improvement.

  reply	other threads:[~2016-09-15  6:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 21:08 John Ousterhout
2016-09-14 21:24 ` Matthew Hall
2016-09-15  0:52   ` John Ousterhout
2016-09-15  6:49     ` Thomas Monjalon [this message]
2016-09-15 18:06     ` Александр Киселев

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=6167786.8dthCUDyoR@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=mhall@mhcomputing.net \
    --cc=ouster@cs.stanford.edu \
    --cc=users@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).