[PATCH v3 0/3] Stage output for -z and new -Z options

burkhard.kohl at intel.com burkhard.kohl at intel.com
Thu Apr 25 14:18:07 UTC 2019


From: Burkhard Kohl <burkhard.kohl at intel.com>

This patch set adds a new -Z option to print only failing syscalls and
fixes the current behavior of the -z option.  The output is staged, using
open_memstream, until the syscall is known to be successful or failing.
The first patch adds the -Z option, the second implements the output
staging, and the last adds two test cases.
Changelogs:
  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

Burkhard Kohl (3):
  Existing -z option prints only successful syscalls.  This patch adds a
    -Z option to print only failing syscalls.
  The -z and -Z options print only successful and failing syscalls
    respectively. However, failure of syscall is only known after
    syscall return.  Thus, we end up with something like this on, e.g.,
    ENOENT:
  This patch adds two test cases for the -z and -Z options.

 Makefile.am        |  1 +
 configure.ac       |  1 +
 defs.h             | 11 ++++++++
 stage_output.c     | 69 ++++++++++++++++++++++++++++++++++++++++++++++
 strace.1.in        |  7 +++++
 strace.c           | 19 +++++++++++--
 syscall.c          | 23 ++++++++++++++--
 tests/.gitignore   |  2 ++
 tests/Makefile.am  |  2 ++
 tests/gen_tests.in |  2 ++
 tests/strace-Z.c   | 40 +++++++++++++++++++++++++++
 tests/strace-z.c   | 40 +++++++++++++++++++++++++++
 12 files changed, 213 insertions(+), 4 deletions(-)
 create mode 100644 stage_output.c
 create mode 100644 tests/strace-Z.c
 create mode 100644 tests/strace-z.c

-- 
2.17.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the Strace-devel mailing list