Check out my first novel, midnight's simulacra!

Perf: Difference between revisions

From dankwiki
(Created page with 'For those put off by the baroque interface and daunting learning curve of Oprofile, Ingo Molnar's perf tool (included with the linux kernel since at least version 2.6.30 in <...')
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
For those put off by the baroque interface and daunting learning curve of [[Oprofile]], Ingo Molnar'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]].
 
You need to have <tt>CONFIG_LOCKDEP</tt> and <tt>CONFIG_LOCK_STAT</tt> enabled to use <tt>perf lock</tt>.
 
==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

Latest revision as of 10:25, 28 January 2022

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.

You need to have CONFIG_LOCKDEP and CONFIG_LOCK_STAT enabled to use perf lock.

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