Linux Perf Users
 help / color / mirror / Atom feed
* perf event "instructions"
@ 2012-05-25  2:46 Hank
  2012-05-25  3:07 ` Vince Weaver
  0 siblings, 1 reply; 3+ messages in thread
From: Hank @ 2012-05-25  2:46 UTC (permalink / raw)
  To: linux-perf-users

Hi,

I've collected number of instructions using predefined event named
"instructions" and also collected using the raw event (register and unit mask)
for instructions retired. Although they are similar, outputs are not the exactly
the same. 

Can anyone explain me what is the built-in event "instructions" measuring? If it
is the number of retired instructions, then what might be the reason for getting
different output when I use the raw event number?

Thanks a lot,

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

* Re: perf event "instructions"
  2012-05-25  2:46 perf event "instructions" Hank
@ 2012-05-25  3:07 ` Vince Weaver
       [not found]   ` <139CD8A4-506E-46DF-BB18-6378576A90FC@bu.edu>
  0 siblings, 1 reply; 3+ messages in thread
From: Vince Weaver @ 2012-05-25  3:07 UTC (permalink / raw)
  To: Hank; +Cc: linux-perf-users

On Thu, 24 May 2012, Hank wrote:

> I've collected number of instructions using predefined event named
> "instructions" and also collected using the raw event (register and unit mask)
> for instructions retired. Although they are similar, outputs are not the exactly
> the same. 
> 
> Can anyone explain me what is the built-in event "instructions" measuring? If it
> is the number of retired instructions, then what might be the reason for getting
> different output when I use the raw event number?

what processor are you running on?  What raw event are you using?
what version of Linux?

Are you specifying things like user-only?

There's enough variation in retired instruction counts that entire papers 
have been written on it.
   
http://web.eecs.utk.edu/~vweaver1/projects/deterministic/fhpm2010_weaver.pdf

Vince

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

* Re: perf event "instructions"
       [not found]   ` <139CD8A4-506E-46DF-BB18-6378576A90FC@bu.edu>
@ 2012-05-25 13:57     ` Vince Weaver
  0 siblings, 0 replies; 3+ messages in thread
From: Vince Weaver @ 2012-05-25 13:57 UTC (permalink / raw)
  To: Can Hankendi; +Cc: linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

On Thu, 24 May 2012, Can Hankendi wrote:

> Processor is AMD 10H family processor and I'm using this raw event (from AMD
> Bios and Kernel Developers Guide):
> 
> EventSelect 0C0h Retired Instructions 
> 
> The number of instructions retired (execution completed and architectural
> state updated). This count includes exceptions and interrupts - each
> exception or interrupt is counted as one instruction.
> 
> Linux is Ubuntu 12.04, with 3.2.0 kernel. 
> 
> I'm collecting system-wide data with perf stat command. I'm well aware about
> the variations in retired instructions. However, I'm collecting the
> "instructions" and raw event 0x0C0h for the same session and ending up with
> different results. So I assume it is not about variations, it's more about
> how the built-in event is configured in perf tool. 

so you're saying you are doing something like:
   perf stat -e instructions:u,rc0:u  my_job

and getting different values for the results?
You keep giving not enough info to diagnose this problem.  What's your
*exact* perf command?

The only way to find out what the kernel is using is to check the source.
(I won't comment on how great a feature I think that is).
In arch/x86/kernel/cpu/perf_event_amd.c you can find
  [PERF_COUNT_HW_INSTRUCTIONS]                  = 0x00c0,

Vince

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

end of thread, other threads:[~2012-05-25 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25  2:46 perf event "instructions" Hank
2012-05-25  3:07 ` Vince Weaver
     [not found]   ` <139CD8A4-506E-46DF-BB18-6378576A90FC@bu.edu>
2012-05-25 13:57     ` Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox