From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 20F0FA0C47; Thu, 2 Sep 2021 12:27:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A61D40041; Thu, 2 Sep 2021 12:27:31 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id E06144003C for ; Thu, 2 Sep 2021 12:27:29 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10094"; a="199292320" X-IronPort-AV: E=Sophos;i="5.84,372,1620716400"; d="scan'208";a="199292320" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2021 03:27:29 -0700 X-IronPort-AV: E=Sophos;i="5.84,372,1620716400"; d="scan'208";a="532983681" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.1.171]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Sep 2021 03:27:27 -0700 Date: Thu, 2 Sep 2021 11:27:24 +0100 From: Bruce Richardson To: Ferruh Yigit Cc: Stephen Hemminger , Aman Singh , dev@dpdk.org Message-ID: References: <20210901061821.5259-1-aman.deep.singh@intel.com> <20210901101253.6991a2f6@hermes.local> <557a6cce-a043-357e-9f00-ea15025bf43f@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <557a6cce-a043-357e-9f00-ea15025bf43f@intel.com> Subject: Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On Thu, Sep 02, 2021 at 11:11:39AM +0100, Ferruh Yigit wrote: > On 9/1/2021 6:12 PM, Stephen Hemminger wrote: > > On Wed, 1 Sep 2021 11:48:21 +0530 > > Aman Singh wrote: > > > >> From the logs it is difficult to get the DPDK version > >> that was used. So added a debug log to print the same. > >> The log has been added in eal_init so it gets printed > >> at startup for any application. > >> > >> Signed-off-by: Aman Singh > >> --- > >> lib/eal/freebsd/eal.c | 2 +- > >> lib/eal/linux/eal.c | 2 +- > >> lib/eal/windows/eal.c | 1 + > >> 3 files changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c > >> index 6cee5ae369..a14a205f4d 100644 > >> --- a/lib/eal/freebsd/eal.c > >> +++ b/lib/eal/freebsd/eal.c > >> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv) > >> } > >> > >> eal_mcfg_complete(); > >> - > >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version()); > >> return fctret; > >> } > >> > >> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c > >> index 3577eaeaa4..a50960cc78 100644 > >> --- a/lib/eal/linux/eal.c > >> +++ b/lib/eal/linux/eal.c > >> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv) > >> } > >> > >> eal_mcfg_complete(); > >> - > >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version()); > >> return fctret; > >> } > >> > >> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c > >> index 3d8c520412..5e6d5d8930 100644 > >> --- a/lib/eal/windows/eal.c > >> +++ b/lib/eal/windows/eal.c > >> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv) > >> */ > >> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN); > >> rte_eal_mp_wait_lcore(); > >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version()); > >> return fctret; > >> } > >> > > > > NAK > > DPDK is already too chatty at startup. > > > Is it better if the log is 'debug', so it won't be visible by default? > This can be useful to support customers, sometimes when there are multiple > binaries around, it is hard to say version of them. > As Bruce reminded, '-v' eal option provides this feature, which is better than > nothing, but it is not as useful if you are looking to an old log without actual > binary. > > > If your application needs it then do-it-yourself. > > > > Application may have its own versioning, which can be unrelated to the DPDK > version numbers, this can be useful to get just DPDK version. I'd also point out that if you have a currently running DPDK binary and want to know the DPDK version number, just connect to the telemetry socket and it will tell you e.g. $ echo "quit" | sudo ./usertools/dpdk-telemetry.py Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2 {"version": "DPDK 21.11.0-rc0", "pid": 134894, "max_output_len": 16384} --> $ /Bruce