[dpdk-dev] [RFC 0/8] eal: dynamic logs

Olivier Matz olivier.matz at 6wind.com
Mon Feb 6 16:27:49 CET 2017


On Mon, 6 Feb 2017 15:01:30 +0000, "Wiles, Keith"
<keith.wiles at intel.com> wrote:
> > On Feb 6, 2017, at 8:10 AM, Olivier Matz <olivier.matz at 6wind.com>
> > wrote:
> > 
> > Hi Bruce,
> > 
> > On Mon, 6 Feb 2017 13:49:03 +0000, Bruce Richardson
> > <bruce.richardson at intel.com> wrote:  
> >> On Mon, Feb 06, 2017 at 02:29:08PM +0100, Olivier Matz wrote:  
> >>> The objective of this RFC patchset is to introduce a framework to
> >>> support dynamic log types in EAL. It also provides one example of
> >>> use (in i40e).
> >>> 
> >>> Features:
> >>> - log types are identified by a string
> >>> - at registration, a uniq identifier is associated to a log type
> >>> - each log type can have its level changed dynamically
> >>> - extend command line parameters to set the log level of a
> >>> specific type, or logs matching a regular expression
> >>> - keep compat with other legacy types (eal, malloc, ring, user*,
> >>>  etc... keep their hardcoded log type value)
> >>> 
> >>> At the end, when, we can expect that all non-dataplane logs are
> >>> moved to be dynamic, so we can enable/disable them at runtime,
> >>> without recompiling. Many debug options can probably be removed
> >>> from configuration:
> >>>  $ git grep DEBUG config/common_base | wc -l
> >>>  89
> >>> 
> >>> Comments are welcome!
> >>>   
> >> Initial scan through the patches this looks pretty good. However,
> >> rather than continuing with our own logging system, have you
> >> investigated what other tracing and logging systems might be out
> >> there that we could possibly re-use? Could LTTng be a good fit for
> >> DPDK, perhaps?  
> > 
> > I did not investigate much about existing logging system. I agree
> > that could be a good alternative too.
> > 
> > On the other hand, I'm not really confident in adding a dependency
> > to an external lib for a core component like eal. What if we deicide
> > tomorrow to port dpdk to windows or any baremetal env?
> > 
> > Also, as far as I remember, the components that depend on external
> > libraries are disabled today because we don't know how to properly
> > manage the dependency (ex: pmd-pcap, vhost-numa, pmd-mlx, …).  
> 
> In a previous project I worked in we did not use log levels per say
> for debugging code. We did have a couple general logging for misc
> type logging.
> 
> When debugging you normally only need a couple files or functions
> that need to produce logging output. In that case we defined logging
> using the file and function as the key to determine if the dynamic
> log messages are output. We use a string in the format of
> "filename:function” we allowed for a wildcard to enable all functions
> in a file or you can select a single function.
> 
> Using this type of logging for debugging a system is the most useful
> if you just want general logging then we define something similar to
> what we have today.

I think the "filename:function" is not adequate if you are not the
developer of that code. Example: you have a problem with a PMD, you
just enable all logs for this PMD (or even all PMDs), you can check it
and if you don't find the problem, you can send them on the ML for help.
I think you don't care where the code is located.

Regards,
Olivier


More information about the dev mailing list