[RFC][PATCH 4/5] perfcounter: Grow the event number to 64 bits

From: Frederic Weisbecker
Date: Mon Jul 20 2009 - 13:08:45 EST


The event number are defined by the config attr of a counter. When it
is passed while adding a hit, it is compared against the initial
config attr, a 64 bits number, to retrieve the targetted counter.

But when we want to add a hit, this event is passed through 32 bits
parameters, which makes loosing the real event number if its storage
needs more (case of an address).

This patch changes the event parameter in some of the helpers which
add the event hits.

Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Anton Blanchard <anton@xxxxxxxxx>
---
kernel/perf_counter.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 5498890..33ffb5a 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -3435,7 +3435,7 @@ static int perf_swcounter_is_counting(struct perf_counter *counter)

static int perf_swcounter_match(struct perf_counter *counter,
enum perf_type_id type,
- u32 event, struct pt_regs *regs)
+ u64 event, struct pt_regs *regs)
{
if (!perf_swcounter_is_counting(counter))
return 0;
@@ -3467,7 +3467,7 @@ static void perf_swcounter_add(struct perf_counter *counter, u64 nr,

static void perf_swcounter_ctx_event(struct perf_counter_context *ctx,
enum perf_type_id type,
- u32 event, u64 nr, int nmi,
+ u64 event, u64 nr, int nmi,
struct perf_sample_data *data)
{
struct perf_counter *counter;
@@ -3497,7 +3497,7 @@ static int *perf_swcounter_recursion_context(struct perf_cpu_context *cpuctx)
return &cpuctx->recursion[0];
}

-static void do_perf_swcounter_event(enum perf_type_id type, u32 event,
+static void do_perf_swcounter_event(enum perf_type_id type, u64 event,
u64 nr, int nmi,
struct perf_sample_data *data)
{
--
1.6.2.3

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