dappprof1m
Profile user and lib function usage. uses dtrace.
Usage
dappprof [-acehoTU]
[-u
lib]
{-p
PID | command}
Overview
dappprof prints details on user and library call times for processes as a summary style aggragation. By default the user fuctions are traced, options can be used to trace library activity. Output can include function counts, elapsed times and on cpu times.
The elapsed times are interesting, to help identify functions that take some time to complete (during which the process may have slept). CPU time helps us identify syscalls that are consuming CPU cycles to run.
Since this uses DTrace, only users with root privileges can run this command.
Options
-
-a -
print all data
-
-c -
print function counts
-
-e -
print elapsed times, ns
-
-o -
print CPU times, ns
-
-T -
print totals
-
-p PID -
examine this PID
-
-u lib -
trace this library instead
-
-U -
trace all library and user functions
Examples
run and examine the "df -h" command,
|
# |
|---|---|
print elapsed times, on-cpu times and counts for "df -h",
|
# |
print elapsed times for PID 1871,
|
# |
print all data for PID 1871,
|
# |
Fields
CALL
|
Function call name |
|---|---|
ELAPSED
|
Total elapsed time, nanoseconds |
CPU
|
Total on-cpu time, nanoseconds |
COUNT
|
Number of occurrences |
Documentation
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output.
Exit
dappprof will sample until Ctrl-C is hit.
Releases
115 releases since Mac OS X 10.5; the text changed 1 time.