[dpdk-users] Redirect DPDK log?
thomas.monjalon at 6wind.com
Thu Sep 15 08:49:49 CEST 2016
2016-09-14 17:52, John Ousterhout:
> On Wed, Sep 14, 2016 at 2:24 PM, Matthew Hall <mhall at 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:
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.
More information about the users