On Wed, Jun 14, 2017 at 04:23:31PM +0200, Miroslav Lichvar wrote:
> Add support for printing control messages containing software or
> hardware timestamps, which are typically enabled by NTP and PTP
> implementations.
> 
> * print_timespec.c (print_struct_timespec): New function.
> * xlat/scmvals.in: Add SCM_TIMESTAMP* values.
> * msghdr.c (print_scm_timestamp, print_scm_timestampns,
>   print_scm_timestamping): New functions.
>   (cmsg_socket_printers): Add them.
> * tests/msg_control.c (test_scm_timestamp, test_scm_timestampns,
>   test_scm_timestamping): New functions.
>   (test_sol_socket): Use them.
> 
> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
> ---
>  msghdr.c            |  38 +++++++++++++++++++-
>  print_timespec.c    |   5 +++
>  tests/msg_control.c | 100 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  xlat/scmvals.in     |   4 +++
>  4 files changed, 146 insertions(+), 1 deletion(-)
[...]
> @@ -191,7 +224,10 @@ static const struct {
>  } cmsg_socket_printers[] = {
>       [SCM_RIGHTS] = { print_scm_rights, sizeof(int) },
>       [SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) },
> -     [SCM_SECURITY] = { print_scm_security, 1 }
> +     [SCM_SECURITY] = { print_scm_security, 1 },
> +     [SCM_TIMESTAMP] = { print_scm_timestamp, sizeof(struct timeval) },
> +     [SCM_TIMESTAMPNS] = { print_scm_timestampns, sizeof(struct timespec) },
> +     [SCM_TIMESTAMPING] = { print_scm_timestamping, 3 * sizeof(struct 
> timespec) }

As these sizes vary between personalities, I'm afraid this is not correct.
In fact, your own test fails for x86 personality on x86_64, you can see
this if you build strace in a system with -m32 runtime support (configure
output should contain "checking for -m32 runtime support... yes").


-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to