lkml.org 
[lkml]   [2011]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] perf, x86: Add support for AMD family 15h core counters
From
Date
On Wed, 2011-02-02 at 17:41 +0100, Robert Richter wrote:
> + unsigned int eventsel;
> + unsigned int perfctr;
> + unsigned int *eventsel_map;
> + unsigned int *perfctr_map;
> u64 (*event_map)(int);
> int max_events;
> int num_counters;
> @@ -323,11 +325,17 @@ again:
>
> static inline unsigned int x86_pmu_config_addr(int index)
> {
> + if (x86_pmu.eventsel_map)
> + return x86_pmu.eventsel_map[index];
> +
> return x86_pmu.eventsel + index;
> }
>
> static inline unsigned int x86_pmu_event_addr(int index)
> {
> + if (x86_pmu.perfctr_map)
> + return x86_pmu.perfctr_map[index];
> +
> return x86_pmu.perfctr + index;
> }

Why this and not something like x86_pmu.perfctr + (index << 1)?
You could even use alternatives.





\
 
 \ /
  Last update: 2011-02-02 18:05    [W:0.102 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site