mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	Robert Richter <robert.richter@amd.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] x86,perf: Implement minimal P4 PMU driver v14
Date: Thu, 11 Mar 2010 10:32:55 +0800	[thread overview]
Message-ID: <1268274775.4996.16.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <20100310183102.GC8070@lenovo>

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



  parent reply	other threads:[~2010-03-11  2:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 18:31 Cyrill Gorcunov
2010-03-10 19:29 ` Robert Richter
2010-03-10 19:43   ` Cyrill Gorcunov
2010-03-11  2:32 ` Lin Ming [this message]
2010-03-11  4:12   ` Cyrill Gorcunov
2010-03-11 16:54   ` Cyrill Gorcunov
2010-03-11 18:16     ` Ingo Molnar
2010-03-11 18:29       ` Cyrill Gorcunov
2010-03-11 18:39       ` Ingo Molnar
2010-03-11 21:15         ` Cyrill Gorcunov
2010-03-11 21:24           ` Peter Zijlstra
2010-03-11 21:31             ` Cyrill Gorcunov
2010-03-11 21:38               ` Peter Zijlstra
2010-03-11 21:41                 ` Cyrill Gorcunov
2010-03-11 21:50                 ` Cyrill Gorcunov
2010-03-12  9:54                   ` [tip:perf/x86] x86, perf: Fix NULL deref on not assigned x86_pmu tip-bot for Cyrill Gorcunov
2010-03-11 18:33     ` [tip:perf/x86] perf, x86: Implement initial P4 PMU driver tip-bot for Cyrill Gorcunov
2010-03-16 16:07       ` Robert Richter
2010-03-16 16:23         ` Cyrill Gorcunov
2010-03-17  1:05           ` Lin Ming
2010-03-17  9:48         ` [tip:perf/core] perf, x86: Report error code that returned from x86_pmu.hw_config() tip-bot for Robert Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268274775.4996.16.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=gorcunov@openvz.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome