From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A52FDA04DB; Sat, 17 Oct 2020 21:02:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AD52A933; Sat, 17 Oct 2020 21:02:24 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 10D6AA903 for ; Sat, 17 Oct 2020 21:02:20 +0200 (CEST) IronPort-SDR: Le2YcakeEVeIYK3APeIgycTp9bZY2CmphH4vX+Je4rgFJK9rJSq3hILc6PK1XZHfT+40itRLmB WAnAzbPUce2Q== X-IronPort-AV: E=McAfee;i="6000,8403,9777"; a="166946635" X-IronPort-AV: E=Sophos;i="5.77,387,1596524400"; d="scan'208";a="166946635" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2020 12:02:17 -0700 IronPort-SDR: 6wOueIOsxQLHyd4rXq8oXQPuaFgxB2/ZJt64Rvaa9G6/rfzUQSehFl0OoY3o8MdXD9Ko0lLlZG PpquNEqmjLIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,387,1596524400"; d="scan'208";a="532137356" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga005.jf.intel.com with ESMTP; 17 Oct 2020 12:02:16 -0700 From: Timothy McDaniel To: Cc: dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com Date: Sat, 17 Oct 2020 14:03:56 -0500 Message-Id: <1602961456-17392-3-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1602961456-17392-1-git-send-email-timothy.mcdaniel@intel.com> References: <1596138614-17409-2-git-send-email-timothy.mcdaniel@intel.com> <1602961456-17392-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v5 02/22] event/dlb: add dynamic logging X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit adds base support for dynamic logging. The default log level is NOTICE. Dynamic logging is used exclusively throughout this patchset. Signed-off-by: Timothy McDaniel Reviewed-by: Gage Eads --- drivers/event/dlb/dlb_log.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 drivers/event/dlb/dlb_log.h diff --git a/drivers/event/dlb/dlb_log.h b/drivers/event/dlb/dlb_log.h new file mode 100644 index 0000000..c69c9e5 --- /dev/null +++ b/drivers/event/dlb/dlb_log.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#ifndef _DLB_EVDEV_LOG_H_ +#define _DLB_EVDEV_LOG_H_ + +extern int eventdev_dlb_log_level; + +/* Dynamic logging */ +#define DLB_LOG_IMPL(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, eventdev_dlb_log_level, "%s" fmt "\n", \ + __func__, ##args) + +#define DLB_LOG_INFO(fmt, args...) \ + DLB_LOG_IMPL(INFO, fmt, ## args) + +#define DLB_LOG_ERR(fmt, args...) \ + DLB_LOG_IMPL(ERR, fmt, ## args) + +/* remove debug logs at compile time unless actually debugging */ +#define DLB_LOG_DBG(fmt, args...) \ + RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + +#endif /* _DLB_EVDEV_LOG_H_ */ -- 2.6.4