]> git.droids-corp.org - dpdk.git/commitdiff
log: get level for dynamic types
authorChas Williams <ciwillia@brocade.com>
Sat, 22 Jul 2017 20:07:33 +0000 (16:07 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 31 Jul 2017 07:45:45 +0000 (09:45 +0200)
This function wasn't provided in the original commit.

Fixes: 4f0981e6ec6c ("eal: deprecate log functions")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <ciwillia@brocade.com>
lib/librte_eal/bsdapp/eal/rte_eal_version.map
lib/librte_eal/common/eal_common_log.c
lib/librte_eal/common/include/rte_log.h
lib/librte_eal/linuxapp/eal/rte_eal_version.map

index f689f0c8fc137f5a88df77c6c65a9c31dfb5471d..aac6fd776c843ccb12b49bc2b1bb16d8d5e9d335 100644 (file)
@@ -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;
 
index 41ea92472b3319ebd93b2c7f5bc6bf217aae311c..0e3b9320954fc9d1bf3e8c47709ea05fdebb91e5 100644 (file)
@@ -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)
index 341913851e63b4dd6fb70b2f9a0e958749645bac..ec8dba79c688e7fd7708ce35e6a19b321b42ef31 100644 (file)
@@ -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.
  *
index 20207218967e033008efaee14deaeaa8c84d32af..3a8f15406aec2c009ca04688c07625b636680d83 100644 (file)
@@ -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;