diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-08-13 04:13:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-13 04:13:22 -0400 |
commit | 28402971d869e26271b25301011f667d3a5640c3 (patch) | |
tree | 39fe9451f609c3ad47382595c61db855ee5dc49d /kernel/perf_counter.c | |
parent | 8f7a0dc51674ad0dd06155291b0aed60d655943c (diff) |
perf_counter: Provide hw_perf_counter_setup_online() APIs
Provide weak aliases for hw_perf_counter_setup_online(). This is
used by the BTS patches (for v2.6.32), but it interacts with
fixes so propagate this upstream. (it has no effect as of yet)
Also export perf_counter_output() to architecture code.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index b0b20a07f394..e26d2fcfa320 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -88,6 +88,7 @@ void __weak hw_perf_disable(void) { barrier(); } | |||
88 | void __weak hw_perf_enable(void) { barrier(); } | 88 | void __weak hw_perf_enable(void) { barrier(); } |
89 | 89 | ||
90 | void __weak hw_perf_counter_setup(int cpu) { barrier(); } | 90 | void __weak hw_perf_counter_setup(int cpu) { barrier(); } |
91 | void __weak hw_perf_counter_setup_online(int cpu) { barrier(); } | ||
91 | 92 | ||
92 | int __weak | 93 | int __weak |
93 | hw_perf_group_sched_in(struct perf_counter *group_leader, | 94 | hw_perf_group_sched_in(struct perf_counter *group_leader, |
@@ -2630,7 +2631,7 @@ static u32 perf_counter_tid(struct perf_counter *counter, struct task_struct *p) | |||
2630 | return task_pid_nr_ns(p, counter->ns); | 2631 | return task_pid_nr_ns(p, counter->ns); |
2631 | } | 2632 | } |
2632 | 2633 | ||
2633 | static void perf_counter_output(struct perf_counter *counter, int nmi, | 2634 | void perf_counter_output(struct perf_counter *counter, int nmi, |
2634 | struct perf_sample_data *data) | 2635 | struct perf_sample_data *data) |
2635 | { | 2636 | { |
2636 | int ret; | 2637 | int ret; |
@@ -4592,6 +4593,11 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) | |||
4592 | perf_counter_init_cpu(cpu); | 4593 | perf_counter_init_cpu(cpu); |
4593 | break; | 4594 | break; |
4594 | 4595 | ||
4596 | case CPU_ONLINE: | ||
4597 | case CPU_ONLINE_FROZEN: | ||
4598 | hw_perf_counter_setup_online(cpu); | ||
4599 | break; | ||
4600 | |||
4595 | case CPU_DOWN_PREPARE: | 4601 | case CPU_DOWN_PREPARE: |
4596 | case CPU_DOWN_PREPARE_FROZEN: | 4602 | case CPU_DOWN_PREPARE_FROZEN: |
4597 | perf_counter_exit_cpu(cpu); | 4603 | perf_counter_exit_cpu(cpu); |
@@ -4616,6 +4622,8 @@ void __init perf_counter_init(void) | |||
4616 | { | 4622 | { |
4617 | perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE, | 4623 | perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE, |
4618 | (void *)(long)smp_processor_id()); | 4624 | (void *)(long)smp_processor_id()); |
4625 | perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_ONLINE, | ||
4626 | (void *)(long)smp_processor_id()); | ||
4619 | register_cpu_notifier(&perf_cpu_nb); | 4627 | register_cpu_notifier(&perf_cpu_nb); |
4620 | } | 4628 | } |
4621 | 4629 | ||