I trust "truss " ,a command

this command usefull many ways,as debugging option when any bug found due to system/library calls (not user calls) and signals made/received by a new or existing process.
It sends the output to stderr.

the options
truss -a -e -f -rall -wall -p
truss -a -e -f -rall -wall -a

-a Displays the arguments to each exec() system call.
-c Displays a summary of all the system calls made by a process.
-e Displays the environment of a running process.
-f Follows all child processes created by the fork and vfork system calls.
-o Saves the output of the command to a specified file.
-p Attaches the truss command to a currently running process.

There r two ways to use truss
(1)truss –aef –p PID
where PID is the process ID of a currently running process.
(2)using truss with an executable command
truss –aef

By default, the truss utility dumps the output to the stderr file. You can save the output of the truss utility by using the –o option with the truss command. For example, to save the output of the truss command to the trussoutput.out file use the following command:
truss –aef –o /tmp/trussoutput.out –p PID

wat else.........

u can search this output file for any any popen or system call wise

$
trussoutput.out |grep "^system",so it will show all the info/lines which are started with system command.

No comments :

Post a Comment