DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: "Lukáš Šišmiš" <sismis@cesnet.cz>, users@dpdk.org
Subject: Re: Wrapping DPDK log messages with an application logger
Date: Sun, 25 Jun 2023 07:51:03 -0700	[thread overview]
Message-ID: <20230625075103.6dfcab6c@hermes.local> (raw)
In-Reply-To: <20230622190825.57eebf75@sovereign>

On Thu, 22 Jun 2023 19:08:25 +0300
Dmitry Kozlyuk <dmitry.kozliuk@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.


      reply	other threads:[~2023-06-25 14:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 15:45 Lukáš Šišmiš
2023-06-22 16:08 ` Dmitry Kozlyuk
2023-06-25 14:51   ` Stephen Hemminger [this message]

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=20230625075103.6dfcab6c@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=sismis@cesnet.cz \
    --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).