]> granicus.if.org Git - strace/commit
Replace struct timeval with struct timespec in time measurements
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 16 Mar 2018 00:55:58 +0000 (00:55 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 20 Mar 2018 02:30:24 +0000 (02:30 +0000)
commit17935497e2f4e78b183026e1a49f4c279d0f276e
tree66de6bded848dd874567c306c21136e811829f88
parentdfccb60a75643a4db345f8bfa3ad6f9fbc5560e6
Replace struct timeval with struct timespec in time measurements

This is required to implement more precise time measurements.

* Makefile.am (strace_LDADD): Add $(clock_LIBS).
* defs.h (struct tcb): Change the type of stime, dtime, and etime fields
from struct timeval to struct timespec, all users updated.
(syscall_exiting_decode, syscall_exiting_trace, count_syscall): Change
the type of "struct timeval *" argument to "struct timespec *", all
users updated.
(tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): Rename to
ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.  Change
the type of all "struct timeval *" arguments to "struct timespec *",
all users updated.
* util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul):
Rename to ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.
Change the type of all "struct timeval *" arguments to "struct timespec *".
* count.c (struct call_counts): Change the type of "time" field
from struct timeval to struct timespec, all users updated.
(overhead): Change type from struct timeval to struct timespec, all
users updated.
(count_syscall): Change the type of "struct timeval *" argument to
"struct timespec *".
* strace.c (printleader): Change the type of struct timeval variables
to struct timespec, call clock_gettime instead of gettimeofday.
(next_event, trace_syscall): Change the type of struct timeval variables
to struct timespec.
* syscall.c (syscall_entering_finish, syscall_exiting_decode): Call
clock_gettime instead of gettimeofday.
Makefile.am
count.c
defs.h
strace.c
syscall.c
util.c