All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 4/6] lib/igt_device_scan: Align microseconds to six leading zeros
Date: Tue, 12 Jul 2022 10:12:37 +0200	[thread overview]
Message-ID: <Ys0s9TKkvuzppri8@zkempczy-mobl2> (raw)
In-Reply-To: <YswKluUDYWhnj7rh@kamilkon-desk1>

On Mon, Jul 11, 2022 at 01:33:42PM +0200, Kamil Konieczny wrote:
> On 2022-07-07 at 08:59:37 +0200, Zbigniew Kempczyński wrote:
> > Previous format was not correct when DBG() was in use leading to
> > not properly aligned output.
> > 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > ---
> >  lib/igt_device_scan.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
> > index afb6f07e18..e41c9f8b64 100644
> > --- a/lib/igt_device_scan.c
> > +++ b/lib/igt_device_scan.c
> > @@ -34,6 +34,7 @@
> >  #include <libudev.h>
> >  #include <linux/limits.h>
> >  #include <sys/stat.h>
> > +#include <sys/time.h>
> >  #include <sys/types.h>
> >  
> >  /**
> > @@ -170,7 +171,7 @@
> >  { \
> >  	struct timeval tm; \
> >  	gettimeofday(&tm, NULL); \
> > -	printf("%10ld.%03ld: ", tm.tv_sec, tm.tv_usec); \
> > +	printf("%10ld.%06ld: ", tm.tv_sec, tm.tv_usec); \
> ---------------- ^
> I checked other debug prints and this is the only place which
> uses 10ld for seconds, in other places there is %ld, so maybe
> it is worth to change this ?

I've enforced alignment to 10 digit to be sure time it will be 
well formatted even if on test machine date would be 1970 (I got 
this in my mind from the past). We will switch to 11ld in 2286-11-20
so if nothing amazing will happen I likely won't see this jump
in the future.

If you want I will change this - this code is blocked anyway unless
you're playing with debug.

--
Zbigniew 

> 
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> 
> >  	printf(__VA_ARGS__); \
> >  }
> >  
> > -- 
> > 2.34.1
> > 

  reply	other threads:[~2022-07-12  8:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  6:59 [igt-dev] [PATCH i-g-t 0/6] Add codename in device selection Zbigniew Kempczyński
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 1/6] lib/igt_device_scan: Migrate pci assignment Zbigniew Kempczyński
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 2/6] lib/igt_device_scan: Introduce codename for platform selection Zbigniew Kempczyński
2022-07-11 14:26   ` Kamil Konieczny
2022-07-12  8:02     ` Zbigniew Kempczyński
2022-07-12  9:08     ` Zbigniew Kempczyński
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 3/6] tools/lsgpu: Add codename switch (-c) Zbigniew Kempczyński
2022-07-11  8:52   ` Kamil Konieczny
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 4/6] lib/igt_device_scan: Align microseconds to six leading zeros Zbigniew Kempczyński
2022-07-11 11:33   ` Kamil Konieczny
2022-07-12  8:12     ` Zbigniew Kempczyński [this message]
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 5/6] lib/igt_device_scan: Add discrete/integrated pseudo-codenames Zbigniew Kempczyński
2022-07-07  6:59 ` [igt-dev] [PATCH i-g-t 6/6] lib/igt_device_scan: Simulate udev drm and pci device events Zbigniew Kempczyński
2022-07-07  7:37 ` [igt-dev] ✓ Fi.CI.BAT: success for Add codename in device selection Patchwork
2022-07-07 15:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ys0s9TKkvuzppri8@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.