Re: [PATCH 1/6] perf-events: Add support for supplementary eventregisters v5
From: Stephane Eranian
Date: Tue Feb 22 2011 - 20:12:32 EST
Lin,
So I tested this patch on my NHM system and it has a major event scheduling
issue. It does not ensure mutual exclusion with two offcore response events
have different extra_config values. This is demonstrated with libpfm4:
$ task -e offcore_response_0:DMND_DATA_RD:LOCAL_DRAM -e
offcore_response_0:DMND_RFO:LOCAL_DRAM noploop 1
PERF[type=4 val=0x5001b7 e_u=0 e_k=0 e_hv=1 period=0 freq=0 precise=0
event_xtra=4001] offcore_response_0:DMND_DATA_RD:LOCAL_DRAM
PERF[type=4 val=0x5001b7 e_u=0 e_k=0 e_hv=1 period=0 freq=0 precise=0
event_xtra=4003] offcore_response_0:DMND_RFO:LOCAL_DRAM
noploop for 1 seconds
283,537 offcore_response_0:DMND_DATA_RD:LOCAL_DRAM
(99.99% scaling, ena=995,676,390, run=119,395)
763,110 offcore_response_0:DMND_RFO:LOCAL_DRAM (99.90%
scaling, ena=996,675,054, run=991,306)
Scaling should be 50% for 1st event, and 50% for the second. Both events are
in separate event groups here.
I tracked this down to a mismatch between intel_percore_constraints()
and the generic layer incremental scheduling approach.
The reason exclusion is not enforced is that in this case the era->ref = 2
when it should not. The reason is pretty tricky.
The scheduling algorithm schedules event groups. I illustrate this without
the offcore response event, but just regular events:
$ task -e llc_misses -e uops_retired date noploop 1
// first group
[ 397.477498] CPU0 commit_txn
[ 397.477600] CPU0 get cpuc=ffff88007fc0b600 used=0
per=ffff88007f80f780 cfg=13412e xtra=0
[ 397.477672] CPU0 commit_txn ret=0
// first group + second group
[ 397.477703] CPU0 commit_txn
[ 397.477804] CPU0 get cpuc=ffff88007fc0b600 used=0
per=ffff88007f80f780 cfg=13412e xtra=0
[ 397.477877] CPU0 get cpuc=ffff88007fc0b600 used=0
per=ffff88007f80f780 cfg=1301c2 xtra=0
[ 397.477949] CPU0 commit_txn ret=0
Two groups = two calls to group_sched_in() = 2 calls to commit_txn() =
2 calls to x86_schedule_events()
= 2 calls to intel_percore_constraints().
In the second call, the first event is resubmitted because this is
incremental. The scheduler needs to revisit
the entire assignment. Thus, you have an imbalance of
get_constraints() vs. put_constraints() in the end
and it's game over.
One may wonder how come AMD NB events don't suffer from the same
problem, after all there is some shared
state. I think the reason is that we track down the owner, i.e., the
event which allocated the resource first. If we
come twice with the same event, we don't do the allocation again.
I think the problem here is slightly different, though, because you
want to allow other events with the identical
extra_config value. Given this is shared between HT threads, you don't
want to release the resource and reallocate
again because you may lose access. Maybe a solution would be to tag
events as percore allocated, and skip
those the second time around. There cannot be a ref++ on an event that
has already done ref++ once and without
callin put_constraint() in between.
Anyway, there is a scheduling problem and it needs some more thinking.....
On Sun, Feb 20, 2011 at 5:56 PM, Lin Ming <ming.m.lin@xxxxxxxxx> wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Intel Nehalem/Westmere have a special OFFCORE_RESPONSE event
> that can be used to monitor any offcore accesses from a core.
> This is a very useful event for various tunings, and it's
> also needed to implement the generic LLC-* events correctly.
>
> Unfortunately this event requires programming a mask in a separate
> register. And worse this separate register is per core, not per
> CPU thread.
>
> This patch adds:
> - Teaches perf_events that OFFCORE_RESPONSE needs extra parameters.
> The extra parameters are passed by user space in the
> perf_event_attr::event_extra field.
> - Add support to the Intel perf_event core to schedule per
> core resources. This adds fairly generic infrastructure that
> can be also used for other per core resources.
> The basic code has is patterned after the similar AMD northbridge
> constraints code.
>
> Thanks to Stephane Eranian who pointed out some problems
> in the original version and suggested improvements.
>
> Cc: eranian@xxxxxxxxxx
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
> ---
> Âarch/x86/kernel/cpu/perf_event.c    |  64 ++++++++++
> Âarch/x86/kernel/cpu/perf_event_intel.c | Â198 ++++++++++++++++++++++++++++++++
> Âinclude/linux/perf_event.h       |  Â7 +-
> Â3 files changed, 268 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> index 10bfe24..de8e0bd 100644
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -93,6 +93,8 @@ struct amd_nb {
> Â Â Â Âstruct event_constraint event_constraints[X86_PMC_IDX_MAX];
> Â};
>
> +struct intel_percore;
> +
> Â#define MAX_LBR_ENTRIES Â Â Â Â Â Â Â Â16
>
> Âstruct cpu_hw_events {
> @@ -128,6 +130,13 @@ struct cpu_hw_events {
>    Âstruct perf_branch_entry    Âlbr_entries[MAX_LBR_ENTRIES];
>
> Â Â Â Â/*
> + Â Â Â Â* Intel percore register state.
> + Â Â Â Â* Coordinate shared resources between HT threads.
> + Â Â Â Â*/
> +    int               percore_used; /* Used by this CPU? */
> +    struct intel_percore      Â*per_core;
> +
> + Â Â Â /*
> Â Â Â Â * AMD specific bits
> Â Â Â Â */
>    Âstruct amd_nb      *amd_nb;
> @@ -175,6 +184,28 @@ struct cpu_hw_events {
> Â#define for_each_event_constraint(e, c) Â Â Â Â\
> Â Â Â Âfor ((e) = (c); (e)->weight; (e)++)
>
> +/*
> + * Extra registers for specific events.
> + * Some events need large masks and require external MSRs.
> + * Define a mapping to these extra registers.
> + */
> +struct extra_reg {
> +    unsigned int      Âevent;
> +    unsigned int      Âmsr;
> + Â Â Â u64 Â Â Â Â Â Â Â Â Â Â config_mask;
> + Â Â Â u64 Â Â Â Â Â Â Â Â Â Â valid_mask;
> +};
> +
> +#define EVENT_EXTRA_REG(e, ms, m, vm) { Â Â Â Â\
> + Â Â Â .event = (e), Â Â Â Â Â \
> + Â Â Â .msr = (ms), Â Â Â Â Â Â\
> + Â Â Â .config_mask = (m), Â Â \
> + Â Â Â .valid_mask = (vm), Â Â \
> + Â Â Â }
> +#define INTEL_EVENT_EXTRA_REG(event, msr, vm) Â\
> + Â Â Â EVENT_EXTRA_REG(event, msr, ARCH_PERFMON_EVENTSEL_EVENT, vm)
> +#define EVENT_EXTRA_END EVENT_EXTRA_REG(0, 0, 0, 0)
> +
> Âunion perf_capabilities {
> Â Â Â Âstruct {
>        Âu64   lbr_format  Â: 6;
> @@ -219,6 +250,7 @@ struct x86_pmu {
>    Âvoid      Â(*put_event_constraints)(struct cpu_hw_events *cpuc,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct perf_event *event);
> Â Â Â Âstruct event_constraint *event_constraints;
> + Â Â Â struct event_constraint *percore_constraints;
>    Âvoid      Â(*quirks)(void);
>    Âint       perfctr_second_write;
>
> @@ -247,6 +279,11 @@ struct x86_pmu {
> Â Â Â Â */
>    Âunsigned long  lbr_tos, lbr_from, lbr_to; /* MSR base regs    */
>    Âint       lbr_nr;          Â/* hardware stack size */
> +
> + Â Â Â /*
> + Â Â Â Â* Extra registers for events
> + Â Â Â Â*/
> + Â Â Â struct extra_reg *extra_regs;
> Â};
>
> Âstatic struct x86_pmu x86_pmu __read_mostly;
> @@ -339,6 +376,31 @@ static inline unsigned int x86_pmu_event_addr(int index)
> Â Â Â Âreturn x86_pmu.perfctr + x86_pmu_addr_offset(index);
> Â}
>
> +/*
> + * Find and validate any extra registers to set up.
> + */
> +static int x86_pmu_extra_regs(u64 config, struct perf_event *event)
> +{
> + Â Â Â struct extra_reg *er;
> +
> + Â Â Â event->hw.extra_reg = 0;
> + Â Â Â event->hw.extra_config = 0;
> +
> + Â Â Â if (!x86_pmu.extra_regs)
> + Â Â Â Â Â Â Â return 0;
> +
> + Â Â Â for (er = x86_pmu.extra_regs; er->msr; er++) {
> + Â Â Â Â Â Â Â if (er->event != (config & er->config_mask))
> + Â Â Â Â Â Â Â Â Â Â Â continue;
> + Â Â Â Â Â Â Â if (event->attr.event_extra & ~er->valid_mask)
> + Â Â Â Â Â Â Â Â Â Â Â return -EINVAL;
> + Â Â Â Â Â Â Â event->hw.extra_reg = er->msr;
> + Â Â Â Â Â Â Â event->hw.extra_config = event->attr.event_extra;
> + Â Â Â Â Â Â Â break;
> + Â Â Â }
> + Â Â Â return 0;
> +}
> +
> Âstatic atomic_t active_events;
> Âstatic DEFINE_MUTEX(pmc_reserve_mutex);
>
> @@ -663,6 +725,8 @@ static void x86_pmu_disable(struct pmu *pmu)
> Âstatic inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âu64 enable_mask)
> Â{
> + Â Â Â if (hwc->extra_reg)
> + Â Â Â Â Â Â Â wrmsrl(hwc->extra_reg, hwc->extra_config);
> Â Â Â Âwrmsrl(hwc->config_base, hwc->config | enable_mask);
> Â}
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
> index 084b383..cc49201 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
> @@ -1,5 +1,27 @@
> Â#ifdef CONFIG_CPU_SUP_INTEL
>
> +#define MAX_EXTRA_REGS 2
> +
> +/*
> + * Per register state.
> + */
> +struct er_account {
> +    int           ref;      Â/* reference count */
> +    unsigned int      Âextra_reg;   Â/* extra MSR number */
> + Â Â Â u64 Â Â Â Â Â Â Â Â Â Â extra_config; Â /* extra MSR config */
> +};
> +
> +/*
> + * Per core state
> + * This used to coordinate shared registers for HT threads.
> + */
> +struct intel_percore {
> +    raw_spinlock_t     Âlock;      /* protect structure */
> +    struct er_account    regs[MAX_EXTRA_REGS];
> +    int           refcnt;     /* number of threads */
> +    unsigned        Âcore_id;
> +};
> +
> Â/*
> Â* Intel PerfMon, used on Core and later.
> Â*/
> @@ -64,6 +86,18 @@ static struct event_constraint intel_nehalem_event_constraints[] =
> Â Â Â ÂEVENT_CONSTRAINT_END
> Â};
>
> +static struct extra_reg intel_nehalem_extra_regs[] =
> +{
> + Â Â Â INTEL_EVENT_EXTRA_REG(0xb7, 0x1a6, 0xffff), /* OFFCORE_RESPONSE_0 */
> + Â Â Â EVENT_EXTRA_END
> +};
> +
> +static struct event_constraint intel_nehalem_percore_constraints[] =
> +{
> + Â Â Â INTEL_EVENT_CONSTRAINT(0xb7, 0),
> + Â Â Â EVENT_CONSTRAINT_END
> +};
> +
> Âstatic struct event_constraint intel_westmere_event_constraints[] =
> Â{
> Â Â Â ÂFIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
> @@ -76,6 +110,20 @@ static struct event_constraint intel_westmere_event_constraints[] =
> Â Â Â ÂEVENT_CONSTRAINT_END
> Â};
>
> +static struct extra_reg intel_westmere_extra_regs[] =
> +{
> + Â Â Â INTEL_EVENT_EXTRA_REG(0xb7, 0x1a6, 0xffff), /* OFFCORE_RESPONSE_0 */
> + Â Â Â INTEL_EVENT_EXTRA_REG(0xbb, 0x1a7, 0xffff), /* OFFCORE_RESPONSE_1 */
> + Â Â Â EVENT_EXTRA_END
> +};
> +
> +static struct event_constraint intel_westmere_percore_constraints[] =
> +{
> + Â Â Â INTEL_EVENT_CONSTRAINT(0xb7, 0),
> + Â Â Â INTEL_EVENT_CONSTRAINT(0xbb, 0),
> + Â Â Â EVENT_CONSTRAINT_END
> +};
> +
> Âstatic struct event_constraint intel_gen_event_constraints[] =
> Â{
> Â Â Â ÂFIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
> @@ -794,6 +842,66 @@ intel_bts_constraints(struct perf_event *event)
> Â}
>
> Âstatic struct event_constraint *
> +intel_percore_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
> +{
> + Â Â Â struct hw_perf_event *hwc = &event->hw;
> + Â Â Â unsigned int e = hwc->config & ARCH_PERFMON_EVENTSEL_EVENT;
> + Â Â Â struct event_constraint *c;
> + Â Â Â struct intel_percore *pc;
> + Â Â Â struct er_account *era;
> + Â Â Â int i;
> + Â Â Â int free_slot;
> + Â Â Â int found;
> +
> + Â Â Â if (!x86_pmu.percore_constraints)
> + Â Â Â Â Â Â Â return NULL;
> +
> + Â Â Â for (c = x86_pmu.percore_constraints; c->cmask; c++) {
> + Â Â Â Â Â Â Â if (e != c->code)
> + Â Â Â Â Â Â Â Â Â Â Â continue;
> +
> + Â Â Â Â Â Â Â /*
> + Â Â Â Â Â Â Â Â* Allocate resource per core.
> + Â Â Â Â Â Â Â Â*/
> + Â Â Â Â Â Â Â c = NULL;
> + Â Â Â Â Â Â Â pc = cpuc->per_core;
> + Â Â Â Â Â Â Â if (!pc)
> + Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â c = &emptyconstraint;
> + Â Â Â Â Â Â Â raw_spin_lock(&pc->lock);
> + Â Â Â Â Â Â Â free_slot = -1;
> + Â Â Â Â Â Â Â found = 0;
> + Â Â Â Â Â Â Â for (i = 0; i < MAX_EXTRA_REGS; i++) {
> + Â Â Â Â Â Â Â Â Â Â Â era = &pc->regs[i];
> + Â Â Â Â Â Â Â Â Â Â Â if (era->ref > 0 && hwc->extra_reg == era->extra_reg) {
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* Allow sharing same config */
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (hwc->extra_config == era->extra_config) {
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â era->ref++;
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â cpuc->percore_used = 1;
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â c = NULL;
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* else conflict */
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â found = 1;
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â Â Â Â Â } else if (era->ref == 0 && free_slot == -1)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â free_slot = i;
> + Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â if (!found && free_slot != -1) {
> + Â Â Â Â Â Â Â Â Â Â Â era = &pc->regs[free_slot];
> + Â Â Â Â Â Â Â Â Â Â Â era->ref = 1;
> + Â Â Â Â Â Â Â Â Â Â Â era->extra_reg = hwc->extra_reg;
> + Â Â Â Â Â Â Â Â Â Â Â era->extra_config = hwc->extra_config;
> + Â Â Â Â Â Â Â Â Â Â Â cpuc->percore_used = 1;
> + Â Â Â Â Â Â Â Â Â Â Â c = NULL;
> + Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â raw_spin_unlock(&pc->lock);
> + Â Â Â Â Â Â Â return c;
> + Â Â Â }
> +
> + Â Â Â return NULL;
> +}
> +
> +static struct event_constraint *
> Âintel_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
> Â{
> Â Â Â Âstruct event_constraint *c;
> @@ -806,9 +914,50 @@ intel_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event
> Â Â Â Âif (c)
> Â Â Â Â Â Â Â Âreturn c;
>
> + Â Â Â c = intel_percore_constraints(cpuc, event);
> + Â Â Â if (c)
> + Â Â Â Â Â Â Â return c;
> +
> Â Â Â Âreturn x86_get_event_constraints(cpuc, event);
> Â}
>
> +static void intel_put_event_constraints(struct cpu_hw_events *cpuc,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct perf_event *event)
> +{
> + Â Â Â struct extra_reg *er;
> + Â Â Â struct intel_percore *pc;
> + Â Â Â struct er_account *era;
> + Â Â Â struct hw_perf_event *hwc = &event->hw;
> + Â Â Â int i, allref;
> +
> + Â Â Â if (!cpuc->percore_used)
> + Â Â Â Â Â Â Â return;
> +
> + Â Â Â for (er = x86_pmu.extra_regs; er->msr; er++) {
> + Â Â Â Â Â Â Â if (er->event != (hwc->config & er->config_mask))
> + Â Â Â Â Â Â Â Â Â Â Â continue;
> +
> + Â Â Â Â Â Â Â pc = cpuc->per_core;
> + Â Â Â Â Â Â Â raw_spin_lock(&pc->lock);
> + Â Â Â Â Â Â Â for (i = 0; i < MAX_EXTRA_REGS; i++) {
> + Â Â Â Â Â Â Â Â Â Â Â era = &pc->regs[i];
> + Â Â Â Â Â Â Â Â Â Â Â if (era->ref > 0 &&
> + Â Â Â Â Â Â Â Â Â Â Â Â Â era->extra_config == hwc->extra_config &&
> + Â Â Â Â Â Â Â Â Â Â Â Â Â era->extra_reg == er->msr) {
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â era->ref--;
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â allref = 0;
> + Â Â Â Â Â Â Â for (i = 0; i < MAX_EXTRA_REGS; i++)
> + Â Â Â Â Â Â Â Â Â Â Â allref += pc->regs[i].ref;
> + Â Â Â Â Â Â Â if (allref == 0)
> + Â Â Â Â Â Â Â Â Â Â Â cpuc->percore_used = 0;
> + Â Â Â Â Â Â Â raw_spin_unlock(&pc->lock);
> + Â Â Â Â Â Â Â break;
> + Â Â Â }
> +}
> +
> Âstatic int intel_pmu_hw_config(struct perf_event *event)
> Â{
> Â Â Â Âint ret = x86_pmu_hw_config(event);
> @@ -880,11 +1029,43 @@ static __initconst const struct x86_pmu core_pmu = {
> Â Â Â Â */
>    Â.max_period       = (1ULL << 31) - 1,
> Â Â Â Â.get_event_constraints Â= intel_get_event_constraints,
> + Â Â Â .put_event_constraints Â= intel_put_event_constraints,
>    Â.event_constraints   Â= intel_core_event_constraints,
> Â};
>
> +static int intel_pmu_cpu_prepare(int cpu)
> +{
> + Â Â Â struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
> +
> + Â Â Â cpuc->per_core = kzalloc_node(sizeof(struct intel_percore),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â GFP_KERNEL, cpu_to_node(cpu));
> + Â Â Â if (!cpuc->per_core)
> + Â Â Â Â Â Â Â return NOTIFY_BAD;
> +
> + Â Â Â raw_spin_lock_init(&cpuc->per_core->lock);
> + Â Â Â cpuc->per_core->core_id = -1;
> + Â Â Â return NOTIFY_OK;
> +}
> +
> Âstatic void intel_pmu_cpu_starting(int cpu)
> Â{
> + Â Â Â struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
> + Â Â Â int core_id = topology_core_id(cpu);
> + Â Â Â int i;
> +
> + Â Â Â for_each_online_cpu(i) {
> + Â Â Â Â Â Â Â struct intel_percore *pc = per_cpu(cpu_hw_events, i).per_core;
> +
> + Â Â Â Â Â Â Â if (pc && pc->core_id == core_id) {
> + Â Â Â Â Â Â Â Â Â Â Â kfree(cpuc->per_core);
> + Â Â Â Â Â Â Â Â Â Â Â cpuc->per_core = pc;
> + Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â }
> + Â Â Â }
> +
> + Â Â Â cpuc->per_core->core_id = core_id;
> + Â Â Â cpuc->per_core->refcnt++;
> +
> Â Â Â Âinit_debug_store_on_cpu(cpu);
> Â Â Â Â/*
> Â Â Â Â * Deal with CPUs that don't clear their LBRs on power-up.
> @@ -894,6 +1075,15 @@ static void intel_pmu_cpu_starting(int cpu)
>
> Âstatic void intel_pmu_cpu_dying(int cpu)
> Â{
> + Â Â Â struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
> + Â Â Â struct intel_percore *pc = cpuc->per_core;
> +
> + Â Â Â if (pc) {
> + Â Â Â Â Â Â Â if (pc->core_id == -1 || --pc->refcnt == 0)
> + Â Â Â Â Â Â Â Â Â Â Â kfree(pc);
> + Â Â Â Â Â Â Â cpuc->per_core = NULL;
> + Â Â Â }
> +
> Â Â Â Âfini_debug_store_on_cpu(cpu);
> Â}
>
> @@ -918,7 +1108,9 @@ static __initconst const struct x86_pmu intel_pmu = {
> Â Â Â Â */
>    Â.max_period       = (1ULL << 31) - 1,
> Â Â Â Â.get_event_constraints Â= intel_get_event_constraints,
> + Â Â Â .put_event_constraints Â= intel_put_event_constraints,
>
> +    .cpu_prepare      Â= intel_pmu_cpu_prepare,
>    Â.cpu_starting      = intel_pmu_cpu_starting,
>    Â.cpu_dying       Â= intel_pmu_cpu_dying,
> Â};
> @@ -1036,7 +1228,10 @@ static __init int intel_pmu_init(void)
> Â Â Â Â Â Â Â Âintel_pmu_lbr_init_nhm();
>
> Â Â Â Â Â Â Â Âx86_pmu.event_constraints = intel_nehalem_event_constraints;
> + Â Â Â Â Â Â Â x86_pmu.percore_constraints =
> + Â Â Â Â Â Â Â Â Â Â Â intel_nehalem_percore_constraints;
> Â Â Â Â Â Â Â Âx86_pmu.enable_all = intel_pmu_nhm_enable_all;
> + Â Â Â Â Â Â Â x86_pmu.extra_regs = intel_nehalem_extra_regs;
> Â Â Â Â Â Â Â Âpr_cont("Nehalem events, ");
> Â Â Â Â Â Â Â Âbreak;
>
> @@ -1058,7 +1253,10 @@ static __init int intel_pmu_init(void)
> Â Â Â Â Â Â Â Âintel_pmu_lbr_init_nhm();
>
> Â Â Â Â Â Â Â Âx86_pmu.event_constraints = intel_westmere_event_constraints;
> + Â Â Â Â Â Â Â x86_pmu.percore_constraints =
> + Â Â Â Â Â Â Â Â Â Â Â intel_westmere_percore_constraints;
> Â Â Â Â Â Â Â Âx86_pmu.enable_all = intel_pmu_nhm_enable_all;
> + Â Â Â Â Â Â Â x86_pmu.extra_regs = intel_westmere_extra_regs;
> Â Â Â Â Â Â Â Âpr_cont("Westmere events, ");
> Â Â Â Â Â Â Â Âbreak;
>
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 8ceb5a6..f531ce3 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -225,7 +225,10 @@ struct perf_event_attr {
> Â Â Â Â};
>
> Â Â Â Â__u32 Â Â Â Â Â Â Â Â Â bp_type;
> - Â Â Â __u64 Â Â Â Â Â Â Â Â Â bp_addr;
> + Â Â Â union {
> + Â Â Â Â Â Â Â __u64 Â Â Â Â Â bp_addr;
> + Â Â Â Â Â Â Â __u64 Â Â Â Â Â event_extra; /* Extra for some events */
> + Â Â Â };
> Â Â Â Â__u64 Â Â Â Â Â Â Â Â Â bp_len;
> Â};
>
> @@ -541,6 +544,8 @@ struct hw_perf_event {
>            Âunsigned long  event_base;
>            Âint       idx;
>            Âint       last_cpu;
> +            unsigned int  Âextra_reg;
> + Â Â Â Â Â Â Â Â Â Â Â u64 Â Â Â Â Â Â extra_config;
> Â Â Â Â Â Â Â Â};
> Â Â Â Â Â Â Â Âstruct { /* software */
> Â Â Â Â Â Â Â Â Â Â Â Âstruct hrtimer Âhrtimer;
> --
> 1.7.3
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/