[PATCH v6 3/4] Implement -e status=set option

Paul Chaignon paul.chaignon at gmail.com
Sat Jul 6 07:25:16 UTC 2019


On Sat, Jul 06, 2019 at 02:20:08AM +0300, Dmitry V. Levin wrote:
> On Fri, Jul 05, 2019 at 07:05:24PM +0200, Paul Chaignon wrote:
> > The status qualifier enables filtering based on the return status of
> > syscalls.  -z and -Z become aliases for -e status=successful and -e
> > status=failed.  Staged output is only enabled when at least one status is
> > filtered, that is, when the set is incomplete.
> > 
> > * signal.c (popcount32): Move ...
> > * defs.h (popcount32): ... here.
> > (not_failing_only, failing_only): Remove.
> > * filter_qualify.c (status_set): New number_set variable.
> > (statuses): New variable for names of statuses.
> > (statusstr_to_uint, qualify_status): New functions.
> > (qual_options): Handle status qualifier.
> > * number_set.c (get_number_setbit, is_complete_set): New functions.
> > * number_set.h (is_complete_set): New prototype.
> > (status_t): New enumeration for statuses.
> > (status_set): Expose status_set variable.
> > * strace.1.in: Document new status qualifier.
> > * strace.c (not_failing_only, failing_only): Remove.
> > (droptcb): Handle status=detached option.
> > (init): Handle new status qualifier, set status_set variable on -z and -Z
> > options, warning on -zZ, use is_complete_set.
> > (maybe_switch_tcbs): Reopen memstream after tcb switch.
> > (print_event_exit): Handle status=unfinished option.
> > * syscall.c (syscall_entering_trace): Use is_complete_set.
> > (syscall_exiting_trace): Use is_complete_set, handle status=unavailable
> > option.
> > * NEWS: Mention this change.
> > 
> > Signed-off-by: Paul Chaignon <paul.chaignon at gmail.com>
> > ---
> >  NEWS             |  2 ++
> >  defs.h           | 24 ++++++++++++++++++++++--
> >  filter_qualify.c | 33 ++++++++++++++++++++++++++++++++
> >  number_set.c     | 17 +++++++++++++++++
> >  number_set.h     | 13 +++++++++++++
> >  signal.c         | 19 -------------------
> >  strace.1.in      | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
> >  strace.c         | 45 ++++++++++++++++++++++++++++++++------------
> >  syscall.c        | 25 +++++++++++++++---------
> >  9 files changed, 185 insertions(+), 42 deletions(-)
> 
> Something is odd with this patch, it doesn't apply with the following diagnostics:
> 
> error: patch failed: defs.h:1451
> error: defs.h: patch does not apply
> error: patch failed: filter_qualify.c:57
> error: filter_qualify.c: patch does not apply
> error: patch failed: number_set.c:47
> error: number_set.c: patch does not apply
> error: patch failed: signal.c:138
> error: signal.c: patch does not apply
> error: patch failed: strace.c:812
> error: strace.c: patch does not apply
> error: patch failed: syscall.c:656
> error: syscall.c: patch does not apply
> Patch failed at 0003 Implement -e status=set option

I'm not quite sure what happened.  I rebased and sent a v7.  This time I
checked that the patches apply successfully, on 442af67 ("tests: check
decoding of mode argument of mbind and set_mempolicy syscalls").

Paul


More information about the Strace-devel mailing list