lkml.org 
[lkml]   [2009]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: performance counter 20% error finding retired instruction count
On Wed, 24 Jun 2009, Ingo Molnar wrote:
> * Vince Weaver <vince@deater.net> wrote:
>
> Those ~2100 instructions are executed by your app: as the ELF
> dynamic loader starts up your test-app.
>
> If you have some tool that reports less than that then that tool is
> not being truthful about the true overhead of your application.

Wait a second... my application is a statically linked binary. There is
no ELF dynamic loader involved at all.

On further investigation, all of the overhead comes _entirely_ from the
perf utility. This is overhead and instructions that would not occur when
not using the perf utility.

From the best I can tell digging through the perf sources, the performance
counters are set up and started in userspace, but instead of doing an
immediate clone/exec, thousands of instructions worth of other stuff is
done by perf in between.

Ther "perfmon" util, plus linux-user simulators like qemu and valgrind do
things properly. perf can't it seems, and it seems to be a limitation of
the new performance counter infrastructure.


Vince

PS. Why is the perf code littered with many many __MINGW32__ defined?
Should this be in the kernel tree? It makes the code really hard
to follow. Are there plans to port perf to windows?




\
 
 \ /
  Last update: 2009-06-26 20:15    [W:0.123 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site