6 perf-record - Run a command and record its profile into perf.data
11 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
12 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>]
16 This command runs a command and gathers a performance counter profile
17 from it, into perf.data - without displaying anything.
19 This file can then be inspected later on, using 'perf report'.
25 Any command you can specify in a shell.
29 Select the PMU event. Selection can be:
31 - a symbolic event name (use 'perf list' to list all events)
33 - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
34 hexadecimal event descriptor.
36 - a hardware breakpoint event in the form of '\mem:addr[:access]'
37 where addr is the address in memory you want to break in.
38 Access is the memory access type (read, write, execute) it can
39 be passed as follows: '\mem:addr[:[r][w][x]]'.
40 If you want to profile read-write accesses in 0x1000, just set
48 System-wide collection from all CPUs.
55 Record events on existing process ID.
59 Record events on existing thread ID.
63 Collect data with this RT SCHED_FIFO priority.
66 Collect data without buffering.
69 Append to the output file to do incremental profiling.
73 Overwrite existing data file. (deprecated)
77 Event period to sample.
85 Child tasks do not inherit counters.
88 Profile at this frequency.
92 Number of mmap data pages.
96 Do call-graph (stack chain/backtrace) recording.
100 Don't print any message, useful for scripting.
104 Be more verbose (show counter open errors, etc).
116 Sample timestamps. Use it with 'perf report -D' to see the timestamps,
125 Collect raw sample records from all opened counters (default for tracepoint counters).
129 Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a
130 comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
131 In per-thread mode with inheritance mode on (default), samples are captured only when
132 the thread executes on the designated CPUs. Default is to monitor all CPUs.
136 Do not update the builid cache. This saves some overhead in situations
137 where the information in the perf.data file (which includes buildids)
142 monitor only in the container (cgroup) called "name". This option is available only
143 in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to
144 container "name" are monitored when they run on the monitored CPUs. Multiple cgroups
145 can be provided. Each cgroup is applied to the corresponding event, i.e., first cgroup
146 to first event, second cgroup to second event and so on. It is possible to provide
147 an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have
148 corresponding events, i.e., they always refer to events defined earlier on the command
153 linkperf:perf-stat[1], linkperf:perf-list[1]