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 8BCF443CFA; Wed, 20 Mar 2024 04:34:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CA2F40271; Wed, 20 Mar 2024 04:33:59 +0100 (CET) Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by mails.dpdk.org (Postfix) with ESMTP id 31D5540271 for ; Wed, 20 Mar 2024 04:33:56 +0100 (CET) Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-5a4716cfbbcso3352486eaf.2 for ; Tue, 19 Mar 2024 20:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1710905635; x=1711510435; 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=KCuNEly0uezMPFMdjrg8g3o4xA1pdYZi/CQEi4ToE58=; b=YT44VEyozedBRr1jhzv+B5IZMjIulmJjsEn+AiLVqZPBeHHrjoqzV18UU3mXQ+h8QL cIPo7jTxqGn9Kr+pC0id/hYNy6yU3oT9mZ/6XUfwjRw1yrMDWF4Bva4W0Rd39P+HhtKn Mr6MqCz7YwpNCh6+9OPUVkCJ4w1WeHyGe65wZUHBYG7YcBUBnC9ArnroN3U412EGBeQy QNxTsKYkF0PmYfZiIlV62SNd7fbdC0S9SqgTlCRa+RcI8xkuYtno50THg7u5/p2/4zrg sJieRGvCDd+IwZdbF3bdiw4ivXJZHgaeCFL0MRzRdFHDjGX6xZ9/aL3QQEx3m+lML2TW TqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710905635; x=1711510435; 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=KCuNEly0uezMPFMdjrg8g3o4xA1pdYZi/CQEi4ToE58=; b=vhxjRh4pEC74k+MH6C3ERNYeiQs2PoMPqQv0ATcNpZu73xYEOue/bdi11lCsjfLFzD 275o9CFGg18krEhZOzNBO++od/RTRNJR1yx/1UtbURQFneCC6XF6HfSwCNJ64G57KYRX IyFPr1uzqn6h1syoEJ6U5ckcn3tpUF1aAi8C4RgZYB8dn9QuH8B4LIgTARmES1yimsdY VSLZuNCJQDOyvUsCb5zxLgLEjrhYl4b95RjMyjLChcAnfg6eCSWQ/nBLujDX9Uvio7LU BLMWc8ud2E68IIiT+hKCgnJWqqXdaR1UoRL5bnXbqh7pL2T/ILmypSOD6eShe5j1YuOG l9Yw== X-Gm-Message-State: AOJu0YyBbpI1oH/9UOuqoUO1EZX/M4tcDhv9PXa4FvSfIJwD7I2kaqBl GiwOUG12l4Mr8GXjZcIKT1oOCOoGZu6VCTuE7CWLqmGJBdLa/qLqarueYdxLC017tcHJsw4MqPF 4 X-Google-Smtp-Source: AGHT+IGkfxhLjrLkQNXHNY2VxCdQqnWRf0WNuoaqUYrxFMqNdcWzUhmY+10rBwAwNNgT37Ixdg+EXA== X-Received: by 2002:a05:6358:7517:b0:17c:d10:722c with SMTP id k23-20020a056358751700b0017c0d10722cmr5134452rwg.1.1710905635209; Tue, 19 Mar 2024 20:33:55 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id q28-20020a63505c000000b005dc8702f0a9sm8887987pgl.1.2024.03.19.20.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 20:33:55 -0700 (PDT) Date: Tue, 19 Mar 2024 20:33:52 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: Subject: Re: [PATCH v9 5/5] eal: add option to put timestamp on console output Message-ID: <20240319203352.1d58cec5@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F30C@smartserver.smartshare.dk> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240318220432.7486-1-stephen@networkplumber.org> <20240318220432.7486-6-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F2FE@smartserver.smartshare.dk> <20240319085136.1d4e2897@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F30C@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Tue, 19 Mar 2024 17:13:35 +0100 Morten Br=C3=B8rup wrote: > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > Sent: Tuesday, 19 March 2024 16.52 > >=20 > > On Tue, 19 Mar 2024 08:37:30 +0100 > > Morten Br=C3=B8rup wrote: > > =20 > > > > static ssize_t > > > > console_log_write(__rte_unused void *c, const char *buf, size_t =20 > > size) =20 > > > > { > > > > + struct timespec ts; > > > > ssize_t ret; > > > > > > > > - /* write on stderr */ > > > > - ret =3D fwrite(buf, 1, size, stderr); > > > > + if (timestamp_enabled) { > > > > + clock_gettime(CLOCK_MONOTONIC, &ts); > > > > + ts.tv_sec -=3D log_started.tv_sec; > > > > + ts.tv_nsec -=3D log_started.tv_nsec; =20 > > > > > > Please log the absolute CLOCK_MONOTONIC instead of subtracting =20 > > log_started, so timestamps can be easily compared with timestamps from > > other processes. > >=20 > >=20 > > No, was trying to do what kernel dmesg does. =20 >=20 > What do you mean? Doesn't the kernel output CLOCK_MONOTONIC timestamps (w= ithout offset)? >=20 > And by "timestamps from other processes" I also mean timestamps in log me= ssages from the kernel itself. >=20 If you look at dmesg command that formats the messages, it has lots of time= stamp options. Next version will support more of these. --time-format format Print timestamps using the given format, which can be ctime, reltime, delta or iso. The first three formats are aliases of the time-format-specific options. The iso format is a dmesg implementation of the ISO-8601 timestamp format. The purpose of this format is to make the comparing of timestamps between two systems, and any other parsing, easy. The definition of the iso timestamp is: YYYY-MM-DDHH:MM:SS,=E2=86=90+>.