[igt-dev] [PATCH i-g-t 4/6] lib/igt_device_scan: Align microseconds to six leading zeros

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Jul 11 11:33:42 UTC 2022


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 at 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 ?

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

>  	printf(__VA_ARGS__); \
>  }
>  
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list