diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-03-19 15:26:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:30:17 -0400 |
commit | b8e83514b64577b48bfb794fe85fcde40a9343ca (patch) | |
tree | 3fd79b41c917f56fe5a5b1f779b892110e0ec909 /arch | |
parent | e077df4f439681e43f0db8255b2d215b342ebdc6 (diff) |
perf_counter: revamp syscall input ABI
Impact: modify ABI
The hardware/software classification in hw_event->type became a little
strained due to the addition of tracepoint tracing.
Instead split up the field and provide a type field to explicitly specify
the counter type, while using the event_id field to specify which event to
use.
Raw counters still work as before, only the raw config now goes into
raw_event.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Orig-LKML-Reference: <20090319194233.836807573@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/perf_counter.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 5008762e8bf4..26f69dc7130e 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c | |||
@@ -602,7 +602,7 @@ hw_perf_counter_init(struct perf_counter *counter) | |||
602 | return NULL; | 602 | return NULL; |
603 | if ((s64)counter->hw_event.irq_period < 0) | 603 | if ((s64)counter->hw_event.irq_period < 0) |
604 | return NULL; | 604 | return NULL; |
605 | ev = counter->hw_event.type; | 605 | ev = counter->hw_event.event_id; |
606 | if (!counter->hw_event.raw) { | 606 | if (!counter->hw_event.raw) { |
607 | if (ev >= ppmu->n_generic || | 607 | if (ev >= ppmu->n_generic || |
608 | ppmu->generic_events[ev] == 0) | 608 | ppmu->generic_events[ev] == 0) |
@@ -692,7 +692,7 @@ static void perf_handle_group(struct perf_counter *counter) | |||
692 | list_for_each_entry(sub, &leader->sibling_list, list_entry) { | 692 | list_for_each_entry(sub, &leader->sibling_list, list_entry) { |
693 | if (sub != counter) | 693 | if (sub != counter) |
694 | sub->hw_ops->read(sub); | 694 | sub->hw_ops->read(sub); |
695 | perf_store_irq_data(counter, sub->hw_event.type); | 695 | perf_store_irq_data(counter, sub->hw_event.event_config); |
696 | perf_store_irq_data(counter, atomic64_read(&sub->count)); | 696 | perf_store_irq_data(counter, atomic64_read(&sub->count)); |
697 | } | 697 | } |
698 | } | 698 | } |
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index 6cba9d47b711..d844ae41d5a3 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c | |||
@@ -217,15 +217,15 @@ static int __hw_perf_counter_init(struct perf_counter *counter) | |||
217 | /* | 217 | /* |
218 | * Raw event type provide the config in the event structure | 218 | * Raw event type provide the config in the event structure |
219 | */ | 219 | */ |
220 | if (hw_event->raw) { | 220 | if (hw_event->raw_type) { |
221 | hwc->config |= pmc_ops->raw_event(hw_event->type); | 221 | hwc->config |= pmc_ops->raw_event(hw_event->raw_event_id); |
222 | } else { | 222 | } else { |
223 | if (hw_event->type >= pmc_ops->max_events) | 223 | if (hw_event->event_id >= pmc_ops->max_events) |
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | /* | 225 | /* |
226 | * The generic map: | 226 | * The generic map: |
227 | */ | 227 | */ |
228 | hwc->config |= pmc_ops->event_map(hw_event->type); | 228 | hwc->config |= pmc_ops->event_map(hw_event->event_id); |
229 | } | 229 | } |
230 | counter->wakeup_pending = 0; | 230 | counter->wakeup_pending = 0; |
231 | 231 | ||
@@ -715,7 +715,7 @@ perf_handle_group(struct perf_counter *sibling, u64 *status, u64 *overflown) | |||
715 | list_for_each_entry(counter, &group_leader->sibling_list, list_entry) { | 715 | list_for_each_entry(counter, &group_leader->sibling_list, list_entry) { |
716 | 716 | ||
717 | x86_perf_counter_update(counter, &counter->hw, counter->hw.idx); | 717 | x86_perf_counter_update(counter, &counter->hw, counter->hw.idx); |
718 | perf_store_irq_data(sibling, counter->hw_event.type); | 718 | perf_store_irq_data(sibling, counter->hw_event.event_config); |
719 | perf_store_irq_data(sibling, atomic64_read(&counter->count)); | 719 | perf_store_irq_data(sibling, atomic64_read(&counter->count)); |
720 | } | 720 | } |
721 | } | 721 | } |