Thursday, November 27, 2008

Strace - powerful troubleshooting tool

Strace is a tool in linux used for tracing system call and signals. This is very useful for tracking the error occurred when a program is run and we do not have any clue where to start troubleshooting. The usage of strace is very simple. It will record the system calls that happen during the execution of a particular program.

To use strace (below is an example if you want to trace the system call when you run ls):
# strace ls

To use strace and print the output to file
# strace -o outputfile ls

After that, you can analyze the outputfile, to see where is the error that fails the program

No comments: