Lines Matching +full:default +full:- +full:sample +full:- +full:phase
1 perf-record(1)
5 ----
6 perf-record - Run a command and record its profile into perf.data
9 --------
11 'perf record' [-e <EVENT> | --event=EVENT] [-a] <command>
12 'perf record' [-e <EVENT> | --event=EVENT] [-a] -- <command> [<options>]
15 -----------
17 from it, into perf.data - without displaying anything.
23 -------
27 -e::
28 --event=::
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
36 - a symbolic or raw PMU event followed by an optional colon
37 and a list of event modifiers, e.g., cpu-cycles:p. See the
38 linkperf:perf-list[1] man page for details on event modifiers.
40 - a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where
44 - a symbolically formed event like 'pmu/config=M,config1=N,config3=K/'
53 These params can be used to overload default config values per event.
55 - 'period': Set event sampling period
56 - 'freq': Set event sampling frequency
57 - 'time': Disable/enable time stamping. Acceptable values are 1 for
59 The default is 1.
60 - 'call-graph': Disable/enable callgraph. Acceptable str are "fp" for
63 - 'stack-size': user stack size for dwarf mode
64 - 'name' : User defined event name. Single quotes (') may be used to
67 - 'aux-output': Generate AUX records instead of events. This requires
69 - 'aux-sample-size': Set sample size for AUX area sampling. If the
70 '--aux-sample' option has been used, set aux-sample-size=0 to disable
73 See the linkperf:perf-list[1] man page for more parameters.
83 perf record -e some_event/@cfg1,@cfg2=config/ ...
90 - a hardware breakpoint event in the form of '\mem:addr[/len][:access]'
95 If you want to profile read-write accesses in 0x1000, just set
100 - a BPF source file (ending in .c) or a precompiled object file (ending
107 '--clang-opt' command line option, e.g.:
109 perf record --clang-opt "-DLINUX_VERSION_CODE=0x50000" \
110 -e tests/bpf-script-example.c
112 Note: '--clang-opt' must be placed before '--event/-e'.
114 - a group of events surrounded by a pair of brace ("{event1,event2,...}").
116 prevent the shell interpretation. You also need to use --group on
119 --filter=<filter>::
120 Event filter. This option should follow an event selector (-e) which
124 - tracepoint filters
126 In the case of tracepoints, multiple '--filter' options are combined
129 - address filters
132 address filters by specifying a non-zero value in
140 - 'filter': defines a region that will be traced.
141 - 'start': defines an address at which tracing will begin.
142 - 'stop': defines an address at which tracing will stop.
143 - 'tracestop': defines a region in which tracing will stop.
169 To see the filter that is passed, use the -v option.
177 --exclude-perf::
179 an event selector (-e) which selects tracepoint event(s). It adds a
181 '--filter' exists, the new filter expression will be combined with
184 -a::
185 --all-cpus::
186 System-wide collection from all CPUs (default if no target is specified).
188 -p::
189 --pid=::
192 -t::
193 --tid=::
195 This option also disables inheritance by default. Enable it by adding
196 --inherit.
198 -u::
199 --uid=::
202 -r::
203 --realtime=::
206 --no-buffering::
209 -c::
210 --count=::
211 Event period to sample.
213 -o::
214 --output=::
217 -i::
218 --no-inherit::
221 -F::
222 --freq=::
226 See --strict-freq.
228 --strict-freq::
231 -m::
232 --mmap-pages=::
234 specification with appended unit character - B/K/M/G. The
239 --group::
240 Put all events in a single event group. This precedes the --event
241 option and remains only for backward compatibility. See --event.
243 -g::
244 Enables call-graph (stack chain/backtrace) recording for both
247 --call-graph::
248 Setup and enable call-graph (stack chain/backtrace) recording,
249 implies -g. Default is "fp" (for user space).
257 Valid options are "fp" (frame pointer), "dwarf" (DWARF's CFI -
262 --fomit-frame-pointer, using the "fp" method will produce bogus
272 when sampled. Default size of the stack dump is 8192 (bytes).
274 "--call-graph dwarf,4096".
276 -q::
277 --quiet::
280 -v::
281 --verbose::
284 -s::
285 --stat::
286 Record per-thread event counts. Use it with 'perf report -T' to see
289 -d::
290 --data::
291 Record the sample virtual addresses.
293 --phys-data::
294 Record the sample physical addresses.
296 -T::
297 --timestamp::
298 Record the sample timestamps. Use it with 'perf report -D' to see the
301 -P::
302 --period::
303 Record the sample period.
305 --sample-cpu::
306 Record the sample cpu.
308 -n::
309 --no-samples::
310 Don't sample.
312 -R::
313 --raw-samples::
314 Collect raw sample records from all opened counters (default for tracepoint counters).
316 -C::
317 --cpu::
319 comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
320 In per-thread mode with inheritance mode on (default), samples are captured only when
321 the thread executes on the designated CPUs. Default is to monitor all CPUs.
323 -B::
324 --no-buildid::
331 pathname. You can also set the "record.build-id" config variable to
334 -N::
335 --no-buildid-cache::
338 is sufficient. You can also set the "record.build-id" config variable to
339 'no-cache' to have the same effect.
341 -G name,...::
342 --cgroup name,...::
344 in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to
348 an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have
351 use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'.
354 command line can be used: 'perf stat -e cycles -G cgroup_name -a -e cycles'.
356 -b::
357 --branch-any::
359 This is a shortcut for --branch-filter any. See --branch-filter for more infos.
361 -j::
362 --branch-filter::
363 Enable taken branch stack sampling. Each sample captures a series of consecutive
364 taken branches. The number of branches captured with each sample depends on the
369 - any: any type of branches
370 - any_call: any function call or system call
371 - any_ret: any function return or system call return
372 - ind_call: any indirect branch
373 - call: direct calls, including far (to/from kernel) calls
374 - u: only when the branch target is at the user level
375 - k: only when the branch target is in the kernel
376 - hv: only when the target is at the hypervisor level
377 - in_tx: only when the target is in a hardware transaction
378 - no_tx: only when the target is not in a hardware transaction
379 - abort_tx: only when the target is a hardware transaction abort
380 - cond: conditional branches
381 - save_type: save branch type during sampling in case binary is not available later
389 The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
392 --weight::
393 Enable weightened sampling. An additional weight is recorded per sample and can be
397 --namespaces::
400 --all-cgroups::
403 --transaction::
406 --per-thread::
407 Use per-thread mmaps. By default per-cpu mmaps are created. This option
408 overrides that and uses per-thread mmaps. A side-effect of that is that
409 inheritance is automatically disabled. --per-thread is ignored with a warning
410 if combined with -a or -C options.
412 -D::
413 --delay=::
414 After starting the program, wait msecs before measuring (-1: start with events
415 disabled). This is useful to filter out the startup phase of the program, which
418 -I::
419 --intr-regs::
421 each sample. List of captured registers depends on the architecture. This option
422 is off by default. It is possible to select the registers to sample using their
424 --intr-regs=\?. To name registers, pass a comma separated list such as
425 --intr-regs=ax,bx. The list of register is architecture dependent.
427 --user-regs::
428 Similar to -I, but capture user registers at sample time. To list the available
429 user registers use --user-regs=\?.
431 --running-time::
434 -k::
435 --clockid::
441 -S::
442 --snapshot::
453 --aux-sample[=OPTIONS]::
454 Select AUX area sampling. At least one of the events selected by the -e option
456 data from the AUX area. Optionally sample size may be specified, otherwise it
459 --proc-map-timeout::
460 When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
462 This option sets the time out limit. The default value is 500 ms.
464 --switch-events::
468 by the option --no-switch-events.
470 --clang-path=PATH::
474 --clang-opt=OPTIONS::
478 --vmlinux=PATH::
482 --buildid-all::
483 Record build-id of all DSOs regardless whether it's actually hit or not.
485 --aio[=n]::
486 Use <n> control blocks in asynchronous (Posix AIO) trace writing mode (default: 1, max: 4).
490 --affinity=mode::
492 node - thread affinity mask is set to NUMA node cpu mask of the processed mmap buffer
493 cpu - thread affinity mask is set to cpu of the processed mmap buffer
495 --mmap-flush=number::
502 The default option value is 1 byte which means that every time that the output
504 possibly compressed (-z) and written to the output, perf.data or pipe.
514 -z::
515 --compression-level[=n]::
516 Produce compressed trace using specified level n (default: 1 - fastest compression,
517 22 - smallest trace)
519 --all-kernel::
522 --all-user::
525 --kernel-callchains::
529 --user-callchains::
533 Don't use both --kernel-callchains and --user-callchains at the same time or no
536 --timestamp-filename
539 --timestamp-boundary::
542 --switch-output[=mode]::
545 "signal" - when receiving a SIGUSR2 (default value) or
546 <size> - when reaching the size threshold, size is expected to
547 be a number with appended unit character - B/K/M/G
548 <time> - when reaching the time threshold, size is expected to
549 be a number with appended unit character - s/m/h/d
552 on your configuration - the number and size of your ring
553 buffers (-m). It is generally more precise for higher sizes
560 Implies --timestamp-filename, --no-buildid and --no-buildid-cache.
564 --switch-output --no-no-buildid --no-no-buildid-cache
566 --switch-output-event::
567 Events that will cause the switch of the perf.data file, auto-selecting
568 --switch-output=signal, the results are similar as internally the side band
571 Uses the same syntax as --event, it will just not be recorded, serving only to
572 switch the perf.data file as soon as the --switch-output event is processed by
579 --switch-max-files=N::
581 When rotating perf.data with --switch-output, only keep N files.
583 --dry-run::
584 Parse options then exit. --dry-run can be used to detect errors in cmdline
587 'perf record --dry-run -e' can act as a BPF script compiler if llvm.dump-obj
590 --tail-synthesize::
591 Instead of collecting non-sample events (for example, fork, comm, mmap) at
593 The collected non-sample events reflects the status of the system when
596 --overwrite::
602 When '--overwrite' and '--switch-output' are used perf records and drops
608 config terms. For example: 'cycles/overwrite/' and 'instructions/no-overwrite/'.
610 Implies --tail-synthesize.
612 --kcore::
615 --max-size=<size>::
616 Limit the sample data max size, <size> is expected to be a number with
617 appended unit character - B/K/M/G
619 --num-thread-synthesize::
621 By default, the number of threads equals 1.
624 --pfm-events events::
626 including support for event filters. For example '--pfm-events
629 events cannot be mixed together. The latter must be used with the -e
630 option. The -e option and this one can be mixed and matched. Events
634 --control=fifo:ctl-fifo[,ack-fifo]::
635 --control=fd:ctl-fd[,ack-fd]::
636 ctl-fifo / ack-fifo are opened and used as ctl-fd / ack-fd as follows.
637 Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
639 started with events disabled using --delay=-1 option. Optionally send control command
640 completion ('ack\n') to ack-fd descriptor to synchronize with the controlling process.
648 test -p ${ctl_fifo} && unlink ${ctl_fifo}
653 test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
657 perf record -D -1 -e cpu-cycles -a \
658 --control fd:${ctl_fd},${ctl_fd_ack} \
659 -- sleep 30 &
662 sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
663 sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
665 exec {ctl_fd_ack}>&-
668 exec {ctl_fd}>&-
671 wait -n ${perf_pid}
676 --------
677 linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-intel-pt[1]