linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Weird instruction profiling
@ 2015-02-18  9:57 Brendan Gregg
  2015-02-18 18:30 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: Brendan Gregg @ 2015-02-18  9:57 UTC (permalink / raw)
  To: linux-perf-use.

G'Day,

I was profiling and noticed some odd instruction counts, and boiled it
down to a 16 NOP loop:

# perf annotate -i perf.data.noplooper --stdio
 Percent |      Source code & Disassembly of noplooper
--------------------------------------------------------
         :
         :      Disassembly of section .text:
         :
         :      00000000004004ed <main>:
    0.00 :        4004ed:       push   %rbp
    0.00 :        4004ee:       mov    %rsp,%rbp
   20.86 :        4004f1:       nop
    0.00 :        4004f2:       nop
    0.00 :        4004f3:       nop
    0.00 :        4004f4:       nop
   19.84 :        4004f5:       nop
    0.00 :        4004f6:       nop
    0.00 :        4004f7:       nop
    0.00 :        4004f8:       nop
   18.73 :        4004f9:       nop
    0.00 :        4004fa:       nop
    0.00 :        4004fb:       nop
    0.00 :        4004fc:       nop
   19.08 :        4004fd:       nop
    0.00 :        4004fe:       nop
    0.00 :        4004ff:       nop
    0.00 :        400500:       nop
   21.49 :        400501:       jmp    4004f1 <main+0x4>

Despite millions of samples, many NOPs are never seen. (See the
Percent column.) I'm not using PEBS, but I suppose I should.

I think Andi mentioned this to me last year -- that instruction
profiling was no longer reliable. At the time I hadn't been bitten by
it, but now I have!

Is this due to parallel and out-of-order execution? (ie, we're
sampling the instruction pointer, but that's set to the resumption
instruction, not the instructions being processed in the backend?).
Thanks,

Brendan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-20 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18  9:57 Weird instruction profiling Brendan Gregg
2015-02-18 18:30 ` Andi Kleen
2015-02-18 23:33   ` David Ahern
2015-02-18 23:38     ` Andi Kleen
2015-02-18 23:46       ` David Ahern
2015-02-20 19:04         ` Brendan Gregg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).