The strace parameters are as follows:
-T Accurate output to seconds
-tt output accurate to subtle
-ttt precise to subtle, and time represented as UNIX timestamp
-T records the time spent on each system call and can see which system calls are long
- s 1024 shows the system call parameters, for the length of the string display, the default is 32, if the string parameter is very long, a lot of information can not be displayed
-o filename to output trace results to a file
-P PID can track a background process
-C counts the time, number of times, and number of errors that are performed by each system call.
-D Output strace debug information about standard errors.
-F tracks its child processes in addition to the current process
-FF If you provide-o filename, the trace results for all processes are output to the corresponding filename.pid, and the PID is the process number of each process.
-F attempts to trace vfork calls. At-F, vfork is not tracked.
-h outputs a brief help message.
The-I output system calls the entry pointer.
-Q suppresses the output of messages about secession.
-R prints out relative time about, every system call.
-V outputs all system calls. Some calls about environment variables, states, input and output calls due to frequent use, not output by default.
-V Output strace version information.
-X outputs non-standard strings in 16 binary form
-XX all strings are output in 16 binary form.
-e Trace=nanosleep records only related system call information.
-e trace=network only record system calls related to network API
-e Trace=file only record system calls involving file names
-e Trace=desc only records system calls involving file handles
-E Trace=set
-E Trace=all
-e strace=signal tracks all system calls related to system signals
-e TRACE=IPC tracks all system calls related to process communication
-e Abbrev=set Sets the result set of the system call of the strace output.-V et abbrev=none. The default is Abbrev=all.
-e Raw=set Displays the parameters of the specified system call in hexadecimal.
-e signal=set Specifies the system signal to be traced. All is the default. such as signal=! SIGIO (or Signal=!io), indicating that the SIGIO signal is not tracked.
- u username execute tracked commands with username UID and GID
Examples of Use:
Strace-t-tt-e trace=desc-s 1024-o out.txt-p pid
Strace-t-tt-e Trace=all-o output.txt-p pid
Strace-fo OUT.txt Sqlplus/as SYSDBA
---------------organized from the network
Examples of using strace under Linux