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 2548941DF7; Mon, 6 Mar 2023 23:03:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9CCE40EDB; Mon, 6 Mar 2023 23:03:28 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id DBA9640A8A for ; Mon, 6 Mar 2023 23:03:26 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id h8so12052723plf.10 for ; Mon, 06 Mar 2023 14:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678140206; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=/WOCi/R9wighkQgW72dJigohO9eEbJnVg2S3VB6++8E=; b=Uw8liBnaZr0E6NY6wNc/NxNhjjsB5eGGgJzddgtvzuUYs/bIIaYJsDGDU/irTR63AP qTe2M8u0m0lRn4YeDIlNt10lTU/czlWdyt9wRs35ibe/rMk7ie7kzsEchdXlEoZYmbLr FE23IN1Sg6DhkYInR1Kf/ZV+oQoyU7XkrrEgh7wUFaFZVJfPoo+VLp/EHpUanB+Z7gcv zACo/pSMNSjb1ksLiQxIJTdyIfBGNpbbARmZjK+gQ2iFuJojsfhf93D3BwhLPOnwV/an lMhgE18UaC8riR708A/uQOSFSw+QoWcasT4T61fq9nmoQKt3Dn64vE5SkOoCi45pYIDc FNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678140206; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/WOCi/R9wighkQgW72dJigohO9eEbJnVg2S3VB6++8E=; b=I6PdG2yMC8IFs2qNpPH1OWmAnCezpzPD0XlugQ2uT4L0OW9fO/6wF3v3CORKD1hkr0 SajeFCLo8teWi+iM7XZSzM3EH/GZZnFEn6FfdP2+WzKWehjPo0cxFFLhs1kO6Ygv2olX loX34glKeLqWKqk/dPJta0K5pqnlqrzvKpyergnCG7+NUGFjo6iDoIWiYQCzctI33qaA grmIlxWbf4W6EnUAKH7oi8QhE7j/k/mD0T12upLMr5FM1dAui3mikrYuqaWDlk1vov/v 54L093X8WJCbFogFwmBvQl5u/CVq2k3ql1SDwEt4iTWVO1pmuKyjiwQ/9Bshv1T/NL2K Lwlg== X-Gm-Message-State: AO0yUKV+f8KLp8jTkJ5ui8x/HfVEppB4UGEES+p7JPII/YNTjOzkfAZR smQE092diAypafKkn9nU8aNKJmjHZH6N6LCRXRhXPg== X-Google-Smtp-Source: AK7set+Mm0dbJR5Lqm2WLBrsJKeqj33crnKibnzqOxdNQdeX6XyVTtpP8Pajw2eHyI7TAXp3WqxARQ== X-Received: by 2002:a17:902:7e0c:b0:19e:2ea1:c0f5 with SMTP id b12-20020a1709027e0c00b0019e2ea1c0f5mr9574655plm.33.1678140206024; Mon, 06 Mar 2023 14:03:26 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id kb8-20020a170903338800b00194d14d8e54sm7197919plb.96.2023.03.06.14.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 14:03:25 -0800 (PST) Date: Mon, 6 Mar 2023 14:03:22 -0800 From: Stephen Hemminger To: Tyler Retzlaff Cc: luzhipeng , dev@dpdk.org, thomas@monjalon.net Subject: Re: [PATCH v3] log: add timestamp for log Message-ID: <20230306140322.702ea968@hermes.local> In-Reply-To: <20230306210017.GC5736@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230304081421.1352-1-luzhipeng@cestc.cn> <20230304080441.4f69905e@hermes.local> <20230306210017.GC5736@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 6 Mar 2023 13:00:17 -0800 Tyler Retzlaff wrote: > On Sat, Mar 04, 2023 at 08:04:41AM -0800, Stephen Hemminger wrote: > > On Sat, 4 Mar 2023 16:14:21 +0800 > > luzhipeng wrote: > > > > > From: Zhipeng Lu > > > > > > add timestamp for log > > > > > > Signed-off-by: Zhipeng Lu > > > > Good idea but: > > - it needs to be optional > > - timestamp only makes sense on the terminal (stdout) log stream > > syslog/journal already have timestamp > > +1 > > also, some people who may have written scripts to consume the log output > might get kind of irritated that you suddenly broke the format of the > output. while not strictly an "api" it's not super friendly to break it > unnecessarily. Two additional comments. - since stderr is unbuffered on most OS, the fprintf of the timestamp and then the message is not thread safe. Writes of one thread and another might intermix. Addressed that in my version by using writev - Putting full date is unnecessary overhead better to use seconds since startup (similar to kernel dmesg). Also simpler to calculate.