Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-a, --all-cpus system-wide collection from all CPUs
-b, --branch-any sample any taken branches
-B, --no-buildid do not collect buildids in perf.data
-c, --count <n> event period to sample
-C, --cpu <cpu> list of cpus to monitor
-d, --data Record the sample addresses
-D, --delay <ms> ms to wait before starting measurement after program start (-1: start with events disabled), or ranges of time to enable events e.g. '-D 10-20,30-40'
-e, --event <event> event selector. use 'perf list' to list available events
-F, --freq <freq or 'max'>
profile at this frequency
-g enables call-graph recording
-G, --cgroup <name> monitor event in cgroup name only
-I, --intr-regs[=<any register>]
sample selected machine registers on interrupt, use '-I?' to list register names
-i, --no-inherit child tasks do not inherit counters
-j, --branch-filter <branch filter mask>
branch stack filter modes
-k, --clockid <clockid>
clockid to use for events, see clock_gettime()
-m, --mmap-pages <pages[,pages]>
number of mmap data pages and AUX area tracing mmap pages
-N, --no-buildid-cache
do not update the buildid cache
-n, --no-samples don't sample
-o, --output <file> output file name
-P, --period Record the sample period
-p, --pid <pid> record events on existing process id
-q, --quiet don't print any warnings or messages
-R, --raw-samples collect raw sample records from all opened counters
-r, --realtime <n> collect data with this RT SCHED_FIFO priority
-S, --snapshot[=<opts>]
AUX area tracing Snapshot Mode
-s, --stat per thread counts
-t, --tid <tid> record events on existing thread id
-T, --timestamp Record the sample timestamps
-u, --uid <user> user to profile
-v, --verbose be more verbose (show counter open errors, etc)
-W, --weight sample by weight (on special events only)
-z, --compression-level[=<n>]
Compress records using specified level (default: 1 - fastest compression, 22 - greatest compression)
--affinity <node|cpu>
Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer
--aio[=<n>] Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)
--all-cgroups Record cgroup events
--all-kernel Configure all used events to run in kernel space.
--all-user Configure all used events to run in user space.
--aux-sample[=<opts>]
sample AUX area
--buildid-all Record build-id of all DSOs regardless of hits
--buildid-mmap Record build-id in map events
--call-graph <record_mode[,record_size]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
Default: fp
--code-page-size Record the sampled code address (ip) page size
--control <fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]>
Listen on ctl-fd descriptor for command to control measurement ('enable': enable events, 'disable': disable events,
'snapshot': AUX area tracing snapshot).
Optionally send control command completion ('ack\n') to ack-fd descriptor.
Alternatively, ctl-fifo / ack-fifo will be opened and used as ctl-fd / ack-fd.
--data-page-size Record the sampled data address data page size
--debuginfod[=<debuginfod urls>]
Enable debuginfod data retrieval from DEBUGINFOD_URLS or specified urls
--dry-run Parse options then exit
--exclude-perf don't record events from perf itself
--filter <filter>
event filter
--kcore copy /proc/kcore
--kernel-callchains
collect kernel callchains
--max-size <size>
Limit the maximum size of the output file
--mmap-flush <number>
Minimal number of bytes that is extracted from mmap data pages (default: 1)
--namespaces Record namespaces events
--no-bpf-event do not record bpf events
--no-buffering collect data without buffering
--num-thread-synthesize <n>
number of threads to run for event synthesis
--off-cpu Enable off-cpu analysis
(not built-in because no BUILD_BPF_SKEL=1)
--overwrite use overwrite mode
--per-thread use per-thread mmaps
--phys-data Record the sample physical addresses
--proc-map-timeout <n>
per thread proc mmap processing timeout in ms
--running-time Record running/enabled time of read (:S) events
--sample-cpu Record the sample cpu
--sample-identifier
Record the sample identifier
--setup-filter <pin|unpin>
BPF filter action
--strict-freq Fail if the specified frequency can't be used
--switch-events Record context switch events
--switch-max-files <n>
Limit number of switch output generated files
--switch-output[=<signal or size[BKMG] or time[smhd]>]
Switch output when receiving SIGUSR2 (signal) or cross a size or time threshold
--switch-output-event <switch output event>
switch output event selector. use 'perf list' to list available events
--synth <no|all|task|mmap|cgroup>
Fine-tune event synthesis: default=all
--tail-synthesize
synthesize non-sample events at the end of output
--threads[=<spec>]
write collected trace data into several data files using parallel threads
--timestamp-boundary
Record timestamp boundary (time of first/last samples)
--timestamp-filename
append timestamp to output filename
--transaction sample transaction flags (special events only)
--user-callchains
collect user callchains
--user-regs[=<any register>]
sample selected machine registers in user space, use '--user-regs=?' to list register names
--vmlinux <file> vmlinux pathname
Options (74)
| Option | Description | Source |
|---|
-a, --all-cpus | system-wide collection from all CPUs | help |
-b, --branch-any | sample any taken branches | help |
-B, --no-buildid | do not collect buildids in perf.data | help |
-c, --count n | event period to sample | help |
-C, --cpu cpu | list of cpus to monitor | help |
-d, --data | Record the sample addresses | help |
-D, --delay ms | ms to wait before starting measurement after program start (-1: start with events disabled), or ranges of time to enable events e.g. '-D 10-20,30-40' | help |
-e, --event event | event selector. | help |
-g | enables call-graph recording | help |
-G, --cgroup name | monitor event in cgroup name only | help |
-I, --intr-regs any | sample selected machine registers on interrupt, use '-I?' to list register names | help |
-i, --no-inherit | child tasks do not inherit counters | help |
-k, --clockid clockid | clockid to use for events, see clock_gettime() | help |
-m, --mmap-pages pages | number of mmap data pages and AUX area tracing mmap pages | help |
-N, --no-buildid-cache | do not update the buildid cache | help |
-n, --no-samples | don't sample | help |
-o, --output file | output file name | help |
-P, --period | Record the sample period | help |
-p, --pid pid | record events on existing process id | help |
-q, --quiet | don't print any warnings or messages | help |
-R, --raw-samples | collect raw sample records from all opened counters | help |
-r, --realtime n | collect data with this RT SCHED_FIFO priority | help |
-S, --snapshot opts | AUX area tracing Snapshot Mode | help |
-s, --stat | per thread counts | help |
-t, --tid tid | record events on existing thread id | help |
-T, --timestamp | Record the sample timestamps | help |
-u, --uid user | user to profile | help |
-v, --verbose | be more verbose (show counter open errors, etc) | help |
-W, --weight | sample by weight (on special events only) | help |
-z, --compression-level n | Compress records using specified level (default: 1 - fastest compression, 22 - greatest compression) | help |
--affinity node|cpu | Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer | help |
--aio n | Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4) | help |
--all-cgroups | Record cgroup events | help |
--all-kernel | Configure all used events to run in kernel space. | help |
--all-user | Configure all used events to run in user space. | help |
--aux-sample opts | sample AUX area | help |
--buildid-all | Record build-id of all DSOs regardless of hits | help |
--buildid-mmap | Record build-id in map events | help |
--call-graph record_mode | setup and enables call-graph (stack chain/backtrace): | help |
--code-page-size | Record the sampled code address (ip) page size | help |
--data-page-size | Record the sampled data address data page size | help |
--debuginfod debuginfod | Enable debuginfod data retrieval from DEBUGINFOD_URLS or specified urls | help |
--dry-run | Parse options then exit | help |
--exclude-perf | don't record events from perf itself | help |
--filter filter | event filter | help |
--kcore | copy /proc/kcore | help |
--kernel-callchains | collect kernel callchains | help |
--max-size size | Limit the maximum size of the output file | help |
--mmap-flush number | Minimal number of bytes that is extracted from mmap data pages (default: 1) | help |
--namespaces | Record namespaces events | help |
--no-bpf-event | do not record bpf events | help |
--no-buffering | collect data without buffering | help |
--num-thread-synthesize n | number of threads to run for event synthesis | help |
--off-cpu | Enable off-cpu analysis (not built-in because no BUILD_BPF_SKEL=1) | help |
--overwrite | use overwrite mode | help |
--per-thread | use per-thread mmaps | help |
--phys-data | Record the sample physical addresses | help |
--proc-map-timeout n | per thread proc mmap processing timeout in ms | help |
--running-time | Record running/enabled time of read (:S) events | help |
--sample-cpu | Record the sample cpu | help |
--sample-identifier | Record the sample identifier | help |
--setup-filter pin|unpin | BPF filter action | help |
--strict-freq | Fail if the specified frequency can't be used | help |
--switch-events | Record context switch events | help |
--switch-max-files n | Limit number of switch output generated files | help |
--synth no|all|task|mmap|cgroup | Fine-tune event synthesis: default=all | help |
--tail-synthesize | synthesize non-sample events at the end of output | help |
--threads spec | write collected trace data into several data files using parallel threads | help |
--timestamp-boundary | Record timestamp boundary (time of first/last samples) | help |
--timestamp-filename | append timestamp to output filename | help |
--transaction | sample transaction flags (special events only) | help |
--user-callchains | collect user callchains | help |
--user-regs any | sample selected machine registers in user space, use '--user-regs=?' to list register names | help |
--vmlinux file | vmlinux pathname | help |
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.