Skip to content

Commit

Permalink
perf/trace: Properly use u64 to hold event_id
Browse files Browse the repository at this point in the history
The 64-bit attr.config value for perf trace events was being copied into
an "int" before doing a comparison, meaning the top 32 bits were
being truncated.

As far as I can tell this didn't cause any errors, but it did mean
it was possible to create valid aliases for all the tracepoint ids
which I don't think was intended.  (For example, 0xffffffff00000018
and 0x18 both enable the same tracepoint).

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1311151236100.11932@vincent-weaver-1.um.maine.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Vince Weaver authored and Ingo Molnar committed Nov 19, 2013
1 parent 06db0b2 commit 0022ced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_event_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event,
int perf_trace_init(struct perf_event *p_event)
{
struct ftrace_event_call *tp_event;
int event_id = p_event->attr.config;
u64 event_id = p_event->attr.config;
int ret = -EINVAL;

mutex_lock(&event_mutex);
Expand Down

0 comments on commit 0022ced

Please sign in to comment.