lkml.org 
[lkml]   [2011]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: perf, x86: Provide a PEBS capable cycle event
From
On Wed, Jan 26, 2011 at 12:37 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
>
>> Gitweb:     http://git.kernel.org/linus/7639dae0ca11038286bbbcda05f2bef601c1eb8d
>> Commit:     7639dae0ca11038286bbbcda05f2bef601c1eb8d
>> Parent:     abe43400579d5de0078c2d3a760e6598e183f871
>> Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
>> AuthorDate: Tue Dec 14 21:26:40 2010 +0100
>> Committer:  Ingo Molnar <mingo@elte.hu>
>> CommitDate: Thu Dec 16 11:36:44 2010 +0100
>>
>>     perf, x86: Provide a PEBS capable cycle event
>>
>>     Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>>     LKML-Reference: <new-submission>
>>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
>> ---
>>  arch/x86/kernel/cpu/perf_event_intel.c |   26 ++++++++++++++++++++++++++
>>  1 files changed, 26 insertions(+), 0 deletions(-)
>
> btw., precise profiling via PEBS:
>
>  perf record -e cycles:p ...
>
> works pretty nicely now on Nehalem CPUs and later.
>
The problem is that cycles:p is not equivalent to cycles in terms of how
cycles are counted. cycles counts only unhalted cycles. cycles:p counts
ALL cycles, event when the CPU is in halted state.

Thus, in per-thread mode, I believe you, it works.

In system-wide, it all depends on how the kernel is configured w.r.t. to idle
and what your workload does. If you know you're never going idle on any
of the monitored CPUs during the measurement, then you're fine.

Otherwise, you have a distortion. You can get samples from halted CPUs,
likely pointing to the idle routine.

If your system uses idle=poll, then you are okay. Otherwise, the problem
mentioned above applies.


> Could we perhaps make perf record and perf top default to cycles:p on x86, and
> silently fall back to regular cycles events if the CPU does not support this event
> type?
>
> That would make our profiles more precise by default - without users having to do
> anything funky.
>
> Thanks,
>
>        Ingo
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-26 13:03    [W:0.054 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site