From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by dpdk.org (Postfix) with ESMTP id 9718DE5D for ; Tue, 19 Dec 2017 07:38:46 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id q20so10204607pgv.2 for ; Mon, 18 Dec 2017 22:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iS/hdbumbewAG8SuJqw7o2Pieuz8/IDJf47HR66bWxU=; b=gqg8uWIjirQ6FxMKoQwwCcuP05nMLUNvSRF6UkIiO/o7Yv5Goyy3N0TcWb9i4tEG93 KwbJiUy+vV+zqZYl8H/RBujMYfAhKvrbxk8hkjincRnp+GtBlJTbOC1kX9GNAkeaGBrD tF5++rpZrfRQr02Kw/qXTGraj4Okmd+S49Ngbc1OklrV3t2yucLknzDaaRau3a5YCXkT U3p7YM7edbrDssqxlmv78Wgs3oqc1OrfPSQC7ODAOSikofATLesF/+EeF4YoAS5uwNaz 3MmdlgkwrZCRQCqgTWXfV/ZPjefpGN0Vmkt15DcflpUtwFARX9p9ZuUE4BfbMCsGsIJL Zkag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iS/hdbumbewAG8SuJqw7o2Pieuz8/IDJf47HR66bWxU=; b=gAE3VblbwrGIVr05Ld5cOnThxyWbstb3QUIYCQj9waxO7LxJ4KpC1gb1EuGGtv8Tyy ZCagomKpCdvJETvt2B2v2tiIRFuuFsxJPOGcEuemqSeuva/m0BlINQnp6LRlm22guGdC TamnrYVwm1Dh28BmFAI/uM7B/F+wcSSEqYaeOO3ibdwnAZ8d3lzZ3mzFNyzWj0uf3pKm bOel1wZavrpDn2MgUAkRwBu8NpLLBUs2S7x7kh0b/gSypJXLquS2ykYPx8JF+XnDvTxM /Vr+qCjj+7v+QyQBpDN0Ehg6M+xqmE/DmkRb/pKrQNZVp4Q4MZldRwMXxw8OnKw3hlyv 61Ow== X-Gm-Message-State: AKGB3mIbrrdaiu8ZyK3b67MAxX/4mntPrpT3ZrojIql59GcFuAlJRv0v QBw2xZdw58X/b+a3vbTSgSRemlfQfhY= X-Google-Smtp-Source: ACJfBotmBINCbijt8Vm/7CqkhrC7oncmFoKt0Kr22Us53QbRjUH5Dd51b9+WvH+s7xTXQ9M6yo1xCA== X-Received: by 10.98.102.219 with SMTP id s88mr2225424pfj.191.1513665525425; Mon, 18 Dec 2017 22:38:45 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id d9sm31288842pfk.117.2017.12.18.22.38.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 22:38:44 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 18 Dec 2017 22:38:30 -0800 Message-Id: <20171219063840.18981-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171219063840.18981-1-stephen@networkplumber.org> References: <20171219063840.18981-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 01/11] avp: implement 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: , X-List-Received-Date: Tue, 19 Dec 2017 06:38:46 -0000 All PMD should be using dynamic log levels. Signed-off-by: Stephen Hemminger --- config/common_base | 1 - drivers/net/avp/avp_ethdev.c | 10 ++++++++++ drivers/net/avp/avp_logs.h | 9 ++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/config/common_base b/config/common_base index e74febef4848..f775ec96184c 100644 --- a/config/common_base +++ b/config/common_base @@ -441,7 +441,6 @@ CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_AVP_DEBUG_RX=n CONFIG_RTE_LIBRTE_AVP_DEBUG_TX=n -CONFIG_RTE_LIBRTE_AVP_DEBUG_DRIVER=y CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 9b342bfa3ae8..deb6f355d3ef 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -60,6 +60,7 @@ #include "avp_logs.h" +int avp_logtype_driver; static int avp_dev_create(struct rte_pci_device *pci_dev, struct rte_eth_dev *eth_dev); @@ -2312,3 +2313,12 @@ avp_dev_stats_reset(struct rte_eth_dev *eth_dev) RTE_PMD_REGISTER_PCI(net_avp, rte_avp_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_avp, pci_id_avp_map); + +RTE_INIT(avp_init_log); +static void +avp_init_log(void) +{ + avp_logtype_driver = rte_log_register("pmd.avp.driver"); + if (avp_logtype_driver >= 0) + rte_log_set_level(avp_logtype_driver, RTE_LOG_NOTICE); +} diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h index 252cab7da2cf..e29394d5857f 100644 --- a/drivers/net/avp/avp_logs.h +++ b/drivers/net/avp/avp_logs.h @@ -49,11 +49,10 @@ #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -#ifdef RTE_LIBRTE_AVP_DEBUG_DRIVER +extern int avp_logtype_driver; + #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) -#else -#define PMD_DRV_LOG(level, fmt, args...) do { } while (0) -#endif + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s(): " fmt, __func__, ## args) #endif /* _AVP_LOGS_H_ */ -- 2.11.0