[dpdk-dev] [PATCH v2] pipeline: add statistics for librte_pipeline ports and tables

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Thu May 21 18:15:36 CEST 2015



From: Jay Rolette [mailto:rolette at infiniteio.com]
Sent: Thursday, May 21, 2015 4:00 PM
To: Dumitrescu, Cristian
Cc: Thomas Monjalon; dev at dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] pipeline: add statistics for librte_pipeline ports and tables


On Thu, May 21, 2015 at 8:33 AM, Dumitrescu, Cristian <cristian.dumitrescu at intel.com<mailto:cristian.dumitrescu at intel.com>> wrote:
> > The problem I see with this approach is that you cannot turn off debug
> > messages while still having the statistics collected.  We should allow
> > people to collects the stats without getting the debug messages. How do
> > we do this?
>
> By setting build-time log level to debug, you would enable stats and debug
> messages. Then you can adjust the log messages level with the run-time
> option --log-level.

This is a really clever trick! I have to say it took me some time to make sure I got it right :)
So when RTE_LOG_LEVEL (build time option) is set to DEBUG (i.e. 8), then we get both the stats and the debug messages, but then we can adjust the level of debug messages at run-time through the --log-level EAL option.
I can work with this option, thank you!

There is one more simple proposal that came to my mind late last night: how about single config file option RTE_COLLECT_STATS=y/n that should be used by all the libs across the board to indicate whether stats should be enabled or not?
This is logically very similar to the solution above, as they both look at a single option in the config file, but maybe it is also more intuitive for people.

I will go with your choice. Which one do you pick?

As Stephen said previously, any real DPDK app needs stats. You can't support network products operationally without them. What's the point of making them optional other than trying to juice benchmarks?

Jay

Hi Jay,

As explained in this thread, our strategy as a library is to keep all options open for the application: the application should be the one to decide whether the statistics collection should be enabled or not.

The library should not take application level decisions:

a)      For application A, these stats are relevant, so they should be collected;

b)      For application B, these counters are not relevant, so they should not be collected, so we allow the application to spend the CPU cycles doing some other useful work;

c)      For application C, these counters might only be relevant during debugging phase, so they should be collected during that time, while later on, when debugging is completed, their collection should be disabled.

I do not see why we should force the application to collect the stats if/when it does not need them. The library should allow the application to decide what the library should do, not the other way around.

Regards,
Cristian



More information about the dev mailing list