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 50365A04E6; Sat, 31 Oct 2020 03:00:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38923C96E; Sat, 31 Oct 2020 03:00:22 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6EF82C900 for ; Sat, 31 Oct 2020 03:00:06 +0100 (CET) IronPort-SDR: eOVaSSXfLZh/LC4cc+EY0Wi5GOoxmULL0nqe2CP/ycfLP6w/BUDGWx5QeuT3lHUxbiozGiEqBR 1MF4Zmh2DPLw== X-IronPort-AV: E=McAfee;i="6000,8403,9790"; a="232867016" X-IronPort-AV: E=Sophos;i="5.77,435,1596524400"; d="scan'208";a="232867016" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 19:00:05 -0700 IronPort-SDR: cMX0u3+u+/war3wGHTuz336JAkst+8gU26Ru93P2ROa3l8d5db7SLuI0ITX/HVy2aXzduNJ6Ks yHG/np8pLOLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,435,1596524400"; d="scan'208";a="469704568" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga004.jf.intel.com with ESMTP; 30 Oct 2020 19:00:04 -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: Fri, 30 Oct 2020 21:01:29 -0500 Message-Id: <1604109710-31624-3-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1604109710-31624-1-git-send-email-timothy.mcdaniel@intel.com> References: <1602958879-8558-2-git-send-email-timothy.mcdaniel@intel.com> <1604109710-31624-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v8 02/23] 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 Reviewed-by: Gage Eads --- drivers/event/dlb2/dlb2.c | 7 +++++++ drivers/event/dlb2/dlb2_log.h | 25 +++++++++++++++++++++++++ drivers/event/dlb2/meson.build | 3 +-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 drivers/event/dlb2/dlb2.c create mode 100644 drivers/event/dlb2/dlb2_log.h diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c new file mode 100644 index 0000000..2082dd6 --- /dev/null +++ b/drivers/event/dlb2/dlb2.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#include + +RTE_LOG_REGISTER(eventdev_dlb2_log_level, pmd.event.dlb2, NOTICE); 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_ */ diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build index 5324043..435c1ee 100644 --- a/drivers/event/dlb2/meson.build +++ b/drivers/event/dlb2/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('dlb2.c') deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci'] -- 2.6.4