From patchwork Fri Apr 22 13:43:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 12207 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7C1E947D0; Fri, 22 Apr 2016 15:44:25 +0200 (CEST) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 56D9837B2 for ; Fri, 22 Apr 2016 15:44:23 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id u206so27729001wme.1 for ; Fri, 22 Apr 2016 06:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=jioaCOEbw6/4o+8YL7YQcPuD2bZTs4swWjFOHKyUR8M=; b=oi9BiUv0pmv8SSna7TO9JnXTcxs/CbhLsCTgCKjstvSfVaepHnPNzy9xVWxYyoo+OF kB+pM3nH28/YUnceGPCnjJOEirAWg8Bvh2wEERCFPSPpPGd60qAj18kz/Zqe8u5kwZLO 2VJvzdGQdoPlk63v2+nf2/iXURSuf0UKMg5B0zTIjjhywiKJDfuBREVnyDuD83+VPTMD BEjH1jTYJH1aMhDyNvWqkDfxy3W5SeeN25zqEr0xF8Dv4VLhqK8A0TXB8NmxtnBjFDt6 lvDcKA5O+G9qdPpVnmGy/O9qh2Jn8ZZfzbeoUx45fwCN/Op3Fr3cJw3cVpG1UYg+/Qcz cktQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jioaCOEbw6/4o+8YL7YQcPuD2bZTs4swWjFOHKyUR8M=; b=X0AHzMssIkuD4mFiOhZ9JHzepz/27kjvJCdgVaXpFClZYGmzbiaJL7J9+cJBWaR8UX pvpDIdctoZjp9TkCpdACP11Q/IHEDRth8rgOhvjhv7FrX83E4J7Kp+qUvj/IhWzNlOCb G2HktW3Q4boOVB490BXos1TAJqJ6D6gVEAyY7tQzkrs8FHmeVl7ojUUkLraCWyI2dihH qHA1m6wDcsqmLREPRHTtrVxF8VwpQ4MMZ49TaXrExOin6r46HU5GeJ6aBjukp3Z85WeX 2dD23WxusM8lWGREpfKYNtCKqlfYoHFRWTSnx8lC552SDhCFXCQF2+SlYviaOgkhkvzM S2Vg== X-Gm-Message-State: AOPr4FUXOn/U+7fkpVsNpD1SA7JpfLS6eLgSeXity0ryKTACcMJ+QIJltWC8/7BlMhHx4PsP X-Received: by 10.28.27.17 with SMTP id b17mr2691255wmb.19.1461332663109; Fri, 22 Apr 2016 06:44:23 -0700 (PDT) Received: from XPS13.livebox.home (APoitiers-658-1-12-134.w86-213.abo.wanadoo.fr. [86.213.195.134]) by smtp.gmail.com with ESMTPSA id qt3sm8149097wjc.32.2016.04.22.06.44.22 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Apr 2016 06:44:22 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Fri, 22 Apr 2016 15:43:58 +0200 Message-Id: <1461332640-24273-3-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1461332640-24273-1-git-send-email-thomas.monjalon@6wind.com> References: <1461332640-24273-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH 2/4] log: increase default level to info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The default was to compile every logs (including debug) and set the default level to debug. As some debug logs may hurt performance, a notice is added and the default level is now info. In order to enable debug logs, they must be compiled with RTE_LOG_LEVEL=RTE_LOG_DEBUG and enabled at runtime with --log-level=8. Signed-off-by: Thomas Monjalon --- config/common_base | 2 +- doc/guides/faq/faq.rst | 7 ++++--- lib/librte_eal/common/eal_common_log.c | 5 +++++ lib/librte_eal/common/eal_common_options.c | 4 ++++ scripts/test-build.sh | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config/common_base b/config/common_base index 1a54e4c..35d38d9 100644 --- a/config/common_base +++ b/config/common_base @@ -88,7 +88,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8 CONFIG_RTE_MAX_MEMSEG=256 CONFIG_RTE_MAX_MEMZONE=2560 CONFIG_RTE_MAX_TAILQ=32 -CONFIG_RTE_LOG_LEVEL=8 +CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO CONFIG_RTE_LOG_HISTORY=256 CONFIG_RTE_LIBEAL_USE_HPET=n CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n diff --git a/doc/guides/faq/faq.rst b/doc/guides/faq/faq.rst index 368374f..3228b92 100644 --- a/doc/guides/faq/faq.rst +++ b/doc/guides/faq/faq.rst @@ -88,9 +88,7 @@ the wrong socket, the application simply will not start. On application startup, there is a lot of EAL information printed. Is there any way to reduce this? --------------------------------------------------------------------------------------------------- -Yes, each EAL has a configuration file that is located in the /config directory. Within each configuration file, you will find CONFIG_RTE_LOG_LEVEL=8. -You can change this to a lower value, such as 6 to reduce this printout of debug information. The following is a list of LOG levels that can be found in the rte_log.h file. -You must remove, then rebuild, the EAL directory for the change to become effective as the configuration file creates the rte_config.h file in the EAL directory. +Yes, the option ``--log-level=`` accepts one of these numbers: .. code-block:: c @@ -103,6 +101,9 @@ You must remove, then rebuild, the EAL directory for the change to become effect #define RTE_LOG_INFO 7U /* Informational. */ #define RTE_LOG_DEBUG 8U /* Debug-level messages. */ +It is also possible to change the maximum (and default level) at compile time +with ``CONFIG_RTE_LOG_LEVEL``. + How can I tune my network application to achieve lower latency? --------------------------------------------------------------- diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 1ae8de7..64aa79f 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -333,5 +333,10 @@ rte_eal_common_log_init(FILE *default_log) default_log_stream = default_log; rte_openlog_stream(default_log); + +#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG + RTE_LOG(NOTICE, EAL, "Debug logs available - lower performance\n"); +#endif + return 0; } diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 2b418d5..3efc90f 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -139,7 +139,11 @@ eal_reset_internal_config(struct internal_config *internal_cfg) internal_cfg->syslog_facility = LOG_DAEMON; /* default value from build option */ +#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG + internal_cfg->log_level = RTE_LOG_INFO; +#else internal_cfg->log_level = RTE_LOG_LEVEL; +#endif internal_cfg->xen_dom0_support = 0; diff --git a/scripts/test-build.sh b/scripts/test-build.sh index 9de90f7..9685dea 100755 --- a/scripts/test-build.sh +++ b/scripts/test-build.sh @@ -138,6 +138,7 @@ config () # ! echo $3 | grep -q '+shared' || \ sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config ! echo $3 | grep -q '+debug' || ( \ + sed -ri 's,(RTE_LOG_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config sed -ri 's,(_STAT.*=)n,\1y,' $1/.config sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )