---------- Forwarded message ----------
From: stephane eranian <eran...@googlemail.com>
Date: Mon, Dec 15, 2008 at 11:03 PM
Subject: Re: [patch] Performance Counters for Linux, v4
To: Paul Mackerras <pau...@samba.org>
Cc: Vince Weaver <vi...@deater.net>, Ingo Molnar <mi...@elte.hu>,
linux-ker...@vger.kernel.org, Thomas Gleixner <t...@linutronix.de>,
Andrew Morton <a...@linux-foundation.org>, Eric Dumazet
<da...@cosmosbay.com>, Robert Richter <robert.rich...@amd.com>, Arjan
van de Ven <ar...@infradead.org>, Peter Anvin <h...@zytor.com>, Peter
Zijlstra <a.p.zijls...@chello.nl>, "David S. Miller"
<da...@davemloft.net>, perfctr-de...@lists.sourceforge.net


On Mon, Dec 15, 2008 at 10:42 PM, Paul Mackerras <pau...@samba.org> wrote:
> Vince Weaver writes:
>
>> I see a large (2300 instruction) fixed overhead when measuring
>> retired instruction count using the "timec" command
>> compared to the "pfmon" tool that comes with perfmon3
>> (the pfmon tool has essentially no overhead when
>> doing aggragate counts).
>
> Looks like timec will be counting the fork() and execvp() system calls
> that are used to run your executable, as well as the executable
> itself.  The fork() overhead could be removed fairly easily I think,
> the execvp would be hard to get rid of without using ptrace() - and
> the use of ptrace was one of the things that Ingo et al. objected to
> in perfmon3.
>
Paul, I think your analysis is correct. This is likely what is happening.

Not that timec could not use ptrace() to block the task from executing
its first instruction, but you'd still have a problem because of prctl(ENABLE)
which applies to the current task, not another task, unless I am mistaken.

Prctl() looks odd to me because you have all those supposedly independent
file descriptors to identify events you want to measure, but they are not
used to start/stop. If you are attaching to multiple tasks at the same time
which you can do with the current API,  you may not necessarily want to
start/stop all counters at the same time.

Looks like prctl() is not what we want after all...

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to