X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_log.h;h=2e47e7f6970ad0d587f223652b327ccf585e12c3;hb=6a34f91690d0;hp=834b4f6edbc096369911c13a871ef9a4915b8a0f;hpb=ca71bbfa0448e8ac2f8bc028d3bad7c7dd33f5c1;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 834b4f6edb..2e47e7f697 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -76,6 +76,9 @@ extern struct rte_logs rte_logs; #define RTE_LOGTYPE_SCHED 0x00001000 /**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 0x00002000 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 0x00004000 /**< Log related to table. */ +#define RTE_LOGTYPE_PIPELINE 0x00008000 /**< Log related to pipeline. */ +#define RTE_LOGTYPE_MBUF 0x00010000 /**< Log related to mbuf. */ +#define RTE_LOGTYPE_CRYPTODEV 0x00020000 /**< Log related to cryptodev. */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 0x01000000 /**< User-defined log type 1. */ @@ -105,8 +108,7 @@ extern FILE *eal_default_log_stream; * * This can be done at any time. The f argument represents the stream * to be used to send the logs. If f is NULL, the default output is - * used, which is the serial line in case of bare metal, or directly - * sent to syslog in case of linux application. + * used (stderr). * * @param f * Pointer to the stream. @@ -128,6 +130,11 @@ int rte_openlog_stream(FILE *f); */ void rte_set_log_level(uint32_t level); +/** + * Get the global log level. + */ +uint32_t rte_get_log_level(void); + /** * Enable or disable the log type. * @@ -138,6 +145,11 @@ void rte_set_log_level(uint32_t level); */ void rte_set_log_type(uint32_t type, int enable); +/** + * Get the global log type. + */ +uint32_t rte_get_log_type(void); + /** * Get the current loglevel for the message being processed. * @@ -257,7 +269,8 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...) * - 0: Success. * - Negative on error. */ -int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap); +int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) + __attribute__((format(printf,3,0))); /** * Generates a log message. @@ -278,19 +291,15 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap); * @param t * The log type, for example, EAL. The short name is expanded by the * macro, so it cannot be an integer value. - * @param fmt + * @param ... * The fmt string, as in printf(3), followed by the variable arguments * required by the format. - * @param args - * The variable list of arguments according to the format string. * @return * - 0: Success. * - Negative on error. */ #define RTE_LOG(l, t, ...) \ - (void)(((RTE_LOG_ ## l <= RTE_LOG_LEVEL) && \ - (RTE_LOG_ ## l <= rte_logs.level) && \ - (RTE_LOGTYPE_ ## t & rte_logs.type)) ? \ + (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \ rte_log(RTE_LOG_ ## l, \ RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \ 0)