git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx4: fix Rx packet type offloads
[dpdk.git]
/
lib
/
librte_eal
/
common
/
eal_common_log.c
diff --git
a/lib/librte_eal/common/eal_common_log.c
b/lib/librte_eal/common/eal_common_log.c
index
5f38ca5
..
be40413
100644
(file)
--- a/
lib/librte_eal/common/eal_common_log.c
+++ b/
lib/librte_eal/common/eal_common_log.c
@@
-89,14
+89,6
@@
rte_log_set_global_level(uint32_t level)
rte_logs.level = (uint32_t)level;
}
rte_logs.level = (uint32_t)level;
}
-/* Set global log level */
-/* replaced by rte_log_set_global_level */
-__rte_deprecated void
-rte_set_log_level(uint32_t level)
-{
- rte_log_set_global_level(level);
-}
-
/* Get global log level */
uint32_t
rte_log_get_global_level(void)
/* Get global log level */
uint32_t
rte_log_get_global_level(void)
@@
-104,36
+96,13
@@
rte_log_get_global_level(void)
return rte_logs.level;
}
return rte_logs.level;
}
-/* Get global log level */
-/* replaced by rte_log_get_global_level */
-uint32_t
-rte_get_log_level(void)
-{
- return rte_log_get_global_level();
-}
-
-/* Set global log type */
-__rte_deprecated void
-rte_set_log_type(uint32_t type, int enable)
+int
+rte_log_get_level(uint32_t type)
{
{
- if (type < RTE_LOGTYPE_FIRST_EXT_ID) {
- if (enable)
- rte_logs.type |= 1 << type;
- else
- rte_logs.type &= ~(1 << type);
- }
-
- if (enable)
- rte_log_set_level(type, 0);
- else
- rte_log_set_level(type, RTE_LOG_DEBUG);
-}
+ if (type >= rte_logs.dynamic_types_len)
+ return -1;
-/* Get global log type */
-__rte_deprecated uint32_t
-rte_get_log_type(void)
-{
- return rte_logs.type;
+ return rte_logs.dynamic_types[type].loglevel;
}
int
}
int
@@
-173,13
+142,13
@@
rte_log_set_level_regexp(const char *pattern, uint32_t level)
return 0;
}
return 0;
}
-/* get the current loglevel for the message be
e
ing processed */
+/* get the current loglevel for the message being processed */
int rte_log_cur_msg_loglevel(void)
{
return RTE_PER_LCORE(log_cur_msg).loglevel;
}
int rte_log_cur_msg_loglevel(void)
{
return RTE_PER_LCORE(log_cur_msg).loglevel;
}
-/* get the current logtype for the message be
e
ing processed */
+/* get the current logtype for the message being processed */
int rte_log_cur_msg_logtype(void)
{
return RTE_PER_LCORE(log_cur_msg).logtype;
int rte_log_cur_msg_logtype(void)
{
return RTE_PER_LCORE(log_cur_msg).logtype;
@@
-280,7
+249,8
@@
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_USER8, "user8"}
};
{RTE_LOGTYPE_USER8, "user8"}
};
-RTE_INIT(rte_log_init);
+/* Logging should be first initialzer (before drivers and bus) */
+RTE_INIT_PRIO(rte_log_init, 101);
static void
rte_log_init(void)
{
static void
rte_log_init(void)
{
@@
-309,6
+279,7
@@
static const char *
loglevel_to_string(uint32_t level)
{
switch (level) {
loglevel_to_string(uint32_t level)
{
switch (level) {
+ case 0: return "disabled";
case RTE_LOG_EMERG: return "emerg";
case RTE_LOG_ALERT: return "alert";
case RTE_LOG_CRIT: return "critical";
case RTE_LOG_EMERG: return "emerg";
case RTE_LOG_ALERT: return "alert";
case RTE_LOG_CRIT: return "critical";