ltrace – narzędzie analizy kodu badające interakcję programu z używanymi przez niego bibliotekami dzielonymi (shared libraries).
Przykład wykonania dla trywialnego programu /bin/true
:
$ ltrace /bin/true __libc_start_main(0x8048a50, 1, 0xbffff434, 0x80499f0, 0x8049a50 <unfinished ...> setlocale(6, "") = "en_US.UTF-8" bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale" textdomain("coreutils") = "coreutils" __cxa_atexit(0x8048b60, 0, 0, 0xbffff434, 0x41152190) = 0 exit(0 <unfinished ...> __fpending(0x41149d20, 0x804b254, 0x41152190, 0xbffff3c0, 0xbffff378) = 0 +++ exited (status 0) +++
$ ltrace /bin/chmod 0777 xxx __libc_start_main(0x80492f0, 3, 0xbffff424, 0x804b120, 0x804b180 <unfinished ...> setlocale(6, "") = "en_US.UTF-8" bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale" textdomain("coreutils") = "coreutils" __cxa_atexit(0x8049720, 0, 0, 0, 0x41152190) = 0 getopt_long(3, 0xbffff424, "RcfvrwxXstugoa,+-=", 0x804b3c0, NULL) = -1 __ctype_b_loc(0x4000019c, 0x40000e90, 1, 0x41016c40, 35) = 0x40011444 __errno_location() = 0x40011440 __strtoul_internal("0777", 0xbffff308, 8) = 511 malloc(16) = 0x804d858 __xstat64(3, "xxx", 0xbffff2f0) = 0 chmod("xxx", 0777) = 0 __errno_location() = 0x40011440 exit(0 <unfinished ...> __fpending(0x41149d20, 131072, 0, 0, 0x40f33423) = 0 +++ exited (status 0) +++