perf-stat.txt 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. perf-stat(1)
  2. ============
  3. NAME
  4. ----
  5. perf-stat - Run a command and gather performance counter statistics
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf stat' [-e <EVENT> | --event=EVENT] [-a] <command>
  10. 'perf stat' [-e <EVENT> | --event=EVENT] [-a] \-- <command> [<options>]
  11. 'perf stat' [-e <EVENT> | --event=EVENT] [-a] record [-o file] \-- <command> [<options>]
  12. 'perf stat' report [-i file]
  13. DESCRIPTION
  14. -----------
  15. This command runs a command and gathers performance counter statistics
  16. from it.
  17. OPTIONS
  18. -------
  19. <command>...::
  20. Any command you can specify in a shell.
  21. record::
  22. See STAT RECORD.
  23. report::
  24. See STAT REPORT.
  25. -e::
  26. --event=::
  27. Select the PMU event. Selection can be:
  28. - a symbolic event name (use 'perf list' to list all events)
  29. - a raw PMU event in the form of rN where N is a hexadecimal value
  30. that represents the raw register encoding with the layout of the
  31. event control registers as described by entries in
  32. /sys/bus/event_source/devices/cpu/format/*.
  33. - a symbolic or raw PMU event followed by an optional colon
  34. and a list of event modifiers, e.g., cpu-cycles:p. See the
  35. linkperf:perf-list[1] man page for details on event modifiers.
  36. - a symbolically formed event like 'pmu/param1=0x3,param2/' where
  37. param1 and param2 are defined as formats for the PMU in
  38. /sys/bus/event_source/devices/<pmu>/format/*
  39. 'percore' is a event qualifier that sums up the event counts for both
  40. hardware threads in a core. For example:
  41. perf stat -A -a -e cpu/event,percore=1/,otherevent ...
  42. - a symbolically formed event like 'pmu/config=M,config1=N,config2=K/'
  43. where M, N, K are numbers (in decimal, hex, octal format).
  44. Acceptable values for each of 'config', 'config1' and 'config2'
  45. parameters are defined by corresponding entries in
  46. /sys/bus/event_source/devices/<pmu>/format/*
  47. Note that the last two syntaxes support prefix and glob matching in
  48. the PMU name to simplify creation of events across multiple instances
  49. of the same type of PMU in large systems (e.g. memory controller PMUs).
  50. Multiple PMU instances are typical for uncore PMUs, so the prefix
  51. 'uncore_' is also ignored when performing this match.
  52. -i::
  53. --no-inherit::
  54. child tasks do not inherit counters
  55. -p::
  56. --pid=<pid>::
  57. stat events on existing process id (comma separated list)
  58. -t::
  59. --tid=<tid>::
  60. stat events on existing thread id (comma separated list)
  61. -b::
  62. --bpf-prog::
  63. stat events on existing bpf program id (comma separated list),
  64. requiring root rights. bpftool-prog could be used to find program
  65. id all bpf programs in the system. For example:
  66. # bpftool prog | head -n 1
  67. 17247: tracepoint name sys_enter tag 192d548b9d754067 gpl
  68. # perf stat -e cycles,instructions --bpf-prog 17247 --timeout 1000
  69. Performance counter stats for 'BPF program(s) 17247':
  70. 85,967 cycles
  71. 28,982 instructions # 0.34 insn per cycle
  72. 1.102235068 seconds time elapsed
  73. --bpf-counters::
  74. Use BPF programs to aggregate readings from perf_events. This
  75. allows multiple perf-stat sessions that are counting the same metric (cycles,
  76. instructions, etc.) to share hardware counters.
  77. To use BPF programs on common events by default, use
  78. "perf config stat.bpf-counter-events=<list_of_events>".
  79. --bpf-attr-map::
  80. With option "--bpf-counters", different perf-stat sessions share
  81. information about shared BPF programs and maps via a pinned hashmap.
  82. Use "--bpf-attr-map" to specify the path of this pinned hashmap.
  83. The default path is /sys/fs/bpf/perf_attr_map.
  84. ifdef::HAVE_LIBPFM[]
  85. --pfm-events events::
  86. Select a PMU event using libpfm4 syntax (see http://perfmon2.sf.net)
  87. including support for event filters. For example '--pfm-events
  88. inst_retired:any_p:u:c=1:i'. More than one event can be passed to the
  89. option using the comma separator. Hardware events and generic hardware
  90. events cannot be mixed together. The latter must be used with the -e
  91. option. The -e option and this one can be mixed and matched. Events
  92. can be grouped using the {} notation.
  93. endif::HAVE_LIBPFM[]
  94. -a::
  95. --all-cpus::
  96. system-wide collection from all CPUs (default if no target is specified)
  97. --no-scale::
  98. Don't scale/normalize counter values
  99. -d::
  100. --detailed::
  101. print more detailed statistics, can be specified up to 3 times
  102. -d: detailed events, L1 and LLC data cache
  103. -d -d: more detailed events, dTLB and iTLB events
  104. -d -d -d: very detailed events, adding prefetch events
  105. -r::
  106. --repeat=<n>::
  107. repeat command and print average + stddev (max: 100). 0 means forever.
  108. -B::
  109. --big-num::
  110. print large numbers with thousands' separators according to locale.
  111. Enabled by default. Use "--no-big-num" to disable.
  112. Default setting can be changed with "perf config stat.big-num=false".
  113. -C::
  114. --cpu=::
  115. Count only on the list of CPUs provided. Multiple CPUs can be provided as a
  116. comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
  117. In per-thread mode, this option is ignored. The -a option is still necessary
  118. to activate system-wide monitoring. Default is to count on all CPUs.
  119. -A::
  120. --no-aggr::
  121. Do not aggregate counts across all monitored CPUs.
  122. -n::
  123. --null::
  124. null run - Don't start any counters.
  125. This can be useful to measure just elapsed wall-clock time - or to assess the
  126. raw overhead of perf stat itself, without running any counters.
  127. -v::
  128. --verbose::
  129. be more verbose (show counter open errors, etc)
  130. -x SEP::
  131. --field-separator SEP::
  132. print counts using a CSV-style output to make it easy to import directly into
  133. spreadsheets. Columns are separated by the string specified in SEP.
  134. --table:: Display time for each run (-r option), in a table format, e.g.:
  135. $ perf stat --null -r 5 --table perf bench sched pipe
  136. Performance counter stats for 'perf bench sched pipe' (5 runs):
  137. # Table of individual measurements:
  138. 5.189 (-0.293) #
  139. 5.189 (-0.294) #
  140. 5.186 (-0.296) #
  141. 5.663 (+0.181) ##
  142. 6.186 (+0.703) ####
  143. # Final result:
  144. 5.483 +- 0.198 seconds time elapsed ( +- 3.62% )
  145. -G name::
  146. --cgroup name::
  147. monitor only in the container (cgroup) called "name". This option is available only
  148. in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to
  149. container "name" are monitored when they run on the monitored CPUs. Multiple cgroups
  150. can be provided. Each cgroup is applied to the corresponding event, i.e., first cgroup
  151. to first event, second cgroup to second event and so on. It is possible to provide
  152. an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have
  153. corresponding events, i.e., they always refer to events defined earlier on the command
  154. line. If the user wants to track multiple events for a specific cgroup, the user can
  155. use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'.
  156. If wanting to monitor, say, 'cycles' for a cgroup and also for system wide, this
  157. command line can be used: 'perf stat -e cycles -G cgroup_name -a -e cycles'.
  158. --for-each-cgroup name::
  159. Expand event list for each cgroup in "name" (allow multiple cgroups separated
  160. by comma). It also support regex patterns to match multiple groups. This has same
  161. effect that repeating -e option and -G option for each event x name. This option
  162. cannot be used with -G/--cgroup option.
  163. -o file::
  164. --output file::
  165. Print the output into the designated file.
  166. --append::
  167. Append to the output file designated with the -o option. Ignored if -o is not specified.
  168. --log-fd::
  169. Log output to fd, instead of stderr. Complementary to --output, and mutually exclusive
  170. with it. --append may be used here. Examples:
  171. 3>results perf stat --log-fd 3 \-- $cmd
  172. 3>>results perf stat --log-fd 3 --append \-- $cmd
  173. --control=fifo:ctl-fifo[,ack-fifo]::
  174. --control=fd:ctl-fd[,ack-fd]::
  175. ctl-fifo / ack-fifo are opened and used as ctl-fd / ack-fd as follows.
  176. Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
  177. 'disable': disable events). Measurements can be started with events disabled using
  178. --delay=-1 option. Optionally send control command completion ('ack\n') to ack-fd descriptor
  179. to synchronize with the controlling process. Example of bash shell script to enable and
  180. disable events during measurements:
  181. #!/bin/bash
  182. ctl_dir=/tmp/
  183. ctl_fifo=${ctl_dir}perf_ctl.fifo
  184. test -p ${ctl_fifo} && unlink ${ctl_fifo}
  185. mkfifo ${ctl_fifo}
  186. exec {ctl_fd}<>${ctl_fifo}
  187. ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
  188. test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
  189. mkfifo ${ctl_ack_fifo}
  190. exec {ctl_fd_ack}<>${ctl_ack_fifo}
  191. perf stat -D -1 -e cpu-cycles -a -I 1000 \
  192. --control fd:${ctl_fd},${ctl_fd_ack} \
  193. \-- sleep 30 &
  194. perf_pid=$!
  195. sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
  196. sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
  197. exec {ctl_fd_ack}>&-
  198. unlink ${ctl_ack_fifo}
  199. exec {ctl_fd}>&-
  200. unlink ${ctl_fifo}
  201. wait -n ${perf_pid}
  202. exit $?
  203. --pre::
  204. --post::
  205. Pre and post measurement hooks, e.g.:
  206. perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' \-- make -s -j64 O=defconfig-build/ bzImage
  207. -I msecs::
  208. --interval-print msecs::
  209. Print count deltas every N milliseconds (minimum: 1ms)
  210. The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
  211. example: 'perf stat -I 1000 -e cycles -a sleep 5'
  212. If the metric exists, it is calculated by the counts generated in this interval and the metric is printed after #.
  213. --interval-count times::
  214. Print count deltas for fixed number of times.
  215. This option should be used together with "-I" option.
  216. example: 'perf stat -I 1000 --interval-count 2 -e cycles -a'
  217. --interval-clear::
  218. Clear the screen before next interval.
  219. --timeout msecs::
  220. Stop the 'perf stat' session and print count deltas after N milliseconds (minimum: 10 ms).
  221. This option is not supported with the "-I" option.
  222. example: 'perf stat --time 2000 -e cycles -a'
  223. --metric-only::
  224. Only print computed metrics. Print them in a single line.
  225. Don't show any raw values. Not supported with --per-thread.
  226. --per-socket::
  227. Aggregate counts per processor socket for system-wide mode measurements. This
  228. is a useful mode to detect imbalance between sockets. To enable this mode,
  229. use --per-socket in addition to -a. (system-wide). The output includes the
  230. socket number and the number of online processors on that socket. This is
  231. useful to gauge the amount of aggregation.
  232. --per-die::
  233. Aggregate counts per processor die for system-wide mode measurements. This
  234. is a useful mode to detect imbalance between dies. To enable this mode,
  235. use --per-die in addition to -a. (system-wide). The output includes the
  236. die number and the number of online processors on that die. This is
  237. useful to gauge the amount of aggregation.
  238. --per-cluster::
  239. Aggregate counts per processor cluster for system-wide mode measurement. This
  240. is a useful mode to detect imbalance between clusters. To enable this mode,
  241. use --per-cluster in addition to -a. (system-wide). The output includes the
  242. cluster number and the number of online processors on that cluster. This is
  243. useful to gauge the amount of aggregation. The information of cluster ID and
  244. related CPUs can be gotten from /sys/devices/system/cpu/cpuX/topology/cluster_{id, cpus}.
  245. --per-cache::
  246. Aggregate counts per cache instance for system-wide mode measurements. By
  247. default, the aggregation happens for the cache level at the highest index
  248. in the system. To specify a particular level, mention the cache level
  249. alongside the option in the format [Ll][1-9][0-9]*. For example:
  250. Using option "--per-cache=l3" or "--per-cache=L3" will aggregate the
  251. information at the boundary of the level 3 cache in the system.
  252. --per-core::
  253. Aggregate counts per physical processor for system-wide mode measurements. This
  254. is a useful mode to detect imbalance between physical cores. To enable this mode,
  255. use --per-core in addition to -a. (system-wide). The output includes the
  256. core number and the number of online logical processors on that physical processor.
  257. --per-thread::
  258. Aggregate counts per monitored threads, when monitoring threads (-t option)
  259. or processes (-p option).
  260. --per-node::
  261. Aggregate counts per NUMA nodes for system-wide mode measurements. This
  262. is a useful mode to detect imbalance between NUMA nodes. To enable this
  263. mode, use --per-node in addition to -a. (system-wide).
  264. -D msecs::
  265. --delay msecs::
  266. After starting the program, wait msecs before measuring (-1: start with events
  267. disabled). This is useful to filter out the startup phase of the program,
  268. which is often very different.
  269. -T::
  270. --transaction::
  271. Print statistics of transactional execution if supported.
  272. --metric-no-group::
  273. By default, events to compute a metric are placed in weak groups. The
  274. group tries to enforce scheduling all or none of the events. The
  275. --metric-no-group option places events outside of groups and may
  276. increase the chance of the event being scheduled - leading to more
  277. accuracy. However, as events may not be scheduled together accuracy
  278. for metrics like instructions per cycle can be lower - as both metrics
  279. may no longer be being measured at the same time.
  280. --metric-no-merge::
  281. By default metric events in different weak groups can be shared if one
  282. group contains all the events needed by another. In such cases one
  283. group will be eliminated reducing event multiplexing and making it so
  284. that certain groups of metrics sum to 100%. A downside to sharing a
  285. group is that the group may require multiplexing and so accuracy for a
  286. small group that need not have multiplexing is lowered. This option
  287. forbids the event merging logic from sharing events between groups and
  288. may be used to increase accuracy in this case.
  289. --metric-no-threshold::
  290. Metric thresholds may increase the number of events necessary to
  291. compute whether a metric has exceeded its threshold expression. This
  292. may not be desirable, for example, as the events can introduce
  293. multiplexing. This option disables the adding of threshold expression
  294. events for a metric. However, if there are sufficient events to
  295. compute the threshold then the threshold is still computed and used to
  296. color the metric's computed value.
  297. --quiet::
  298. Don't print output, warnings or messages. This is useful with perf stat
  299. record below to only write data to the perf.data file.
  300. --no-affinity::
  301. Don't change scheduler CPU affinities when iterating over
  302. CPUs. Disables an optimization aimed at minimizing interprocessor
  303. interrupts.
  304. STAT RECORD
  305. -----------
  306. Stores stat data into perf data file.
  307. -o file::
  308. --output file::
  309. Output file name.
  310. STAT REPORT
  311. -----------
  312. Reads and reports stat data from perf data file.
  313. -i file::
  314. --input file::
  315. Input file name.
  316. --per-socket::
  317. Aggregate counts per processor socket for system-wide mode measurements.
  318. --per-die::
  319. Aggregate counts per processor die for system-wide mode measurements.
  320. --per-cluster::
  321. Aggregate counts perf processor cluster for system-wide mode measurements.
  322. --per-cache::
  323. Aggregate counts per cache instance for system-wide mode measurements. By
  324. default, the aggregation happens for the cache level at the highest index
  325. in the system. To specify a particular level, mention the cache level
  326. alongside the option in the format [Ll][1-9][0-9]*. For example: Using
  327. option "--per-cache=l3" or "--per-cache=L3" will aggregate the
  328. information at the boundary of the level 3 cache in the system.
  329. --per-core::
  330. Aggregate counts per physical processor for system-wide mode measurements.
  331. -M::
  332. --metrics::
  333. Print metrics or metricgroups specified in a comma separated list.
  334. For a group all metrics from the group are added.
  335. The events from the metrics are automatically measured.
  336. See perf list output for the possible metrics and metricgroups.
  337. When threshold information is available for a metric, the
  338. color red is used to signify a metric has exceeded a threshold
  339. while green shows it hasn't. The default color means that
  340. no threshold information was available or the threshold
  341. couldn't be computed.
  342. -A::
  343. --no-aggr::
  344. --no-merge::
  345. Do not aggregate/merge counts across monitored CPUs or PMUs.
  346. When multiple events are created from a single event specification,
  347. stat will, by default, aggregate the event counts and show the result
  348. in a single row. This option disables that behavior and shows the
  349. individual events and counts.
  350. Multiple events are created from a single event specification when:
  351. 1. PID monitoring isn't requested and the system has more than one
  352. CPU. For example, a system with 8 SMT threads will have one event
  353. opened on each thread and aggregation is performed across them.
  354. 2. Prefix or glob wildcard matching is used for the PMU name. For
  355. example, multiple memory controller PMUs may exist typically with a
  356. suffix of _0, _1, etc. By default the event counts will all be
  357. combined if the PMU is specified without the suffix such as
  358. uncore_imc rather than uncore_imc_0.
  359. 3. Aliases, which are listed immediately after the Kernel PMU events
  360. by perf list, are used.
  361. --hybrid-merge::
  362. Merge core event counts from all core PMUs. In hybrid or big.LITTLE
  363. systems by default each core PMU will report its count
  364. separately. This option forces core PMU counts to be combined to give
  365. a behavior closer to having a single CPU type in the system.
  366. --topdown::
  367. Print top-down metrics supported by the CPU. This allows to determine
  368. bottle necks in the CPU pipeline for CPU bound workloads, by breaking
  369. the cycles consumed down into frontend bound, backend bound, bad
  370. speculation and retiring.
  371. Frontend bound means that the CPU cannot fetch and decode instructions fast
  372. enough. Backend bound means that computation or memory access is the bottle
  373. neck. Bad Speculation means that the CPU wasted cycles due to branch
  374. mispredictions and similar issues. Retiring means that the CPU computed without
  375. an apparently bottleneck. The bottleneck is only the real bottleneck
  376. if the workload is actually bound by the CPU and not by something else.
  377. For best results it is usually a good idea to use it with interval
  378. mode like -I 1000, as the bottleneck of workloads can change often.
  379. This enables --metric-only, unless overridden with --no-metric-only.
  380. The following restrictions only apply to older Intel CPUs and Atom,
  381. on newer CPUs (IceLake and later) TopDown can be collected for any thread:
  382. The top down metrics are collected per core instead of per
  383. CPU thread. Per core mode is automatically enabled
  384. and -a (global monitoring) is needed, requiring root rights or
  385. perf.perf_event_paranoid=-1.
  386. Topdown uses the full Performance Monitoring Unit, and needs
  387. disabling of the NMI watchdog (as root):
  388. echo 0 > /proc/sys/kernel/nmi_watchdog
  389. for best results. Otherwise the bottlenecks may be inconsistent
  390. on workload with changing phases.
  391. To interpret the results it is usually needed to know on which
  392. CPUs the workload runs on. If needed the CPUs can be forced using
  393. taskset.
  394. --record-tpebs::
  395. Enable automatic sampling on Intel TPEBS retire_latency events (event with :R
  396. modifier). Without this option, perf would not capture dynamic retire_latency
  397. at runtime. Currently, a zero value is assigned to the retire_latency event when
  398. this option is not set. The TPEBS hardware feature starts from Intel Granite
  399. Rapids microarchitecture. This option only exists in X86_64 and is meaningful on
  400. Intel platforms with TPEBS feature.
  401. --tpebs-mode=[mean|min|max|last]::
  402. Set how retirement latency events have their sample times
  403. combined. The default "mean" gives the average of retirement
  404. latency. "min" or "max" give the smallest or largest retirment latency
  405. times respectively. "last" uses the last retirment latency sample's
  406. time.
  407. --td-level::
  408. Print the top-down statistics that equal the input level. It allows
  409. users to print the interested top-down metrics level instead of the
  410. level 1 top-down metrics.
  411. As the higher levels gather more metrics and use more counters they
  412. will be less accurate. By convention a metric can be examined by
  413. appending '_group' to it and this will increase accuracy compared to
  414. gathering all metrics for a level. For example, level 1 analysis may
  415. highlight 'tma_frontend_bound'. This metric may be drilled into with
  416. 'tma_frontend_bound_group' with
  417. 'perf stat -M tma_frontend_bound_group...'.
  418. Error out if the input is higher than the supported max level.
  419. --smi-cost::
  420. Measure SMI cost if msr/aperf/ and msr/smi/ events are supported.
  421. During the measurement, the /sys/device/cpu/freeze_on_smi will be set to
  422. freeze core counters on SMI.
  423. The aperf counter will not be effected by the setting.
  424. The cost of SMI can be measured by (aperf - unhalted core cycles).
  425. In practice, the percentages of SMI cycles is very useful for performance
  426. oriented analysis. --metric_only will be applied by default.
  427. The output is SMI cycles%, equals to (aperf - unhalted core cycles) / aperf
  428. Users who wants to get the actual value can apply --no-metric-only.
  429. --all-kernel::
  430. Configure all used events to run in kernel space.
  431. --all-user::
  432. Configure all used events to run in user space.
  433. --percore-show-thread::
  434. The event modifier "percore" has supported to sum up the event counts
  435. for all hardware threads in a core and show the counts per core.
  436. This option with event modifier "percore" enabled also sums up the event
  437. counts for all hardware threads in a core but show the sum counts per
  438. hardware thread. This is essentially a replacement for the any bit and
  439. convenient for post processing.
  440. --summary::
  441. Print summary for interval mode (-I).
  442. --no-csv-summary::
  443. Don't print 'summary' at the first column for CVS summary output.
  444. This option must be used with -x and --summary.
  445. This option can be enabled in perf config by setting the variable
  446. 'stat.no-csv-summary'.
  447. $ perf config stat.no-csv-summary=true
  448. --cputype::
  449. Only enable events on applying cpu with this type for hybrid platform
  450. (e.g. core or atom)"
  451. EXAMPLES
  452. --------
  453. $ perf stat \-- make
  454. Performance counter stats for 'make':
  455. 83723.452481 task-clock:u (msec) # 1.004 CPUs utilized
  456. 0 context-switches:u # 0.000 K/sec
  457. 0 cpu-migrations:u # 0.000 K/sec
  458. 3,228,188 page-faults:u # 0.039 M/sec
  459. 229,570,665,834 cycles:u # 2.742 GHz
  460. 313,163,853,778 instructions:u # 1.36 insn per cycle
  461. 69,704,684,856 branches:u # 832.559 M/sec
  462. 2,078,861,393 branch-misses:u # 2.98% of all branches
  463. 83.409183620 seconds time elapsed
  464. 74.684747000 seconds user
  465. 8.739217000 seconds sys
  466. TIMINGS
  467. -------
  468. As displayed in the example above we can display 3 types of timings.
  469. We always display the time the counters were enabled/alive:
  470. 83.409183620 seconds time elapsed
  471. For workload sessions we also display time the workloads spent in
  472. user/system lands:
  473. 74.684747000 seconds user
  474. 8.739217000 seconds sys
  475. Those times are the very same as displayed by the 'time' tool.
  476. CSV FORMAT
  477. ----------
  478. With -x, perf stat is able to output a not-quite-CSV format output
  479. Commas in the output are not put into "". To make it easy to parse
  480. it is recommended to use a different character like -x \;
  481. The fields are in this order:
  482. - optional usec time stamp in fractions of second (with -I xxx)
  483. - optional CPU, core, or socket identifier
  484. - optional number of logical CPUs aggregated
  485. - counter value
  486. - unit of the counter value or empty
  487. - event name
  488. - run time of counter
  489. - percentage of measurement time the counter was running
  490. - optional variance if multiple values are collected with -r
  491. - optional metric value
  492. - optional unit of metric
  493. Additional metrics may be printed with all earlier fields being empty.
  494. include::intel-hybrid.txt[]
  495. JSON FORMAT
  496. -----------
  497. With -j, perf stat is able to print out a JSON format output
  498. that can be used for parsing.
  499. - interval : optional timestamp in fractions of second (with -I)
  500. - optional aggregate options:
  501. - core : core identifier (with --per-core)
  502. - die : die identifier (with --per-die)
  503. - socket : socket identifier (with --per-socket)
  504. - node : node identifier (with --per-node)
  505. - thread : thread identifier (with --per-thread)
  506. - counters : number of aggregated PMU counters
  507. - counter-value : counter value
  508. - unit : unit of the counter value or empty
  509. - event : event name
  510. - variance : optional variance if multiple values are collected (with -r)
  511. - event-runtime : run time of the event
  512. - pcnt-running : percentage of time the event was running
  513. - metric-value : optional metric value
  514. - metric-unit : optional unit of metric
  515. SEE ALSO
  516. --------
  517. linkperf:perf-top[1], linkperf:perf-list[1]