[PATCH v3] Implemented -e trace=%clock option
Dmitry V. Levin
ldv at altlinux.org
Sat Mar 18 01:14:01 UTC 2017
On Thu, Mar 16, 2017 at 04:41:22PM +0530, Rishi Bhatt wrote:
[...]
> diff --git a/sysent.h b/sysent.h
> index f4eaa930..7e95ab3a 100644
> --- a/sysent.h
> +++ b/sysent.h
> @@ -22,5 +22,5 @@ typedef struct sysent {
> #define TRACE_INDIRECT_SUBCALL 02000 /* Syscall is an indirect socket/ipc subcall. */
> #define COMPAT_SYSCALL_TYPES 04000 /* A compat syscall that uses compat types. */
> #define TRACE_SCHED 010000 /* Trace scheduler-related syscalls. */
> -
> +#define TRACE_CLOCK 020000 /*Trace clock-related syscalls. */
> #endif /* !STRACE_SYSENT_H */
Please do not remove the empty line between #define's and #endif.
Please follow the style used in the file you are patching,
in particular, the style of comments.
> diff --git a/tests/clock.test b/tests/clock.test
> new file mode 100755
> index 00000000..8b2750c8
> --- /dev/null
> +++ b/tests/clock.test
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +# Check -e trace=%clock option.
> +
> +try_run_prog()
> +{
> + "$@" > /dev/null || {
> + rc=$?
> + if [ $rc -eq 77 ]; then
> + return 1
> + else
> + fail_ "$* failed with code $rc"
> + fi
> + }
> +}
> +
> +. "${srcdir=.}/init.sh"
Eugene has moved try_run_prog() from sched.test to init.sh,
please drop it from clock.test, too.
> +
> +#
> +# Tracing Clock_* related syscalls.
These are clock_* related syscalls, not Clock_*.
> +#
> +while read w i
> +do
> + try_run_prog ./$i > /dev/null
The idiom is
try_run_prog "./$i" || continue
> + run_strace -a$w -e trace=%clock ./$i > "$EXP"
> + match_diff "$LOG" "$EXP"
> +done << EOF
> +40 clock_nanosleep
> +37 clock_adjtime
> +36 clock_xettime
> +EOF
> +
> +echo '+++ exited with 0 +++' > "$EXP"
> +
> +#
> +# Tracing NON_CLOCK related syscalls
What is NON_CLOCK related?
I understood what you are trying to say here just because I knew in
advance.
[...]
> +done << EOF
> +11 fchdir
> +27 futex
> +10 fsync
> +EOF
Could you add a few more of these to the list, please?
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170318/49b15b5c/attachment.bin>
More information about the Strace-devel
mailing list