X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fqat%2Fqat_logs.c;h=adbe163cd9b2df28b50cca1af0c7d9cccd0df3dc;hb=3de9af2aaa680b33a9a597b8ec4d76163dee2029;hp=f97aba19d7c45cac8acada969204a84f55637007;hpb=b5fedaedfcf272d1a86802132a1691ac5485f31d;p=dpdk.git diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c index f97aba19d7..adbe163cd9 100644 --- a/drivers/common/qat/qat_logs.c +++ b/drivers/common/qat/qat_logs.c @@ -7,31 +7,15 @@ #include "qat_logs.h" -int qat_gen_logtype; -int qat_dp_logtype; - int qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title, const void *buf, unsigned int len) { - if (level > rte_log_get_global_level()) - return 0; - if (level > (uint32_t)(rte_log_get_level(logtype))) - return 0; + if (rte_log_can_log(logtype, level)) + rte_hexdump(rte_log_get_stream(), title, buf, len); - rte_hexdump(rte_log_get_stream(), title, buf, len); return 0; } -RTE_INIT(qat_pci_init_log) -{ - /* Non-data-path logging for pci device and all services */ - qat_gen_logtype = rte_log_register("pmd.qat_general"); - if (qat_gen_logtype >= 0) - rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE); - - /* data-path logging for all services */ - qat_dp_logtype = rte_log_register("pmd.qat_dp"); - if (qat_dp_logtype >= 0) - rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE); +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);