sh_pidcolors.d 1m "$Date:: 2007-10-03 #$" "USER COMMANDS"
NAME
sh_pidcolors.d - Demonstration of deeper DTrace Bourne shell analysis.
SYNOPSIS
sh_pidcolors.d { -p PID | -c cmd }
DESCRIPTION
This extends sh_syscolors.d by including some "pid" provider tracing as a starting point for deeper analysis. Currently it adds the probes, pid$target:a.out:e*:entry, pid$target:a.out:e*:return which means, all functions from the /usr/bin/sh binary that begin with the letter "e". This adds about 34 probes. Customise it to whichever parts of /usr/bin/sh or the system libraries you are interested in. The filename for syscalls may be printed as the shell name, if the script was invoked using the form "shell filename" rather than running the script with an interpreter line.
OS
Any
STABILITY
Evolving - uses the DTrace Shell provider, which may change as additional features are introduced. Check Shell/Readme to see what version these scripts are based on.
EXAMPLES

Default output, # sh_pidcolors.d

FIELDS

C CPU-id

PID Process ID

DELTA(us) Elapsed time from previous line to this line

FILE Filename of the shell script

LINE Line number of filename

TYPE Type of call (func/builtin/cmd/line/shell)

NAME Shell function, builtin or command name

WARNING
Watch the first column carefully, it prints the CPU-id. If it changes, then it is very likely that the output has been shuffled.

DOCUMENTATION
See the DTraceToolkit for further documentation under the Examples, Notes and Docs directories. The example files may be especially useful as they aim to demonstrate how to interpret the output.
EXIT
sh_pidcolors.d will run until Ctrl-C is hit.
AUTHOR
Brendan Gregg [CA, USA]
SEE ALSO
dtrace(1M)