[PATCH v8 0/4] Stage output and filter on syscall return statuses
Paul Chaignon
paul.chaignon at gmail.com
Thu Jul 11 14:08:06 UTC 2019
The first patch adds the -Z option; the second implements the output
staging; the third introduces the -e status=set option, and the last adds
five new test cases.
In addition to the test cases in this patchset, I performed several manual
tests over the entire test suite. First, I set -e status to default to
the empty set (using 'none') and checked that none of the existing tests
were returning syscalls. Second, I set -e status to default to the
complete set (explicitly, not using 'all') and checked that all tests were
succeeding. Finally, I added a dummy entry to the status set, set -e
status to default to the complete set minus that entry, and checked all
tests were succeeding again. This last test differs from the previous
because the output is only staged when the -e status set in incomplete.
With this third check, the threads-execve test failed because the syscalls
were printed out in a different order (expected and mentioned in the man
page).
Changelogs:
Changes in v8:
- Avoid marking staged syscalls as unfinished/resumed.
- Skip kernels <3.1 for status=none and status=unfinished tests.
- Remove unnecessary sleeps in multithreaded tests.
- Fix racy status=detached test.
- Add single-thread status=unfinished and status=none tests. Renamed
multithreaded tests to status-unfinished-threads and
status-none-threads.
- Run multithreaded tests in a loop until they succeed.
- Minor fixes to man page and commit messages.
Changes in v7:
- Rebase on master.
Changes in v6:
- Improved man page wording.
- Use ARRAY_SIZE() in filter_qualify.c.
- Fix racy status-unfinished.c test.
- Remove restriction on traced syscalls for detached, unfinished, and
none tests.
- Minor fixes in tests.
- Add NEWS entries.
Changes in v5:
- Test case for status=detached.
- Print warning when both -Z and -z are used.
- Fix -z and -Z aliases to -estatus.
- Fix memory leak.
- Fix comment formatting, indentations, and list orderings.
- Refactor popcount functions.
- Rename __MAX_STATUS to NUMBER_OF_STATUSES.
- Fix man page formatting.
- Trace exit_group in multithreads test cases.
- Refactor test cases based on chdir(2).
Changes in v4:
- Title change from "Stage output for -z and new -Z options".
- Add -e status=set option.
- Fix for stage output under execve switch.
- Remove most HAVE_OPEN_MEMSTREAM guards.
- Fix for filtering in raw(tcp) case.
- Simplify test cases for failed and successful.
- Add test cases for all, none, and unfinished statuses.
Changes in v3:
- Refactor/rename functions in stage_output.c (use bool drop).
- Move staging start/end to func syscall_entering_trace/
syscall_exiting trace.
- Add -z/-Z option to strace man page (strace.1.in).
- Rename test binaries to strace-z/strace-Z.
- Swap _NR_open to _NR_chdir for test cases.
Changes in v2:
- Fix stage_output.c added to wrong patch.
Paul Chaignon (4):
Add -Z option to print only failing syscalls
Stage output for -z and -Z options
Implement -e status=set option
tests: check status qualifier
Makefile.am | 1 +
NEWS | 3 ++
configure.ac | 1 +
defs.h | 33 ++++++++++++-
filter_qualify.c | 33 +++++++++++++
number_set.c | 17 +++++++
number_set.h | 13 +++++
signal.c | 19 --------
stage_output.c | 64 ++++++++++++++++++++++++
strace.1.in | 54 ++++++++++++++++++++
strace.c | 73 ++++++++++++++++++++++------
syscall.c | 32 +++++++-----
tests/.gitignore | 7 +++
tests/Makefile.am | 9 ++++
tests/gen_tests.in | 5 ++
tests/pure_executables.list | 5 ++
tests/status-all.c | 24 +++++++++
tests/status-detached.expected | 1 +
tests/status-detached.test | 18 +++++++
tests/status-failed.c | 24 +++++++++
tests/status-none-threads.c | 53 ++++++++++++++++++++
tests/status-none-threads.test | 44 +++++++++++++++++
tests/status-none.c | 18 +++++++
tests/status-successful.c | 24 +++++++++
tests/status-unfinished-threads.c | 55 +++++++++++++++++++++
tests/status-unfinished-threads.test | 12 +++++
tests/status-unfinished.c | 19 ++++++++
tests/status.c | 21 ++++++++
tests/tests.h | 3 ++
29 files changed, 640 insertions(+), 45 deletions(-)
create mode 100644 stage_output.c
create mode 100644 tests/status-all.c
create mode 100644 tests/status-detached.expected
create mode 100755 tests/status-detached.test
create mode 100644 tests/status-failed.c
create mode 100644 tests/status-none-threads.c
create mode 100755 tests/status-none-threads.test
create mode 100644 tests/status-none.c
create mode 100644 tests/status-successful.c
create mode 100644 tests/status-unfinished-threads.c
create mode 100755 tests/status-unfinished-threads.test
create mode 100644 tests/status-unfinished.c
create mode 100644 tests/status.c
--
2.17.1
More information about the Strace-devel
mailing list