Lines Matching +full:cpu +full:- +full:centric

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 in the form of rN where N is a hexadecimal value
36 /sys/bus/event_source/devices/cpu/format/*.
38 - a symbolic or raw PMU event followed by an optional colon
39 and a list of event modifiers, e.g., cpu-cycles:p. See the
40 linkperf:perf-list[1] man page for details on event modifiers.
42 - a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where
46 - a symbolically formed event like 'pmu/config=M,config1=N,config3=K/'
57 - 'period': Set event sampling period
58 - 'freq': Set event sampling frequency
59 - 'time': Disable/enable time stamping. Acceptable values are 1 for
62 - 'call-graph': Disable/enable callgraph. Acceptable str are "fp" for
65 - 'stack-size': user stack size for dwarf mode
66 - 'name' : User defined event name. Single quotes (') may be used to
69 - 'aux-output': Generate AUX records instead of events. This requires
71 - 'aux-action': "pause" or "resume" to pause or resume an AUX
73 "start-paused" on an AUX area event itself, will
75 - 'aux-sample-size': Set sample size for AUX area sampling. If the
76 '--aux-sample' option has been used, set aux-sample-size=0 to disable
79 See the linkperf:perf-list[1] man page for more parameters.
89 perf record -e some_event/@cfg1,@cfg2=config/ ...
96 - a hardware breakpoint event in the form of '\mem:addr[/len][:access]'
101 If you want to profile read-write accesses in 0x1000, just set
106 - a group of events surrounded by a pair of brace ("{event1,event2,...}").
108 prevent the shell interpretation. You also need to use --group on
111 --filter=<filter>::
112 Event filter. This option should follow an event selector (-e).
119 - tracepoint filters
121 In the case of tracepoints, multiple '--filter' options are combined
124 - address filters
127 address filters by specifying a non-zero value in
135 - 'filter': defines a region that will be traced.
136 - 'start': defines an address at which tracing will begin.
137 - 'stop': defines an address at which tracing will stop.
138 - 'tracestop': defines a region in which tracing will stop.
164 To see the filter that is passed, use the -v option.
172 - bpf filters
181 --filter 'period > 1000, cpu == 1'
183 --filter 'mem_op == load || mem_op == store, mem_lvl > l1'
186 CPU number is 1. The latter one accepts either load and store memory
191 Also user should request to collect that information (with -d option in
194 $ sudo perf record -e cycles --filter 'mem_op == load'
196 Hint: please add -d option to perf record.
204 ip, id, tid, pid, cpu, time, addr, period, txn, weight, phys_addr,
223 --exclude-perf::
225 an event selector (-e) which selects tracepoint event(s). It adds a
227 '--filter' exists, the new filter expression will be combined with
230 --latency::
232 Use perf report --latency for latency-centric profile.
234 -a::
235 --all-cpus::
236 System-wide collection from all CPUs (default if no target is specified).
238 -p::
239 --pid=::
242 -t::
243 --tid=::
246 --inherit.
248 -u::
249 --uid=::
252 -r::
253 --realtime=::
256 --no-buffering::
259 -c::
260 --count=::
263 -o::
264 --output=::
267 -i::
268 --no-inherit::
271 -F::
272 --freq=::
276 See --strict-freq.
278 --strict-freq::
281 -m::
282 --mmap-pages=::
284 specification in bytes with appended unit character - B/K/M/G.
285 The size is rounded up to the nearest power-of-two page value.
290 -g::
291 Enables call-graph (stack chain/backtrace) recording for both
294 --call-graph::
295 Setup and enable call-graph (stack chain/backtrace) recording,
296 implies -g. Default is "fp" (for user space).
304 Valid options are "fp" (frame pointer), "dwarf" (DWARF's CFI -
309 --fomit-frame-pointer, using the "fp" method will produce bogus
321 "--call-graph dwarf,4096".
326 like "--call-graph fp,32".
328 -q::
329 --quiet::
332 -v::
333 --verbose::
336 -s::
337 --stat::
338 Record per-thread event counts. Use it with 'perf report -T' to see
341 -d::
342 --data::
343 Record the sample virtual addresses. Implies --sample-mem-info.
345 --phys-data::
348 --data-page-size::
351 --code-page-size::
354 -T::
355 --timestamp::
356 Record the sample timestamps. Use it with 'perf report -D' to see the
359 -P::
360 --period::
363 --sample-cpu::
364 Record the sample cpu.
366 --sample-identifier::
371 --sample-mem-info::
376 -n::
377 --no-samples::
380 -R::
381 --raw-samples::
384 -C::
385 --cpu::
387 comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
388 In per-thread mode with inheritance mode on (default), samples are captured only when
394 -B::
395 --no-buildid::
402 pathname. You can also set the "record.build-id" config variable to
405 -N::
406 --no-buildid-cache::
409 is sufficient. You can also set the "record.build-id" config variable to
410 'no-cache' to have the same effect.
412 -G name,...::
413 --cgroup name,...::
415 in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to
419 an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have
422 use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'.
425 command line can be used: 'perf stat -e cycles -G cgroup_name -a -e cycles'.
427 -b::
428 --branch-any::
430 This is a shortcut for --branch-filter any. See --branch-filter for more infos.
432 -j::
433 --branch-filter::
440 - any: any type of branches
441 - any_call: any function call or system call
442 - any_ret: any function return or system call return
443 - ind_call: any indirect branch
444 - ind_jmp: any indirect jump
445 - call: direct calls, including far (to/from kernel) calls
446 - u: only when the branch target is at the user level
447 - k: only when the branch target is in the kernel
448 - hv: only when the target is at the hypervisor level
449 - in_tx: only when the target is in a hardware transaction
450 - no_tx: only when the target is not in a hardware transaction
451 - abort_tx: only when the target is a hardware transaction abort
452 - cond: conditional branches
453 - call_stack: save call stack
454 - no_flags: don't save branch flags e.g prediction, misprediction etc
455 - no_cycles: don't save branch cycles
456 - hw_index: save branch hardware index
457 - save_type: save branch type during sampling in case binary is not available later
458 For the platforms with Intel Arch LBR support (12th-Gen+ client or
459 4th-Gen Xeon+ server), the save branch type is unconditionally enabled
461 - priv: save privilege state during sampling in case binary is not available later
462 - counter: save occurrences of the event since the last branch entry. Currently, the
463 feature is only supported by a newer CPU, e.g., Intel Sierra Forest and
473 The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
476 -W::
477 --weight::
482 --namespaces::
485 --all-cgroups::
488 --transaction::
491 --per-thread::
492 Use per-thread mmaps. By default per-cpu mmaps are created. This option
493 overrides that and uses per-thread mmaps. A side-effect of that is that
494 inheritance is automatically disabled. --per-thread is ignored with a warning
495 if combined with -a or -C options.
497 -D::
498 --delay=::
499 After starting the program, wait msecs before measuring (-1: start with events
501 -D 10-20,30-40 means wait 10 msecs, enable for 10 msecs, wait 10 msecs, enable
505 -I::
506 --intr-regs::
511 --intr-regs=\?. To name registers, pass a comma separated list such as
512 --intr-regs=ax,bx. The list of register is architecture dependent.
514 --user-regs::
515 Similar to -I, but capture user registers at sample time. To list the available
516 user registers use --user-regs=\?.
518 --running-time::
521 -k::
522 --clockid::
528 -S::
529 --snapshot::
534 - 'e': take one last snapshot on exit; guarantees that there is at least one
536 - <size>: if the PMU supports this, specify the desired snapshot size.
541 --aux-sample[=OPTIONS]::
542 Select AUX area sampling. At least one of the events selected by the -e option
547 --proc-map-timeout::
548 When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
552 --switch-events::
556 by the option --no-switch-events.
558 --vmlinux=PATH::
562 --buildid-all::
563 Record build-id of all DSOs regardless whether it's actually hit or not.
565 --buildid-mmap::
566 Legacy record build-id in map events option which is now the
567 default. Behaves indentically to --no-buildid. Disable with
568 --no-buildid-mmap.
570 --aio[=n]::
575 --affinity=mode::
578 - node - thread affinity mask is set to NUMA node cpu mask of the processed mmap buffer
579 - cpu - thread affinity mask is set to cpu of the processed mmap buffer
581 --mmap-flush=number::
590 possibly compressed (-z) and written to the output, perf.data or pipe.
600 -z::
601 --compression-level[=n]::
602 Produce compressed trace using specified level n (default: 1 - fastest compression,
603 22 - smallest trace)
605 --all-kernel::
608 --all-user::
611 --kernel-callchains::
615 --user-callchains::
619 Don't use both --kernel-callchains and --user-callchains at the same time or no
622 --timestamp-filename
625 --timestamp-boundary::
628 --switch-output[=mode]::
632 - "signal" - when receiving a SIGUSR2 (default value) or
633 - <size> - when reaching the size threshold, size is expected to
634 be a number with appended unit character - B/K/M/G
635 - <time> - when reaching the time threshold, size is expected to
636 be a number with appended unit character - s/m/h/d
639 on your configuration - the number and size of your ring
640 buffers (-m). It is generally more precise for higher sizes
647 Implies --timestamp-filename, --no-buildid and --no-buildid-cache.
651 --switch-output --no-no-buildid --no-no-buildid-cache
653 --switch-output-event::
654 Events that will cause the switch of the perf.data file, auto-selecting
655 --switch-output=signal, the results are similar as internally the side band
658 Uses the same syntax as --event, it will just not be recorded, serving only to
659 switch the perf.data file as soon as the --switch-output event is processed by
666 --switch-max-files=N::
668 When rotating perf.data with --switch-output, only keep N files.
670 --dry-run::
671 Parse options then exit. --dry-run can be used to detect errors in cmdline
674 'perf record --dry-run -e' can act as a BPF script compiler if llvm.dump-obj
677 --synth=TYPE::
680 task status for pre-existing threads.
683 choice in this option. For example, --synth=no would have MMAP events for
688 - 'task' - synthesize FORK and COMM events for each task
689 - 'mmap' - synthesize MMAP events for each process (implies 'task')
690 - 'cgroup' - synthesize CGROUP events for each cgroup
691 - 'all' - synthesize all events (default)
692 - 'no' - do not synthesize any of the above events
694 --tail-synthesize::
695 Instead of collecting non-sample events (for example, fork, comm, mmap) at
697 The collected non-sample events reflects the status of the system when
700 --overwrite::
706 When '--overwrite' and '--switch-output' are used perf records and drops
712 config terms. For example: 'cycles/overwrite/' and 'instructions/no-overwrite/'.
714 Implies --tail-synthesize.
716 --kcore::
719 --max-size=<size>::
721 appended unit character - B/K/M/G
723 --num-thread-synthesize::
728 --pfm-events events::
730 including support for event filters. For example '--pfm-events
733 events cannot be mixed together. The latter must be used with the -e
734 option. The -e option and this one can be mixed and matched. Events
738 --control=fifo:ctl-fifo[,ack-fifo]::
739 --control=fd:ctl-fd[,ack-fd]::
740 ctl-fifo / ack-fifo are opened and used as ctl-fd / ack-fd as follows.
741 Listen on ctl-fd descriptor for command to control measurement.
745 - 'enable' : enable events
746 - 'disable' : disable events
747 - 'enable name' : enable event 'name'
748 - 'disable name' : disable event 'name'
749 - 'snapshot' : AUX area tracing snapshot).
750 - 'stop' : stop perf record
751 - 'ping' : ping
752 - 'evlist [-v|-g|-F] : display all events
754 -F Show just the sample frequency used for each event.
755 -v Show all fields.
756 -g Show event group information.
758 Measurements can be started with events disabled using --delay=-1 option. Optionally
759 send control command completion ('ack\n') to ack-fd descriptor to synchronize with the
768 test -p ${ctl_fifo} && unlink ${ctl_fifo}
773 test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
777 perf record -D -1 -e cpu-cycles -a \
778 --control fd:${ctl_fd},${ctl_fd_ack} \
779 -- sleep 30 &
782 sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
783 sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
785 exec {ctl_fd_ack}>&-
788 exec {ctl_fd}>&-
791 wait -n ${perf_pid}
794 --threads=<spec>::
808 0,2-4/2-4:1,5-7/5-7
811 the first thread monitors CPUs 0 and 2-4 with the affinity mask 2-4,
812 the second monitors CPUs 1 and 5-7 with the affinity mask 5-7.
817 - cpu - create new data streaming thread for every monitored cpu
818 - core - create new thread to monitor CPUs grouped by a core
819 - package - create new thread to monitor CPUs grouped by a package
820 - numa - create new threed to monitor CPUs grouped by a NUMA domain
823 order not to spawn multiple per-cpu streaming threads but still avoid LOST
825 defaults to CPU layout. Masks defined or provided by the option value are
826 filtered through the mask provided by -C option.
828 --debuginfod[=URLs]::
837 --off-cpu::
838 Enable off-cpu profiling with BPF. The BPF program will collect
840 as sample data of a software event named "offcpu-time". The
847 off-cpu profiling consists two types of samples: direct samples, which
852 --off-cpu-thresh::
853 Once a task's off-cpu time reaches this threshold (in milliseconds), it
854 generates a direct off-cpu sample. The default is 500ms.
856 --setup-filter=<action>::
861 include::intel-hybrid.txt[]
864 --------
865 linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-intel-pt[1]