tools/perf/Documentation/perf-stat.txt

Source file repositories/reference/linux-study-clean/tools/perf/Documentation/perf-stat.txt

File Facts

System
Linux kernel
Corpus path
tools/perf/Documentation/perf-stat.txt
Extension
.txt
Size
24991 bytes
Lines
672
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

perf-stat(1)
============

NAME
----
perf-stat - Run a command and gather performance counter statistics

SYNOPSIS
--------
[verse]
'perf stat' [-e <EVENT> | --event=EVENT] [-a] <command>
'perf stat' [-e <EVENT> | --event=EVENT] [-a] \-- <command> [<options>]
'perf stat' [-e <EVENT> | --event=EVENT] [-a] record [-o file] \-- <command> [<options>]
'perf stat' report [-i file]

DESCRIPTION
-----------
This command runs a command and gathers performance counter statistics
from it.


OPTIONS
-------
<command>...::
	Any command you can specify in a shell.

record::
	See STAT RECORD.

report::
	See STAT REPORT.

-e::
--event=::
	Select the PMU event. Selection can be:

	- a symbolic event name (use 'perf list' to list all events)

	- a raw PMU event in the form of rN where N is a hexadecimal value
	  that represents the raw register encoding with the layout of the
	  event control registers as described by entries in
	  /sys/bus/event_source/devices/cpu/format/*.

        - a symbolic or raw PMU event followed by an optional colon
	  and a list of event modifiers, e.g., cpu-cycles:p.  See the
	  linkperf:perf-list[1] man page for details on event modifiers.

	- a symbolically formed event like 'pmu/param1=0x3,param2/' where
	  param1 and param2 are defined as formats for the PMU in
	  /sys/bus/event_source/devices/<pmu>/format/*

	  'percore' is a event qualifier that sums up the event counts for both
	  hardware threads in a core. For example:
	  perf stat -A -a -e cpu/event,percore=1/,otherevent ...

	- a symbolically formed event like 'pmu/config=M,config1=N,config2=K/'
	  where M, N, K are numbers (in decimal, hex, octal format).
	  Acceptable values for each of 'config', 'config1' and 'config2'
	  parameters are defined by corresponding entries in
	  /sys/bus/event_source/devices/<pmu>/format/*

	Note that the last two syntaxes support prefix and glob matching in
	the PMU name to simplify creation of events across multiple instances
	of the same type of PMU in large systems (e.g. memory controller PMUs).
	Multiple PMU instances are typical for uncore PMUs, so the prefix
	'uncore_' is also ignored when performing this match.


-i::
--no-inherit::

Annotation

Implementation Notes