STRACE-LOG-MERGE(1)

๐Ÿ’– strace-log-merge(1) โ€” General Commands Manual ๐Ÿ’–

okay bestie, gather round, because this little tool is lowkey the group-chat moderator for your strace logs and it deserves main character energy. โœจ

๐ŸŒธ NAME ๐ŸŒธ

strace-log-merge โ€” merge strace -ff -tt output

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

strace-log-merge STRACE_LOG
strace-log-merge --help

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically strace-log-merge takes all the log files that a strace -ff -tt[t] command spat out and merges them into one glorious timeline. ๐Ÿ’…

It does two things, and honestly? iconic behaviour:

  • it prepends the Process ID (PID) to each line ๐Ÿ™ˆ
  • it sorts the combined output chronologically by timestamp โฐ

like, it's giving "I put your chaotic multi-process logs in a sensible order." periodt.

โœจ OPTIONS โœจ

  • --help โ€” shows you the program usage and then peaces out. simple. clean. we love.
  • STRACE_LOG โ€” this is the file name prefix for the log files that came out of a strace -ff -tt[t] command. the utility will read all files matching the STRACE_LOG.* pattern. yes, all of them. ๐Ÿซถ

๐Ÿ‘‘ EXIT STATUS ๐Ÿ‘‘

  • 0 โ€” success! slay. everything worked. ๐ŸŽ‰
  • Non-zero โ€” something went wrong ๐Ÿ˜ญ. this can happen because of a missing argument (in which case usage information gets printed) or because of a failure during the processing of the STRACE_LOG.* files.

๐Ÿ“ USAGE EXAMPLE ๐Ÿ“

$ strace -o sleepy -ff -tt -e trace=execve,nanosleep \
        sh -c 'sleep 0.1 & sleep 0.2 & sleep 0.3'
$ strace-log-merge sleepy | fold -w 72 -s
13475 21:13:52.040837 execve("/bin/sh", ["sh", "-c", "sleep 0.1 & sleep
0.2 & sleep 0."...], 0x7ffde54b2450 /* 33 vars */) = 0
13478 21:13:52.044050 execve("/bin/sleep", ["sleep", "0.3"],
0x5631be4f87a8 /* 33 vars */) = 0
13476 21:13:52.044269 execve("/bin/sleep", ["sleep", "0.1"],
0x5631be4f87a8 /* 33 vars */) = 0
13477 21:13:52.044389 execve("/bin/sleep", ["sleep", "0.2"],
0x5631be4f87a8 /* 33 vars */) = 0
13478 21:13:52.046207 nanosleep({tv_sec=0, tv_nsec=300000000}, NULL) = 0
13476 21:13:52.046303 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0
13477 21:13:52.046318 nanosleep({tv_sec=0, tv_nsec=200000000}, NULL) = 0
13476 21:13:52.146852 +++ exited with 0 +++
13475 21:13:52.146942 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13476, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13477 21:13:52.247782 +++ exited with 0 +++
13475 21:13:52.247885 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13477, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13478 21:13:52.347680 +++ exited with 0 +++
13475 21:13:52.347786 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13478, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13475 21:13:52.348069 +++ exited with 0 +++

like look at that. every line got its PID kiss ๐Ÿ’‹ and the whole thing is in timestamp order. chef's kiss.


๐ŸŒˆ NOTES ๐ŸŒˆ

heads up bestie, there's a little โœจsituationโœจ here.

strace-log-merge may fail to correctly sort logs that were generated with -tt and span across midnight. ๐Ÿ˜ญ why? because the standard -tt timestamp lacks date information, and that date info is required for proper sorting. it literally cannot tell which day it is.

the fix? use the -ttt option with strace โ€” that solves this problem, because its timestamp format includes the date. so if your run might cross midnight, -ttt is the move. no cap. ๐Ÿ•›

๐Ÿ’€ BUGS ๐Ÿ’€

strace-log-merge does not validate the format of the input files. ๐Ÿ™ˆ it just assumes that every file matching the STRACE_LOG.* glob pattern is a correctly formatted log file from a single strace session. so if you feed it chaos, it will simply trust you. and that's a choice.

๐Ÿงš HISTORY ๐Ÿงš

the initial version of strace-log-merge was written by Denys Vlasenko in 2012. an actual legend. ๐Ÿ‘‘

๐Ÿ™ˆ REPORTING BUGS ๐Ÿ™ˆ

problems with strace-log-merge should be reported to the strace mailing list at <strace-devel@lists.strace.io>.

๐ŸŒธ SEE ALSO ๐ŸŒธ

strace(1)


and that's the whole page, bestie. this one's from strace 7.3, dated 2025-07-02 โ€” so go forth, merge those logs, and remember: don't cross midnight with plain -tt or the vibes will be off. ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: strace 7.3-1 ยท LGPL-2.1-or-later
  • fedora 43: strace 7.3-1.fc43 ยท LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND (GPL-1.0-or-later WITH Linux-syscall-note) AND (GPL-2.0-or-later WITH Linux-syscall-note) AND (GPL-2.0-only WITH Linux-syscall-note) AND (LGPL-2.0-or-later WITH Linux-syscall-note) AND (LGPL-2.1-or-later WITH Linux-syscall-note) AND ((GPL-2.0-only WITH Linux-syscall-note) OR Linux-OpenIB) AND ((GPL-2.0-only WITH Linux-syscall-note) OR MIT) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR BSD-3-Clause) AND ISC AND X11 AND FSFAP AND FSFUL AND FSFULLR AND FSFULLRWD
  • fedora 44: strace 7.3-1.fc44 ยท LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND (GPL-1.0-or-later WITH Linux-syscall-note) AND (GPL-2.0-or-later WITH Linux-syscall-note) AND (GPL-2.0-only WITH Linux-syscall-note) AND (LGPL-2.0-or-later WITH Linux-syscall-note) AND (LGPL-2.1-or-later WITH Linux-syscall-note) AND ((GPL-2.0-only WITH Linux-syscall-note) OR Linux-OpenIB) AND ((GPL-2.0-only WITH Linux-syscall-note) OR MIT) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR BSD-3-Clause) AND ISC AND X11 AND FSFAP AND FSFUL AND FSFULLR AND FSFULLRWD
  • nixpkgs unstable: strace 7.3
  • ๐Ÿ“œ the page's license: LGPL-2.1-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms