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 47542A04C1; Fri, 11 Sep 2020 22:30:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7726B1C1A0; Fri, 11 Sep 2020 22:30:13 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 08E14E07 for ; Fri, 11 Sep 2020 22:29:56 +0200 (CEST) IronPort-SDR: OF9GA8cltE9A3fhkDCG2Nf+uACKVoIsbvpGHeVgjCAswwEbLBfCZTX6e7UgBT32VdAofUBAiw6 uoV6Hk4Ng29w== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="156244339" X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="156244339" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 13:29:52 -0700 IronPort-SDR: lxmNe+qVeduYIKdKbXvngRu5xyQQPqnSbZc+7GHzPxZZsMt4BF+N8WLAp3rg65oAseWKMboFmz Duric4rQ27mw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="481453471" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga005.jf.intel.com with ESMTP; 11 Sep 2020 13:29:51 -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: Fri, 11 Sep 2020 15:26:07 -0500 Message-Id: <1599855987-25976-3-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1599855987-25976-1-git-send-email-timothy.mcdaniel@intel.com> References: <1599855987-25976-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 02/22] event/dlb2: 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 --- drivers/event/dlb2/dlb2_log.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 drivers/event/dlb2/dlb2_log.h diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h new file mode 100644 index 0000000..dc1481e --- /dev/null +++ b/drivers/event/dlb2/dlb2_log.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#ifndef _DLB2_EVDEV_LOG_H_ +#define _DLB2_EVDEV_LOG_H_ + +extern int eventdev_dlb2_log_level; + +/* Dynamic logging */ +#define DLB2_LOG_IMPL(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, eventdev_dlb2_log_level, "%s" fmt "\n", \ + __func__, ##args) + +#define DLB2_LOG_INFO(fmt, args...) \ + DLB2_LOG_IMPL(INFO, fmt, ## args) + +#define DLB2_LOG_ERR(fmt, args...) \ + DLB2_LOG_IMPL(ERR, fmt, ## args) + +/* remove debug logs at compile time unless actually debugging */ +#define DLB2_LOG_DBG(fmt, args...) \ + RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + +#endif /* _DLB2_EVDEV_LOG_H_ */ -- 2.6.4