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 DE407A04B0; Fri, 14 Aug 2020 20:46:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D8D61C0C5; Fri, 14 Aug 2020 20:46:00 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id 229791C0BD for ; Fri, 14 Aug 2020 20:45:58 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id mt12so4821566pjb.4 for ; Fri, 14 Aug 2020 11:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g+xdn8wAyEMYqHHzSMiTvEm7cVCcoielRy3n/f3dL10=; b=zFZMJQBSNhcbBR1vPFDNOm4jOA7iPrc3d1a8AI6y6O07pmkyCIaoVlRxUvxYYJq+M/ KDJON+SZ5glof+4nddLUSsz4lIrvOHoCZsXheD/bPd3PosRhgZyU0EAQHpN22kVStujV Orn1RfHpJy54f3V5VW7C26ibXTVyMoCh9jkW6vXZBs8kpodwfO6vdthQ85WO9I9ihiGb WnNIY0yvsP7nQ8zPy03Z4ZMY0Ob15ScvLleK5VhKeFy1cC2iTWHjjHrjXrXSthUDM2e1 Oq6xheaa6M3P+QpQRv0uu1y1n5Pz7VPWKImyQU3r5cbczvcujDXDyrtZb+4fJoYGMApj ndrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g+xdn8wAyEMYqHHzSMiTvEm7cVCcoielRy3n/f3dL10=; b=RLsCMCFNVbto1ce9taB4pet+dVcBWDBd6QHNWHLWGMWI3cP37fmPTW4regc490jkgp 35IySJ/oEn+RZPpKk84lITyreub5Y1kNcCKmCo01m+BSlYlChBbTuIbERXfPdzuZQAs8 f/Gh0Qr9+/H+ckNJYtCJ9n2y3xFOyD2ylUBZ6I9s6fZHThXvldKIUyLjSf1p/rYs7kRU oE18f4otizEdb6MdCXnbwPMoTYnMKa2QlDCQhs27V4upuX8vA6xgQJCem2T1fVPy5+/S CkGar6p+ngtJbGsBM1JlaQ66IcmdMEM9xFm7c9vWyUGx6ZflJ08GFy2scbNy/icvTlEG dTiA== X-Gm-Message-State: AOAM53019Y8/70vW2sG60sCErFmevBdLRli9al4KweHQ6/oA6fXWY9PY OBSeoDEBNYePdXQb8okXCI4Dbw== X-Google-Smtp-Source: ABdhPJwMZJxl2P07NEuK/gJG6APd72Ikgq1ot3CFxiJZSKXOEZwzEmCcraaR8zid53l8DPYWsilzsg== X-Received: by 2002:a17:90a:d195:: with SMTP id fu21mr3317635pjb.100.1597430758042; Fri, 14 Aug 2020 11:45:58 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i14sm8897470pjz.25.2020.08.14.11.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 11:45:57 -0700 (PDT) Date: Fri, 14 Aug 2020 11:45:49 -0700 From: Stephen Hemminger To: Dmitry Kozlyuk Cc: dev@dpdk.org Message-ID: <20200814114549.528d144f@hermes.lan> In-Reply-To: <20200814213929.1d7ca040@sovereign> References: <20200814173441.23086-1-stephen@networkplumber.org> <20200814213929.1d7ca040@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: add option to put timestamp on console output 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" On Fri, 14 Aug 2020 21:39:29 +0300 Dmitry Kozlyuk wrote: > On Fri, 14 Aug 2020 10:34:41 -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. The timestamp format is chosen to look > > like the default Linux dmesg timestamp. > > > > Example: > > [ 0.000040] EAL: Probing VFIO support... > > > > Signed-off-by: Stephen Hemminger > > --- > > doc/guides/linux_gsg/linux_eal_parameters.rst | 5 +++ > > lib/librte_eal/common/eal_common_options.c | 5 +++ > > lib/librte_eal/common/eal_internal_cfg.h | 1 + > > lib/librte_eal/common/eal_options.h | 2 + > > lib/librte_eal/linux/eal_log.c | 41 +++++++++++++++++-- > > 5 files changed, 51 insertions(+), 3 deletions(-) > [snip] > > > @@ -1945,6 +1949,7 @@ eal_common_usage(void) > > " --"OPT_PROC_TYPE" Type of this process (primary|secondary|auto)\n" > > #ifndef RTE_EXEC_ENV_WINDOWS > > " --"OPT_SYSLOG" Set syslog facility\n" > > + " --"OPT_LOG_TIMESTAMP" Timestamp log output\n" > > #endif > > Seems like FreeBSD doesn't support this option as well. > > It is clear that iovec approach saves a syscall on each write, but is it worth > implementing log timestamps on each platform instead of prepending it in > common code (with a second fwrite call)? For fast event stream with precise > timestamps, there is tracing framework. FreeBsd doesn't go through the same log code. Iovec is to keep timestamp and message as an atomic message. There is no good way to use fwrite to get anything atomic. Fwrite is unnecessary here anyway saving a copy and avoid issues with library getting corrupted is good.