[PATCH v6 07/13] print_timespec: Print the kernel_old_timespec for timestamps

Dmitry V. Levin ldv at altlinux.org
Wed Apr 1 00:46:38 UTC 2020


On Fri, Mar 20, 2020 at 03:09:33PM -0700, Alistair Francis wrote:
> When printing
> print_struct_timespec_data_size/print_struct_timespec_array_data_size
> print the kernel_old_timespec_t type instead of the 32/64-bit specific
> versions.
> 
> Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
> ---
>  print_timespec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/print_timespec.c b/print_timespec.c
> index 4df2a4f4..259ae68b 100644
> --- a/print_timespec.c
> +++ b/print_timespec.c
> @@ -37,12 +37,12 @@ typedef kernel_timespec64_t timespec_t;
>  MPERS_PRINTER_DECL(bool, print_struct_timespec_data_size,
>  		   const void *arg, const size_t size)
>  {
> -	return PRINT_TIMESPEC_DATA_SIZE(arg, size);
> +	return print_old_timespec_data_size(arg, size);
>  }
>  
>  MPERS_PRINTER_DECL(bool, print_struct_timespec_array_data_size,
>  		   const void *arg, const unsigned int nmemb,
>  		   const size_t size)
>  {
> -	return PRINT_TIMESPEC_ARRAY_DATA_SIZE(arg, nmemb, size);
> +	return print_old_timespec_array_data_size(arg, nmemb, size);
>  }

Note that even if print_old_timespec_data_size and
print_old_timespec_array_data_size existed and did the right thing,
this change would leave unused macros PRINT_TIMESPEC_DATA_SIZE
and PRINT_TIMESPEC_ARRAY_DATA_SIZE.

I think we don't need
print_old_timespec_data_size/print_old_timespec_array_data_size
because we could use whatever we already have and define
PRINT_TIMESPEC_DATA_SIZE/PRINT_TIMESPEC_ARRAY_DATA_SIZE appropriately.


-- 
ldv


More information about the Strace-devel mailing list