From: Chas Williams Date: Sat, 22 Jul 2017 20:07:33 +0000 (-0400) Subject: log: get level for dynamic types X-Git-Tag: spdx-start~2337 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8783252166dac9cf9a829f8e697ebb3cfba4e874;p=dpdk.git log: get level for dynamic types This function wasn't provided in the original commit. Fixes: 4f0981e6ec6c ("eal: deprecate log functions") Cc: stable@dpdk.org Signed-off-by: Chas Williams --- diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index f689f0c8fc..aac6fd776c 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -200,6 +200,7 @@ DPDK_17.08 { rte_bus_find; rte_bus_find_by_device; rte_bus_find_by_name; + rte_log_get_level; } DPDK_17.05; diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 41ea92472b..0e3b932095 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -112,6 +112,15 @@ rte_get_log_level(void) return rte_log_get_global_level(); } +int +rte_log_get_level(uint32_t type) +{ + if (type >= rte_logs.dynamic_types_len) + return -1; + + return rte_logs.dynamic_types[type].loglevel; +} + /* Set global log type */ __rte_deprecated void rte_set_log_type(uint32_t type, int enable) diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 341913851e..ec8dba79c6 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -174,6 +174,16 @@ void rte_set_log_type(uint32_t type, int enable); __rte_deprecated uint32_t rte_get_log_type(void); +/** + * Get the log level for a given type. + * + * @param logtype + * The log type identifier. + * @return + * 0 on success, a negative value if logtype is invalid. + */ +int rte_log_get_level(uint32_t logtype); + /** * Set the log level for a given type. * diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 2020721896..3a8f15406a 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -205,6 +205,7 @@ DPDK_17.08 { rte_bus_find; rte_bus_find_by_device; rte_bus_find_by_name; + rte_log_get_level; } DPDK_17.05;