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 C44E2A04B5; Thu, 29 Oct 2020 15:56:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF1BACF61; Thu, 29 Oct 2020 15:56:15 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7B96BCE77 for ; Thu, 29 Oct 2020 15:56:09 +0100 (CET) IronPort-SDR: i4dUXokO/qfqjGc0o5qiktRMdRHj27oI9QxC36CTX6cwROA48PFsFo0GaDsnllJd/uuKNSnfJr NfS9brsRb3YA== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="155414558" X-IronPort-AV: E=Sophos;i="5.77,430,1596524400"; d="scan'208";a="155414558" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 07:56:07 -0700 IronPort-SDR: 9DxcHRB22i/r81XwDZ9gpGmxUUPgpJHKog+PLrXsfVcie8Tk1u3Vo7tc7P9q/UIvwyK1wO268r 0biM0X07BSwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,430,1596524400"; d="scan'208";a="526760377" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga005.fm.intel.com with ESMTP; 29 Oct 2020 07:56:07 -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, thomas@monjalon.net Date: Thu, 29 Oct 2020 09:57:33 -0500 Message-Id: <1603983474-16354-3-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1603983474-16354-1-git-send-email-timothy.mcdaniel@intel.com> References: <20200612212434.6852-2-timothy.mcdaniel@intel.com> <1603983474-16354-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v7 02/23] 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.c | 7 +++++++ drivers/event/dlb/dlb_log.h | 25 +++++++++++++++++++++++++ drivers/event/dlb/meson.build | 3 +-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 drivers/event/dlb/dlb.c create mode 100644 drivers/event/dlb/dlb_log.h diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c new file mode 100644 index 0000000..e03aa21 --- /dev/null +++ b/drivers/event/dlb/dlb.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#include + +RTE_LOG_REGISTER(eventdev_dlb_log_level, pmd.event.dlb, NOTICE); 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_ */ diff --git a/drivers/event/dlb/meson.build b/drivers/event/dlb/meson.build index 5324043..1e7d5ad 100644 --- a/drivers/event/dlb/meson.build +++ b/drivers/event/dlb/meson.build @@ -7,7 +7,6 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64') subdir_done() endif -sources = files( -) +sources = files('dlb.c') deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci'] -- 2.6.4