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 75FF343D18; Thu, 21 Mar 2024 18:11:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49AE142830; Thu, 21 Mar 2024 18:11:33 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 9933F427E1 for ; Thu, 21 Mar 2024 18:11:32 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C2FDF20B74C0; Thu, 21 Mar 2024 10:11:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C2FDF20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711041091; bh=L+LhzEi1ZNKfVmT2PFgzUVVNqXpvsHI1XNfQUGSJ20Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sh3NY0HZ/qioWXK4EU00/etVZMHQ5juMFUqdoJzs5xJi92ITjFTMmEkfObwfWWSaD 3WGZvSnvwBqXLJKXdeMj1SQ6Llqc4GN41fztcu8W6SkTDgf8f4c5VmT0GJZdrPPDf2 MnGHZ68WOO0bi4H1DGGzKzHz/FPWmbky83AwfCfc= Date: Thu, 21 Mar 2024 10:11:31 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org Subject: Re: [PATCH v10 08/10] eal: add option to put timestamp on console output Message-ID: <20240321171131.GD27371@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240321161146.340421-1-stephen@networkplumber.org> <20240321161146.340421-9-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321161146.340421-9-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Thu, Mar 21, 2024 at 09:00:24AM -0700, Stephen Hemminger wrote: > When debugging driver or startup issues, it is useful to have > a timestamp on each message printed. The messages in syslog > already have a timestamp, but often syslog is not available > during testing. > > There are multiple timestamp formats similar to Linux dmesg. > The default is time relative since startup. Other alternatives > are delta, ctime, reltime and iso formats. > > Example: > $ dpdk-testpmd --log-timestamp -- -i > EAL: Detected CPU lcores: 8 > EAL: Detected NUMA nodes: 1 > [ 0.000083] EAL: Detected static linkage of DPDK > [ 0.002000] EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > [ 0.003507] EAL: Selected IOVA mode 'VA' > [ 0.006272] testpmd: No probed ethernet devices > Interactive-mode selected > [ 0.029567] testpmd: create a new mbuf pool : n=203456, size=2176, socket=0 > [ 0.029588] testpmd: preferred mempool ops selected: ring_mp_mc > > Signed-off-by: Stephen Hemminger > --- > app/test/test_eal_flags.c | 17 ++++ > doc/guides/prog_guide/log_lib.rst | 10 ++ > lib/eal/common/eal_common_options.c | 14 ++- > lib/eal/common/eal_options.h | 2 + > lib/log/log_internal.h | 9 ++ > lib/log/log_unix.c | 152 +++++++++++++++++++++++++++- > lib/log/log_windows.c | 6 ++ > lib/log/version.map | 1 + > 8 files changed, 205 insertions(+), 6 deletions(-) > > diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c > index 6cb4b0675730..eeb1799381d7 100644 > --- a/app/test/test_eal_flags.c > +++ b/app/test/test_eal_flags.c > @@ -1055,6 +1055,14 @@ test_misc_flags(void) > const char * const argv22[] = {prgname, prefix, mp_flag, > "--huge-worker-stack=512"}; > > + /* Try running with --log-timestamp */ > + const char * const argv23[] = {prgname, prefix, mp_flag, > + "--log-timestamp" }; > + > + /* Try running with --log-timestamp=iso */ > + const char * const argv24[] = {prgname, prefix, mp_flag, > + "--log-timestamp=iso" }; > + > /* run all tests also applicable to FreeBSD first */ > > if (launch_proc(argv0) == 0) { > @@ -1162,6 +1170,15 @@ test_misc_flags(void) > printf("Error - process did not run ok with --huge-worker-stack=size parameter\n"); > goto fail; > } > + if (launch_proc(argv23) != 0) { > + printf("Error - process did not run ok with --log-timestamp parameter\n"); > + goto fail; > + } > + if (launch_proc(argv24) != 0) { > + printf("Error - process did not run ok with --log-timestamp=iso parameter\n"); > + goto fail; > + } > + > > rmdir(hugepath_dir3); > rmdir(hugepath_dir2); > diff --git a/doc/guides/prog_guide/log_lib.rst b/doc/guides/prog_guide/log_lib.rst > index aacb36c36ce0..1d6b2e3cea5d 100644 > --- a/doc/guides/prog_guide/log_lib.rst > +++ b/doc/guides/prog_guide/log_lib.rst > @@ -73,6 +73,16 @@ For example:: > /path/to/app --syslog local0 > > > +Console timestamp > +~~~~~~~~~~~~~~~~~ > + > +On Linux and FreeBSD, an optional timestamp can be added before each > +message by adding the ``--log-timestamp`` option. i don't think Windows should be excluded from the feature, in general core libraries that get features should cover all platforms.