aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2010-02-08 10:17:01 -0500
committerIngo Molnar <mingo@elte.hu>2010-02-26 04:56:53 -0500
commit38331f62c20456454eed9ebea2525f072c6f1d2e (patch)
treea285f82e0f8a9c62305f8499f966a5ec5ae3671d /kernel/perf_event.c
parentd76a0812ac4139ceb54daab3cc70e1bd8bd9d43a (diff)
perf_events, x86: AMD event scheduling
This patch adds correct AMD NorthBridge event scheduling. NB events are events measuring L3 cache, Hypertransport traffic. They are identified by an event code >= 0xe0. They measure events on the Northbride which is shared by all cores on a package. NB events are counted on a shared set of counters. When a NB event is programmed in a counter, the data actually comes from a shared counter. Thus, access to those counters needs to be synchronized. We implement the synchronization such that no two cores can be measuring NB events using the same counters. Thus, we maintain a per-NB allocation table. The available slot is propagated using the event_constraint structure. Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <4b703957.0702d00a.6bf2.7b7d@mx.google.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 74c60021cdb..fb4e56eb58f 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -98,6 +98,7 @@ void __weak hw_perf_enable(void) { barrier(); }
98 98
99void __weak hw_perf_event_setup(int cpu) { barrier(); } 99void __weak hw_perf_event_setup(int cpu) { barrier(); }
100void __weak hw_perf_event_setup_online(int cpu) { barrier(); } 100void __weak hw_perf_event_setup_online(int cpu) { barrier(); }
101void __weak hw_perf_event_setup_offline(int cpu) { barrier(); }
101 102
102int __weak 103int __weak
103hw_perf_group_sched_in(struct perf_event *group_leader, 104hw_perf_group_sched_in(struct perf_event *group_leader,
@@ -5462,6 +5463,10 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
5462 perf_event_exit_cpu(cpu); 5463 perf_event_exit_cpu(cpu);
5463 break; 5464 break;
5464 5465
5466 case CPU_DEAD:
5467 hw_perf_event_setup_offline(cpu);
5468 break;
5469
5465 default: 5470 default:
5466 break; 5471 break;
5467 } 5472 }