7.6. Using ltrace and strace Utilities

The ltrace program is a tracing utility for library function calls. It runs a program and logs all library function calls by that program. You can also use this utility to log system calls made by a program. The utility can also monitor child processes created by fork() or clone() system calls. This utility is very useful to quickly trace the failure point of an executable program. The utility may also print the time at which a particular function call or system call is executed with a resolution of microseconds.

Consider the simple single-line program that prints the string “Hello world” and then exits. Using ltrace with the executable of this program produces the following result.

 [root@boota ltrace]# ...

Get Linux Development Platform: Configuring, Using, and Maintaining a Complete Programming Environment, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.