[PATCH v4 0/3] [GSoC] Stop condition based on number of syscalls

Sahil Siddiq icegambit91 at gmail.com
Sat Mar 4 13:32:14 UTC 2023


Hi,

This patch adds the feature to detach strace after capturing a specified
number of syscalls. I have added the three tests as well in this series
of patches.

I also decided to write my own bash script to test strace--syscall-limit.
The tests for strace--syscall-limit-path and strace--syscall-limit-status
are generated on running "configure".

Regards,
Sahil

Changes v3 -> v4:
 - Declare "syscall_limit" as unsigned long long
 - Remove "syscall_limit == 0" check in function droptcb()
 - src/syscall.c: Compare with -1ULL instead of -1
 - m4/st_warn_cflags.m4: Remove Wno-error=old-style-definition
 - tests/Makefile.am: Add strace--syscall-limit.test in MISC_TESTS
 - tests/gen_tests.in: Change rules for generating strace--syscall-limit
   tests
 - tests/strace--syscall-limit.test: New file
 - tests/strace--syscall-limit*.c: Improvements and code reorganization

Sahil Siddiq (3):
  Stop condition based on number of syscalls
  Make relevant changes in NEWS and man page
  Add tests for the -l/--syscall-limit option

 NEWS                                 |  2 +
 doc/strace.1.in                      |  8 +++
 src/defs.h                           |  1 +
 src/strace.c                         | 19 +++++++-
 src/syscall.c                        |  3 ++
 tests/.gitignore                     |  3 ++
 tests/Makefile.am                    |  4 ++
 tests/gen_tests.in                   |  2 +
 tests/strace--syscall-limit-path.c   | 69 ++++++++++++++++++++++++++
 tests/strace--syscall-limit-status.c | 73 ++++++++++++++++++++++++++++
 tests/strace--syscall-limit.c        | 60 +++++++++++++++++++++++
 tests/strace--syscall-limit.test     | 34 +++++++++++++
 12 files changed, 276 insertions(+), 2 deletions(-)
 create mode 100644 tests/strace--syscall-limit-path.c
 create mode 100644 tests/strace--syscall-limit-status.c
 create mode 100644 tests/strace--syscall-limit.c
 create mode 100755 tests/strace--syscall-limit.test

-- 
2.39.2



More information about the Strace-devel mailing list