Wrapping DPDK log messages with an application logger
Stephen Hemminger
stephen at networkplumber.org
Sun Jun 25 16:51:03 CEST 2023
On Thu, 22 Jun 2023 19:08:25 +0300
Dmitry Kozlyuk <dmitry.kozliuk at gmail.com> wrote:
> Hi,
>
> 2023-06-22 17:45 (UTC+0200), Lukáš Šišmiš:
> > I would think there could be opportunity to pass my logging callback into
> > DPDK but I have not found it.
>
> FWIW, I too think a callback would be better than what DPDK offers now,
> because FILE* argument in rte_openlog_stream() is specific to C (libc).
>
> > The only thing that I found was setting the stream (rte_openlog_stream()).
>
> Correct, this is what you're supposed to use.
>
> > So I think I could use a Linux pipe to which DPDK would write to and the
> > application would read the contents of it, parsing it into messages and
> > logging it with the application logger.
>
> > Is there any alternative solution?
>
> https://man7.org/linux/man-pages/man3/fopencookie.3.html
>
> It's effectively a way to pass the callback you want, just wrapped in a FILE*.
I have use fopencookie and rte_logstream to handle this in the past.
Probably the code is still there in Danos and other projects.
More information about the users
mailing list