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 9B48943CEE; Tue, 19 Mar 2024 16:51:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82BF440ED9; Tue, 19 Mar 2024 16:51:42 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 5BC5B40ECF for ; Tue, 19 Mar 2024 16:51:41 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1dee5ef2a7bso39139685ad.1 for ; Tue, 19 Mar 2024 08:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1710863500; x=1711468300; 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=ucs4b6Fw2TJq97XfU+ezq/zpXNlYu09JDgfZZo8M+ZM=; b=jzn1Zs/CuwCAsoMcxgqZVm72E+RsrG4aTP09rbjxpCOfELnn7YmRL3CzUxHoX0IgiU 9Je6dPtvPSOlUwmr6KzWhaV3cXZ3fr9/z/vlOPMWxRPkDI6vgbbrDHmF3Mx32lT14Mpt y9NPVglnunK688X1GWZfx6AmbC/u6n0O98IIMOqgZJfnLsobVtMV/7KC61l8UIKLFOOZ D3LZixStJiGJW9TebRUIXbJh1S2KcdsJdwgc41c1Zz11YGhu5Eg72rkzsJ8Vd37/gJFK 23DVnffetbVonlAY+T1u13KsVBsZIis3vCfnfpsQ0rlA/fOsKpnCx83w86q+BZV6r016 L1KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863500; x=1711468300; 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=ucs4b6Fw2TJq97XfU+ezq/zpXNlYu09JDgfZZo8M+ZM=; b=qjfuUlRYp+wLJ3C4pLRiIcHqRPOGiCjWER/FicVn1Afs1Gex8tlTuNYVXSc8EavFsl IwC5qAg8q9xnhBxjM/tr4Rta2ajlobXfwotx7h06Qy0rMKkhsQU7K1M7CZ1FzUurlQEd /g86ZBgF3GsIBh7AmyY6T/uIOYs7de3nYS+D6U7N+8uTGmN/sQrwST+QdVAOWO0MqTce fifTzw5kgoN65E3tbyhFEL656/Ua2QYupdHwcMKkp1MWscEopnjUntHqSr3S04BfYgEd P+TwPLfvsVh7Bko44OrAgxNsb9Uyg4KYOETjdsO60PIYfkVqysLWcWGbM65AoxEox32g zM5w== X-Gm-Message-State: AOJu0YzUSSj7FCsUwkixEGgDtp7xFYoNt9+9SI2tSJYraplry+y70fvL ege3Yy3rqa3UCwzhMrV6r6mV5QkB8tymUgd63IPQjobzUoZhK+xv5ej1WKsQX+x5KK+1fR5raz7 l X-Google-Smtp-Source: AGHT+IGdyb5AHFMIMMvn5+xbDF746XJmOBvrdhFAnvM1IE30hOJURhT+1GhnVrwYvAnljKi5OPEC9A== X-Received: by 2002:a17:902:c951:b0:1e0:1d62:4543 with SMTP id i17-20020a170902c95100b001e01d624543mr9035138pla.14.1710863500478; Tue, 19 Mar 2024 08:51:40 -0700 (PDT) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f7-20020a17090274c700b001dd6da21e30sm11474029plt.231.2024.03.19.08.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 08:51:40 -0700 (PDT) Date: Tue, 19 Mar 2024 08:51:36 -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: <20240319085136.1d4e2897@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F2FE@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> 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 08:37:30 +0100 Morten Br=C3=B8rup wrote: > > static ssize_t > > console_log_write(__rte_unused void *c, const char *buf, size_t size) > > { > > + struct timespec ts; > > ssize_t ret; > >=20 > > - /* 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 >=20 > Please log the absolute CLOCK_MONOTONIC instead of subtracting log_starte= d, so timestamps can be easily compared with timestamps from other processe= s. No, was trying to do what kernel dmesg does.