iprofiler(1) BSD General Commands Manual iprofiler(1)NAMEiprofilerUSAGEiprofiler [-l] [-L] [-legacy] [-T duration] [-I interval] [-window
period] [-d path] [-o basename] [-activitymonitor] [-allocations] [-coun‐
ters] [-eventprofiler] [-leaks] [-systemtrace] [-timeprofiler] [-kernel‐
stacks | -userandkernelstacks] [-allthreadstates] [-pmc PMC_MNEMONIC]
[-pmi PMI_MNEMONIC] [-pmithreshold INTEGER] [-a process/pid | executable
[args...]]
DESCRIPTION
Measure an application's performance without launching Instruments.app
and then visualize the measurements at a later time in Instruments.app.
The performance data is saved in a .dtps bundle that can be opened in
Instruments.app via "Open existing file...". iprofiler supports these
instruments: Activity Monitor, Allocations, Counters, Event Profiler,
Leaks, System Trace, and Time Profiler. Any combination of these instru‐
ments can be run simultaneously. iprofiler supports attaching to a cur‐
rently-running process, launching a process that will only run during the
measurement, or profiling all currently-running processes (by not speci‐
fying process/pid or executable).
Options are :
-l Lists all supported instruments
-L Lists all supported instruments, with a description
-legacy Executes the legacy Instruments command-line interface. This is
a non-lightweight command-line interface that launches Instru‐
ments.app.
-T duration
Records for this duration of time (Defaults to 10 seconds).
Duration can be specified in seconds (e.g. 1s or 1), millisec‐
onds (1000m or 1000ms) or microseconds (1000000u or 1000000us).
-I interval
Measures performance once during each sampling interval. If
this is not specified, it uses Instruments.app's default sam‐
pling interval. Interval can be specified in microseconds (e.g.
1000u or 1000us or 1000), seconds (1s) or milliseconds (1000m or
1000ms)
-window period
Performance measurement is limited to the final period of the
iprofiler run. If this is not specified, performance is mea‐
sured during the complete duration. Window period can be speci‐
fied in seconds (e.g. 1s or 1), milliseconds (1000m or 1000ms)
or microseconds (1000000u or 1000000us). This option can only
be used with -timeprofiler and/or -systemtrace.
-d path -o basename
Specifies "path/basename.dtps" as the path where the performance
data is written. If path is not specified, then it gets written
to current working directory. If basename is not specified,
then the process name or process id is used as the basename.
-timestamp
When present, this argument will append a timestamp to the end
of the filename, i.e. "path/basename.<TIMESTAMP>.dtps"
-activitymonitor -allocations -counters -eventprofiler -leaks
-systemtrace -timeprofiler
Chooses which instruments to run. At least 1 instrument must be
specified.
-kernelstacks | -userandkernelstacks
Causes backtraces to include only kernel stacks, or both user
and kernel stacks. If neither is specified, backtraces include
only user stacks.
-pmc PMC_MNEMONIC
When using -counters, use this flag to specify the mnemonic of
the event to count. Separate multiple mnemonics by a ','.
-pmi PMI_MNEMONIC
When using -eventprofiler, use this flag to specify the mnemonic
of the event to use for sampling.
-pmithreshold INTEGER
When using -eventprofiler, use this flag to specify the number
of events that must occur before a sample is taken.
-allthreadstates
Causes timeprofiler to sample all thread states. If this is not
specified, timeprofiler will sample only running threads.
-a process/pid
Attaches to an already running process. If you specify a pid
number, it will attach to the process with that pid. If you
specify a process string, it will attach to the process whose
name starts with that string.
executable [args...]
Causes a target process to be launched for the duration of the
measurement. The executable and the arguments are listed as if
they were being invoked directly from the commandline.
SEE ALSO
Instruments.app is able to open the resulting .dtps bundles that contain
the performance data. It can also be used to perform trace executions in
a graphical environment.
EXAMPLESiprofiler-timeprofiler -activitymonitor
iprofiler-T 8s -d /tmp -o YourApp_perf -timeprofiler -a YourApp
iprofiler-T 2500ms -o YourApp_perf -leaks -activitymonitor -a 823
iprofiler-d /tmp -timeprofiler -allocations -a YourApp.app
iprofiler-T 15 -I 1000ms -window 2s -o YourApp_perf -timeprofiler
-systemtrace /path/to/YourApp.app arg1
Mac OS June 5, 2024 Mac OS