[dpdk-dev] [RFC PATCH] log: track log level changes

Lukasz Wojciechowski l.wojciechow at partner.samsung.com
Thu Jul 9 02:16:27 CEST 2020


W dniu 26.06.2020 o 16:46, Andrew Rybchenko pisze:
> On 6/26/20 2:47 PM, David Marchand wrote:
>> Add a log message when changing log levels to be sure of which logtype
>> is enabled.
>>
>> Suggested-by: Ilya Maximets <i.maximets at ovn.org>
>> Signed-off-by: David Marchand <david.marchand at redhat.com>
> Acked-by: Andrew Rybchenko <arybchenko at solarflare.com>
>
I also like the idea so:

Acked-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>

although I think there is one place that can be smoothed a bit. Every 
newly registered type's loglevel is set to RTE_LOG_INFO in 
__rte_log_register(), so:
* if new type is registered with rte_log_register_type_and_pick_level() 
and level is set to INFO, nothing will be printed (as current is equal 
to new level);
* any registration made with rte_log_register() won't be seen either as 
there is no call to newly introduced function logtype_set_level().

How about additionally changing behavior so any registration will print 
change from "disabled" (level=0) to new level:
* in case of rte_log_register_type_and_pick_level() to chosen level
* in case of rte_log_register() to default level which is "info"

Best regards

-- 

Lukasz Wojciechowski
Principal Software Engineer

Samsung R&D Institute Poland
Samsung Electronics
Office +48 22 377 88 25
l.wojciechow at partner.samsung.com



More information about the dev mailing list