From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 469C4459CC;
	Wed, 18 Sep 2024 17:05:05 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 16210410E8;
	Wed, 18 Sep 2024 17:05:05 +0200 (CEST)
Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com
 [209.85.210.179])
 by mails.dpdk.org (Postfix) with ESMTP id A1AF14025E
 for <dev@dpdk.org>; Wed, 18 Sep 2024 17:05:03 +0200 (CEST)
Received: by mail-pf1-f179.google.com with SMTP id
 d2e1a72fcca58-7198cb6bb02so169324b3a.3
 for <dev@dpdk.org>; Wed, 18 Sep 2024 08:05:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726671903;
 x=1727276703; darn=dpdk.org; 
 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=axyvUE1o8/YDgOdJZ50IusG8Ntadi8zZghxgmek/n4M=;
 b=DoI1dMI8um0w9Bg2kPCqi29unrX0FPVY24bQhSj+kd0HaRhkpVvbiilK8SUpe9gZCN
 Ye5JxatbC2pu8D8+ZF7uHHqqt/gp4Z+WkTzi6IzHgvrKQRuhxo7Kj1/2utCjap2s6N4T
 2PtFhIgAr94ET2RQ8UPGhxsnM9JxZeqaWS2IFiSiwmh5hOKN+TqE9ilXuw4PAQujLKFk
 cg8n9uPo/D4GPLp5rihn62yxHnBEImYtPqhkt4KxLCeUDB9uqs6GESszYChm/fZZTnCy
 CoGcgmMcys156ZT7UiwmrUYTojrTNCIdsq/d2vlMbk/oeZfyL9YTBcRQPKSozsDS9ZyE
 E1HA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726671903; x=1727276703;
 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=axyvUE1o8/YDgOdJZ50IusG8Ntadi8zZghxgmek/n4M=;
 b=qfT/oxheqT+gMFyffBL/40/TOH3y0loGe5VXx7qtQ6knv1dxHEnjPnOlV5lI07Ha2d
 VhT7EBwR2yrxhXyxkoioRpJjLKNYnhMnba9lmM6PfUIuns2xI14D31jRvjyD/bMGKyYX
 uNhNQpEy84jxGRaM12fZSz7WIHECifccG4WkgcK/hweh5Ggs/hjCJXHEYtW3JNZWn9ha
 L0h/GcxrIkZ79li97JpZsdB2k5yHcFOX66sUgGpiUBKKFq4pf5BHiu5fOgE1ft3gqlUg
 BSGZsWEO0P12twWwki+yV+XFYfk2s4c7jQ7+yBVP3I71v69m7xYmqA5PL66RyNrhhVA4
 7nsw==
X-Gm-Message-State: AOJu0YzShdP9kOgePKEMjVDymuiKAs4SvnW3vXrLoQLmWiZc7L9bzZhx
 3nulMQtVsOAkpk772JR+Wp2zKQR5ba0gKrUFefYi3O0AiprTF21Lc+ZQVZdftzs=
X-Google-Smtp-Source: AGHT+IGhdyAd1e8fKX9prvFsSbMBcTJ4qam27EHVH0M2FNnfavOXVWpUNt0H6JXTAA7fOApCRrzOGw==
X-Received: by 2002:a05:6a00:4f90:b0:714:1849:2503 with SMTP id
 d2e1a72fcca58-71926055cfamr35259669b3a.6.1726671902644; 
 Wed, 18 Sep 2024 08:05:02 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-71944aba55fsm6847175b3a.80.2024.09.18.08.05.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 18 Sep 2024 08:05:02 -0700 (PDT)
Date: Wed, 18 Sep 2024 08:05:00 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: fengchengwen <fengchengwen@huawei.com>
Cc: <dev@dpdk.org>, Morten =?UTF-8?B?QnLDuHJ1cA==?= <mb@smartsharesystems.com>
Subject: Re: [PATCH v23 11/15] log: add timestamp option
Message-ID: <20240918080500.3739c0ab@hermes.local>
In-Reply-To: <9522e9c9-f696-48d0-a080-bf5e6c54f9e6@huawei.com>
References: <20200814173441.23086-1-stephen@networkplumber.org>
 <20240918045830.3798-1-stephen@networkplumber.org>
 <20240918045830.3798-12-stephen@networkplumber.org>
 <9522e9c9-f696-48d0-a080-bf5e6c54f9e6@huawei.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Wed, 18 Sep 2024 15:37:49 +0800
fengchengwen <fengchengwen@huawei.com> wrote:

> ...
> 
> > +
> > +static enum {
> > +	LOG_TIMESTAMP_NONE = 0,
> > +	LOG_TIMESTAMP_TIME,	/* time since start */
> > +	LOG_TIMESTAMP_DELTA,	/* time since last message */
> > +	LOG_TIMESTAMP_RELTIME,  /* relative time since last message */
> > +	LOG_TIMESTAMP_CTIME,	/* Unix standard time format */
> > +	LOG_TIMESTAMP_ISO,	/* ISO8601 time format */  
> 
> Some of the impl should consider multiple-thread safety.
> 
> And for multiple-process, how about the secondary-processes align the main-process.


As much as possible, they are thread safe, that is why locatime_r is used.
Of course if multiple threads are printing it is possible that time stamps
could be out of order.  I.e CPU A got timestamp and is formatting message,
and CPU B got timestamp is formatting message. The formatting might take longer for A.