Hi,
Max Nikulin wrote:
> I had an idea to have a look into strace sources. First step was to locate
> its upstream repository, so "apt show strace". At
> <https://strace.io/> I have noticed
> > *Print paths and more info associated with file descriptors.*
But my wodim strace output is not showing the paths already before they
get associated with a file descriptor.
> > $ strace -yy cat /dev/null
> > ...
> > openat(AT_FDCWD, "/dev/null", O_RDONLY) = 3</dev/null<char 1:3>>
In this example i get the filenames even without -yy :
$ strace cat /dev/null
execve("/usr/bin/cat", ["cat", "/dev/null"], 0x7ffeb8cea468 /* 28 vars */) =
0 brk(NULL) = 0x557e7c68a000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7f0ce1482000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
...
openat(AT_FDCWD, "/dev/null", O_RDONLY) = 3
...
With the wodim run i don't get paths with access() or openat()
regardless whether -yy or not:
$ strace -yy wodim --devices
execve("/usr/bin/wodim", ["wodim", "--devices"], 0x7fffac230870 /* 28 vars
*/) = 0 brk(NULL) = 0x56481f066000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fa29cb3c000
access(0x7fa29cb72480, R_OK) = -1 ENOENT (No such file or
directory)
openat(AT_FDCWD, 0x7fa29cb7121c, O_RDONLY|O_CLOEXEC) = 3
...
openat(AT_FDCWD, 0x7ffc9b02dc20, O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No
such file or directory)
...
There is not much difference to see between output of strace with and
without -yy. The pointer values are not the same. So i have to
anonymize them before running diff:
$ sed -e 's/0x[0-9a-f]*/0xX/g' <wodim_devices.strace >wodim_devices.strace_0xX
$ sed -e 's/0x[0-9a-f]*/0xX/g' <wodim_devices.strace_yy
>wodim_devices.strace_yy_0xX
Then only a meager difference remains:
$ diff -puNd wodim_devices.strace_0xX wodim_devices.strace_yy_0xX
--- wodim_devices.strace_0xX 2025-11-18 08:44:09.392221474 +0100
+++ wodim_devices.strace_yy_0xX 2025-11-18 08:44:03.841434659 +0100
@@ -27,7 +27,7 @@ mmap(0xX, 52856, PROT_READ|PROT_WRITE, M
close(3) = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xX
arch_prctl(ARCH_SET_FS, 0xX) = 0
-set_tid_address(0xX) = 1593
+set_tid_address(0xX) = 1190
set_robust_list(0xX, 24) = 0
rseq(0xX, 0xX, 0, 0xX) = 0
mprotect(0xX, 16384, PROT_READ) = 0
$
According to man set_tid_address the differing numbers are thread ids.
Have a nice day :)
Thomas