[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 02 Feb 2011 18:03:18 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Robert Richter <robert.richter@....com>
Cc: Ingo Molnar <mingo@...e.hu>, Stephane Eranian <eranian@...gle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/5] perf, x86: Add support for AMD family 15h core
counters
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists