Re: [RFC][PATCH 09/11] perf_counter: revamp syscall input ABI

From: Paul Mackerras
Date: Wed Mar 18 2009 - 01:03:57 EST


Peter Zijlstra writes:

> 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.

It would be nice if you didn't reuse the name 'type' but instead
called the field something different ('class', perhaps?) to force a
compile error on code that needs to be updated. For example, you
missed a spot in arch/powerpc/kernel/perf_counter.c and you need to
add on the patch below. (Thanks for updating powerpc BTW.)

Paul.

diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c
index efaeecf..88b72eb 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)
return NULL;
if ((s64)counter->hw_event.irq_period < 0)
return NULL;
- ev = counter->hw_event.type;
+ ev = counter->hw_event.event_id;
if (!counter->hw_event.raw) {
if (ev >= ppmu->n_generic ||
ppmu->generic_events[ev] == 0)
--
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/