Check out my first novel, midnight's simulacra!
Perf: Difference between revisions
From dankwiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
For those put off by the baroque interface and daunting learning curve of [[Oprofile]], Ingo Molnár's perf tool (included with the linux kernel since at least version 2.6.30 in <tt>tools/perf</tt>) is a quick and easy way to get data from x86's [[Performance Counters|performance counters]]. | For those put off by the baroque interface and daunting learning curve of [[Oprofile]], Ingo Molnár's perf tool (included with the linux kernel since at least version 2.6.30 in <tt>tools/perf</tt>) is a quick and easy way to get data from x86's [[Performance Counters|performance counters]]. | ||
==perf stat== | |||
* <tt>-r num</tt> can be used to run the pass <tt>num</tt> times, displaying a standard deviation: | |||
<pre> | |||
Performance counter stats for './notcurses-demo -k -c ww' (3 runs): | |||
23,153,745,413 cycles ( +- 0.64% ) | |||
67,109,369,279 instructions # 2.90 insn per cycle ( +- 0.35% ) | |||
86,574,323 cache-misses ( +- 1.79% ) | |||
10,555,354,499 branches ( +- 0.35% ) | |||
11.0698 +- 0.0119 seconds time elapsed ( +- 0.11% ) | |||
</pre> | |||
==See Also== | ==See Also== | ||
* 2009-06-06 [http://lkml.org/lkml/2009/6/6/149 LKML post] announcing version -v8 | * 2009-06-06 [http://lkml.org/lkml/2009/6/6/149 LKML post] announcing version -v8 |
Revision as of 08:44, 24 February 2021
For those put off by the baroque interface and daunting learning curve of Oprofile, Ingo Molnár's perf tool (included with the linux kernel since at least version 2.6.30 in tools/perf) is a quick and easy way to get data from x86's performance counters.
perf stat
- -r num can be used to run the pass num times, displaying a standard deviation:
Performance counter stats for './notcurses-demo -k -c ww' (3 runs): 23,153,745,413 cycles ( +- 0.64% ) 67,109,369,279 instructions # 2.90 insn per cycle ( +- 0.35% ) 86,574,323 cache-misses ( +- 1.79% ) 10,555,354,499 branches ( +- 0.35% ) 11.0698 +- 0.0119 seconds time elapsed ( +- 0.11% )
See Also
- 2009-06-06 LKML post announcing version -v8