log: fix level/type retrieving from a standard thread
authorMaxime Leroy <maxime.leroy@6wind.com>
Mon, 9 May 2016 16:13:36 +0000 (18:13 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 May 2016 14:49:39 +0000 (16:49 +0200)
commit5c37334a3d2218180135bfe4716d35e0cfb293ba
tree79433b64343f90c947ce9962dd9c2930567e556e
parent8919f73bcbaaa85405620982cf6f7a30517b279a
log: fix level/type retrieving from a standard thread

The functions rte_log_cur_msg_loglevel() and rte_log_cur_msg_logtype()
return the current log level/type for the message being processed. They
are used when implementing a user-defined logging stream.

The current log levels and types were stored in a table indexed by the
lcore_id, only returning a valid value for dataplane threads. Setting
and getting these values in a non dataplane thread was ignored, using
the global value instead.

To fix this issue, a per-thread variable could be used (with
RTE_DEFINE_PER_LCORE), allowing any pthread to set and retrieve its
current log level or type.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
lib/librte_eal/common/eal_common_log.c