[PATCH v1 0/2] Introduce identifier to help match syscall suspend-resume pairs

Sahil Siddiq sahilcdq0 at gmail.com
Wed Dec 10 19:44:07 UTC 2025


This patch series is an attempt to make it easier to match lines marked as
"unfinished" and "resumed" in strace's logs. At the moment, it is a little
difficult to tell when a particular syscall is resumed especially when many
threads are being traced.

This issue was raised on GitHub (GH-152 [1]) and is based on a solution proposed
in the comments [2].

With this patch, output such as:

[pid 9501] futex(0x725a9abff990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 1939502, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 9503] rseq(0x725a9a3fe600, 0x20, 0, 0x53053053 <unfinished ...>
[pid 9501] <... futex resumed>)   = 0
[...]
[pid 9501] futex(0x725a9a3fe990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 1939503, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 9503] <... rseq resumed>)    = 0
[pid 9501] <... futex resumed>)   = 0

will look like:

[pid 9501] futex(0x725a9abff990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 1939502, NULL, FUTEX_BITSET_MATCH_ANY <unfinished #1 ...>
[pid 503] rseq(0x725a9a3fe600, 0x20, 0, 0x53053053 <unfinished #2 ...>
[pid 9501] <... futex resumed #1>)   = 0
[...]
[pid 9501] futex(0x725a9a3fe990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 1939503, NULL, FUTEX_BITSET_MATCH_ANY <unfinished #3 ...>
[pid 9503] <... rseq resumed #2>)    = 0
[pid 9501] <... futex resumed #3>)   = 0

[1] https://github.com/strace/strace/issues/152
[2] https://github.com/strace/strace/issues/152#issuecomment-688508294

Sahil Siddiq (2):
  Enhance output to match suspend-resume syscalls pairs
  tests/docs: Syscall suspension/resumption id

 doc/strace.1.in                  |  6 +++---
 src/defs.h                       |  3 +++
 src/strace.c                     | 22 +++++++++++++++++++---
 src/syscall.c                    |  4 +++-
 tests/kill_child.test            |  2 +-
 tests/maybe_switch_current_tcp.c |  4 ++--
 tests/status-detached-threads.c  |  2 +-
 tests/threads-execve.c           | 16 ++++++++--------
 8 files changed, 40 insertions(+), 19 deletions(-)

-- 
2.52.0



More information about the Strace-devel mailing list