How to make ltrace -S show all arguments of system calls?

1k Views Asked by At

I was using ltrace -S to see what system calls dlopen was making but then I noticed that SYS_mmap was limited to only 4 arguments:

SYS_mmap(0x7f1c325fe000, 8192, 3, 2066)

while it takes a total of 6 arguments. In particular, the file descriptor, which is the sixth argument is not shown, which is crucial for my analysis.

Is there a way to make ltrace show all my arguments?

Tested in ltrace 0.7.3, Ubuntu 16.04.

1

There are 1 best solutions below

0
On

As mentioned by Mark Plotnick:

sed 's/;addr SYS_mmap/addr SYS_mmap'/ /etc/ltrace.conf > ltrace.conf
ltrace -S -F ltrace.conf ./dlopen.out

and now the mmaps look just right:

SYS_mmap(0, 285983, 1, 2, 3, 0) = 0x7f7db3ea6000

Tested on Ubuntu 18.04, ltrace 0.7.3.