]> granicus.if.org Git - strace/commit
Implement -e status=set option
authorPaul Chaignon <paul.chaignon@gmail.com>
Sat, 15 Jun 2019 05:32:03 +0000 (07:32 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 10 Jul 2019 16:12:44 +0000 (16:12 +0000)
commite45a594cb08394c96f71105db9bacf08aa4c734d
tree12e3911bf1ebfa746629a8ef84e2b312b2d6ac0a
parent35dbe6803f35d47403b186d66db25c574b7637d7
Implement -e status=set option

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): New prototype.
* 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, warn on -zZ and -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@gmail.com>
NEWS
defs.h
filter_qualify.c
number_set.c
number_set.h
signal.c
strace.1.in
strace.c
syscall.c