DPDK usage discussions
 help / color / mirror / Atom feed
From: John Ousterhout <ouster@cs.stanford.edu>
To: Matthew Hall <mhall@mhcomputing.net>
Cc: users@dpdk.org
Subject: Re: [dpdk-users] Redirect DPDK log?
Date: Wed, 14 Sep 2016 17:52:00 -0700	[thread overview]
Message-ID: <CAGXJAmyy87zUK9X69dEw3Qgt99zAhXq4oPr_A24ETfuLcQ4+Qg@mail.gmail.com> (raw)
In-Reply-To: <20160914212457.GA6972@mhcomputing.net>

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...?

-John-

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
>
> Matthew.
>

  reply	other threads:[~2016-09-15  0:52 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 [this message]
2016-09-15  6:49     ` Thomas Monjalon
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=CAGXJAmyy87zUK9X69dEw3Qgt99zAhXq4oPr_A24ETfuLcQ4+Qg@mail.gmail.com \
    --to=ouster@cs.stanford.edu \
    --cc=mhall@mhcomputing.net \
    --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).