Improvements Implemented --always-show-pid option. The --user|-u option has learned to recognize numeric UID:GID pair, allowing e.g. statically-built strace to be used without invoking nss plugins. Implemented decoding of IORING_REGISTER_SYNC_CANCEL, IORING_REGISTER_FILE_ALLOC_RANGE, IORING_REGISTER_PBUF_STATUS, IORING_REGISTER_NAPI, and IORING_UNREGISTER_NAPI opcodes of io_uring_register syscall. Implemented decoding of BPF_TOKEN_CREATE bpf syscall command. Updated decoding of io_uring_register and pidfd_send_signal syscalls. Updated lists of BPF_*, CAN_*, IORING_*, KEY_*, LSM_*, MPOL_*, NT_*, RWF_*, PIDFD_*, PTP_*, TCP_*, and *_MAGIC constants. Updated lists of ioctl commands from Linux 6.9.
Implemented --always-show-pid option.
が地味に嬉しい。pidofとかしてstraceしているときにprocfsを見たい場合に毎回pidをpsなりで取ったりするので便利。
ビルドしてみる
$ wget https://github.com/strace/strace/releases/download/v6.9/strace-6.9.tar.xz $ tar -xvf strace-6.9.tar.xz $ cd strace-6.9 $ ./configure
するとconfigure: error: Cannot enable m32 personality support
というエラーが出る。32ビットバイナリの実行に必要なライブラリや設定が不足しているっぽい。configureヘルプすると無効化できそうなので無効化してconfigureをやる
$ ./configure --help --enable-mpers=yes|no|check|m32|mx32 whether to enable multiple personalities support required for proper decoding of structures used by tracees with personalities that differ from the personality of strace, default is yes.
あとはmakeすれば使える。便利。
$ ./src/strace --always-show-pid ls 187334 execve("/usr/bin/ls", ["ls"], 0x7ffc2a401f48 /* 26 vars */) = 0 187334 brk(NULL) = 0x5a6bde611000 187334 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7d57fdf1b000 187334 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 187334 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 187334 fstat(3, {st_mode=S_IFREG|0644, st_size=27803, ...}) = 0 187334 mmap(NULL, 27803, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7d57fdf14000 187334 close(3)