[dpdk-dev] [PATCH] log: add API to check if a logtype can log in a given level

2020-03-03 Thread Ferruh Yigit
This is a helper function in case components would like to do more work than just logging a message based on log level, like for example collecting some stats if the log type is DEBUG etc.. A few existing relevant usage converted to this new API. Signed-off-by: Ferruh Yigit --- drivers/bus/fslm

Re: [dpdk-dev] [PATCH] log: add API to check if a logtype can log in a given level

2020-03-03 Thread Stephen Hemminger
On Tue, 3 Mar 2020 13:25:12 + Ferruh Yigit wrote: > > +int > +rte_log_can_log(uint32_t logtype, uint32_t level) > +{ > + int log_level; > + > + if (level > rte_log_get_global_level()) > + return 0; > + > + log_level = rte_log_get_level(logtype); > + if (log_leve

Re: [dpdk-dev] [PATCH] log: add API to check if a logtype can log in a given level

2020-03-03 Thread Ferruh Yigit
On 3/3/2020 4:02 PM, Stephen Hemminger wrote: > On Tue, 3 Mar 2020 13:25:12 + > Ferruh Yigit wrote: > >> >> +int >> +rte_log_can_log(uint32_t logtype, uint32_t level) >> +{ >> +int log_level; >> + >> +if (level > rte_log_get_global_level()) >> +return 0; >> + >> +lo