命令 ltrace 使您可以跟踪进程的库调用。此命令的使用方式与 strace 类似。参数 -c 输出所发生的库调用的次数和持续时间:
tester@linux:~> ltrace -c find ~ % time seconds usecs/call calls function ------ ----------- ----------- --------- -------------------- 34.37 6.758937 245 27554 __errno_location 33.53 6.593562 788 8358 __fprintf_chk 12.67 2.490392 144 17212 strlen 11.97 2.353302 239 9845 readdir64 2.37 0.466754 27 16716 __ctype_get_mb_cur_max 1.18 0.231189 27 8531 strcpy 1.17 0.230765 27 8358 memcpy [...] 0.00 0.000036 36 1 textdomain ------ ----------- ----------- --------- -------------------- 100.00 19.662715 105717 total