[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa79d98a1003102012i6709e5c5vf2be45dbab2ded2@mail.gmail.com>
Date: Thu, 11 Mar 2010 07:12:52 +0300
From: Cyrill Gorcunov <gorcunov@...nvz.org>
To: Lin Ming <ming.m.lin@...el.com>
Cc: Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Stephane Eranian <eranian@...gle.com>,
Robert Richter <robert.richter@....com>,
Frederic Weisbecker <fweisbec@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] x86,perf: Implement minimal P4 PMU driver v14
On 3/11/10, Lin Ming <ming.m.lin@...el.com> wrote:
> On Thu, 2010-03-11 at 02:31 +0800, Cyrill Gorcunov wrote:
>> +static __initconst struct x86_pmu p4_pmu = {
>> + .name = "Netburst P4/Xeon",
>> + .handle_irq = p4_pmu_handle_irq,
>> + .disable_all = p4_pmu_disable_all,
>> + .enable_all = p4_pmu_enable_all,
>> + .enable = p4_pmu_enable_event,
>> + .disable = p4_pmu_disable_event,
>> + .eventsel = MSR_P4_BPU_CCCR0,
>> + .perfctr = MSR_P4_BPU_PERFCTR0,
>> + .event_map = p4_pmu_event_map,
>> + .raw_event = p4_pmu_raw_event,
>> + .max_events = ARRAY_SIZE(p4_event_map),
>> + /*
>> + * IF HT disabled we may need to use all
>> + * ARCH_P4_MAX_CCCR counters simulaneously
>> + * though leave it restricted at moment assuming
>> + * HT is on
>> + */
>> + .num_events = ARCH_P4_MAX_CCCR,
>> + .apic = 1,
>> + .event_bits = 40,
>> + .event_mask = (1ULL << 40) - 1,
>> + .max_period = (1ULL << 39) - 1,
>> + .hw_config = p4_hw_config,
>> + .schedule_events = p4_pmu_schedule_events,
>> +};
>
> commit ca03770(perf, x86: Add PEBS infrastructure) introduces a new
> function validate_event that calls x86_pmu.get_event_constraints.
>
> static int validate_event(struct perf_event *event)
> {
> ...
> c = x86_pmu.get_event_constraints(fake_cpuc, event);
> ...
> }
>
> So we need to add .get_event_constraints to p4_pmu.
>
> diff --git a/arch/x86/kernel/cpu/perf_event_p4.c
> b/arch/x86/kernel/cpu/perf_event_p4.c
> index 4eb79b1..99a2a7c 100644
> --- a/arch/x86/kernel/cpu/perf_event_p4.c
> +++ b/arch/x86/kernel/cpu/perf_event_p4.c
> @@ -586,6 +586,7 @@ static __initconst struct x86_pmu p4_pmu = {
> .max_period = (1ULL << 39) - 1,
> .hw_config = p4_hw_config,
> .schedule_events = p4_pmu_schedule_events,
> + .get_event_constraints = x86_get_event_constraints,
> };
>
> static __init int p4_pmu_init(void)
>
> ---
> Lin Ming
>
>
>
Thanks, Ming! This snippet somehow escaped me. Will update.
--
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