[lkml]   [2009]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [patch] x86, perf_counter, bts: add bts to perf_counter
On Fri, 2009-08-07 at 08:29 +0100, Metzger, Markus T wrote:

> I incorporated Peter's review comments, except that I would not enforce sample_period == 1
> when branch tracing is requested. There might be users who want to sample the IP every 100.000'th
> branch for profiling reasons.

But in case you don't set sample_period==1 then you won't be able to
match the BTS counter:

+ if (unlikely((event ==
+ x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) &&
+ (hwc->sample_period == 1)))
+ return X86_PMC_IDX_FIXED_BTS;


+ /*
+ * Try to use BTS for branch tracing. If that is not
+ * available, try to get a generic counter.
+ */
+ if (unlikely(!cpuc->ds))
+ goto try_generic;

How will be use a generic counter for BTS, will it generate an NMI for
every encountered branch? That might very will hit the throttle as that
might be many.

Would it not be better to force sample_period==1 usage onto the BTS and
simply fail if its not available?

 \ /
  Last update: 2009-08-07 10:23    [W:0.095 / U:31.800 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site