Wrapping DPDK log messages with an application logger

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Thu Jun 22 18:08:25 CEST 2023


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


More information about the users mailing list