[PATCH v4] Implemented -e trace=%clock option

Rishi Bhatt bhatt.rishi062 at gmail.com
Sat Mar 18 14:05:49 UTC 2017


Hey if i am taking rt_sigretrun,nanosleep as negative testcases i am
getting sigusr and sigalarm respectively, i should not get them right?
Also sched.test is also failing for them. Well i have included fstat and
open as negatives.

The way these test is made which expect the last output to be
'+++ exited with 0 +++'  -> this is causing the test failure for some tests
from the suite.Well should i work to make this test better or there is
something else which i am not taking into consideration?

Also if i am thinking of making this test better by not depending on the
making a manual ending like:
echo '+++ exited with 0 +++' > "$EXP"

And the patch is attached.

On Sat, Mar 18, 2017 at 6:44 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:

> 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
>
> ------------------------------------------------------------
> ------------------
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170318/7bb08fbb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4-0001-Implemented-e-trace-clock-option.patch
Type: text/x-patch
Size: 45117 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170318/7bb08fbb/attachment.bin>


More information about the Strace-devel mailing list