diff options
author | Stephane Eranian <eranian@google.com> | 2011-06-06 10:57:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-07-01 05:06:36 -0400 |
commit | efc9f05df2dd171280dcb736a4d973ffefd5508e (patch) | |
tree | ccc1cee8f1cc0ad5391732eb3637b685b4b155a0 /include | |
parent | a7ac67ea021b4603095d2aa458bc41641238f22c (diff) |
perf_events: Update Intel extra regs shared constraints management
This patch improves the code managing the extra shared registers
used for offcore_response events on Intel Nehalem/Westmere. The
idea is to use static allocation instead of dynamic allocation.
This simplifies greatly the get and put constraint routines for
those events.
The patch also renames per_core to shared_regs because the same
data structure gets used whether or not HT is on. When HT is
off, those events still need to coordination because they use
a extra MSR that has to be shared within an event group.
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110606145703.GA7258@quad
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_event.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 771b0b2845e4..069315eefb22 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -536,6 +536,16 @@ struct perf_branch_stack { | |||
536 | 536 | ||
537 | struct task_struct; | 537 | struct task_struct; |
538 | 538 | ||
539 | /* | ||
540 | * extra PMU register associated with an event | ||
541 | */ | ||
542 | struct hw_perf_event_extra { | ||
543 | u64 config; /* register value */ | ||
544 | unsigned int reg; /* register address or index */ | ||
545 | int alloc; /* extra register already allocated */ | ||
546 | int idx; /* index in shared_regs->regs[] */ | ||
547 | }; | ||
548 | |||
539 | /** | 549 | /** |
540 | * struct hw_perf_event - performance event hardware details: | 550 | * struct hw_perf_event - performance event hardware details: |
541 | */ | 551 | */ |
@@ -549,9 +559,7 @@ struct hw_perf_event { | |||
549 | unsigned long event_base; | 559 | unsigned long event_base; |
550 | int idx; | 560 | int idx; |
551 | int last_cpu; | 561 | int last_cpu; |
552 | unsigned int extra_reg; | 562 | struct hw_perf_event_extra extra_reg; |
553 | u64 extra_config; | ||
554 | int extra_alloc; | ||
555 | }; | 563 | }; |
556 | struct { /* software */ | 564 | struct { /* software */ |
557 | struct hrtimer hrtimer; | 565 | struct hrtimer hrtimer; |