Difference between revisions of "Truss"

From pressy's brainbackup
Jump to: navigation, search
(Created page with "=== Never forget the mega truss command === Sometimes a very useful output if you really want to see everything: <pre> # truss -elfda -rall -wall -vall -xall [-o output.txt ] -...")
 
Line 5: Line 5:
 
<pre>
 
<pre>
 
# truss -elfda -rall -wall -vall -xall [-o output.txt ] -p <pid>
 
# truss -elfda -rall -wall -vall -xall [-o output.txt ] -p <pid>
 +
</pre>
 +
 +
But; did you know that debug tool set:
 +
 +
<pre>
 +
root@solaris~# LD_DEBUG=help /usr/bin/true
 +
debug:
 +
debug: Solaris ELF Utilities: 11.4-1.3170
 +
debug:
 +
debug: The runtime linker and link-editor support a shared debugging
 +
debug: facility. Options are selected via a comma separated list of tokens,
 +
debug: each of which specifies a display option or a category for which
 +
debug: information is desired. Many tokens apply to both linker components,
 +
debug: while some are specific to one or the other. Diagnostics are printed,
 +
debug: one per line, with a standard prefix prepended to each one. Output
 +
debug: for the help token, used by itself, is sent to stdout. Use of
 +
debug: any other tokens causes diagnostic output to be sent to stderr
 +
debug: unless otherwise redirected.
 +
debug:
 +
[...] ~snip
 +
</pre>
 +
Example, prepend time stamps entering ld or ld.so.1 and elapsed time:
 +
<pre>
 +
root@solaris~# LD_DEBUG=dtime,ttime,all <cmd>
 
</pre>
 
</pre>

Revision as of 13:14, 13 July 2020

Never forget the mega truss command

Sometimes a very useful output if you really want to see everything:

# truss -elfda -rall -wall -vall -xall [-o output.txt ] -p <pid>

But; did you know that debug tool set:

root@solaris~# LD_DEBUG=help /usr/bin/true
debug:
debug: Solaris ELF Utilities: 11.4-1.3170
debug:
debug: The runtime linker and link-editor support a shared debugging
debug: facility. Options are selected via a comma separated list of tokens,
debug: each of which specifies a display option or a category for which
debug: information is desired. Many tokens apply to both linker components,
debug: while some are specific to one or the other. Diagnostics are printed,
debug: one per line, with a standard prefix prepended to each one. Output
debug: for the help token, used by itself, is sent to stdout. Use of
debug: any other tokens causes diagnostic output to be sent to stderr
debug: unless otherwise redirected.
debug:
[...] ~snip

Example, prepend time stamps entering ld or ld.so.1 and elapsed time:

root@solaris~# LD_DEBUG=dtime,ttime,all <cmd>