diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-06-08 11:22:06 -0400 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-06-28 21:13:14 -0400 |
| commit | a1d0ce8213e9ddf4046ef5ba95c55762d075f541 (patch) | |
| tree | c72fb18588de555c8fa0c61452ae14ffe37dbf8a /include/trace | |
| parent | d62f85d1e22e537192ce494c89540e1ac0d8bfc7 (diff) | |
tracing: Use class->reg() for all registering of events
Because kprobes and syscalls need special processing to register
events, the class->reg() method was created to handle the differences.
But instead of creating a default ->reg for perf and ftrace events,
the code was scattered with:
if (class->reg)
class->reg();
else
default_reg();
This is messy and can also lead to bugs.
This patch cleans up this code and creates a default reg() entry for
the events allowing for the code to directly call the class->reg()
without the condition.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/ftrace.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index fc013a8201e9..55c1fd1bbc3d 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -439,6 +439,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 439 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), | 439 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), |
| 440 | * .raw_init = trace_event_raw_init, | 440 | * .raw_init = trace_event_raw_init, |
| 441 | * .probe = ftrace_raw_event_##call, | 441 | * .probe = ftrace_raw_event_##call, |
| 442 | * .reg = ftrace_event_reg, | ||
| 442 | * }; | 443 | * }; |
| 443 | * | 444 | * |
| 444 | * static struct ftrace_event_call __used | 445 | * static struct ftrace_event_call __used |
| @@ -567,6 +568,7 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
| 567 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ | 568 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ |
| 568 | .raw_init = trace_event_raw_init, \ | 569 | .raw_init = trace_event_raw_init, \ |
| 569 | .probe = ftrace_raw_event_##call, \ | 570 | .probe = ftrace_raw_event_##call, \ |
| 571 | .reg = ftrace_event_reg, \ | ||
| 570 | _TRACE_PERF_INIT(call) \ | 572 | _TRACE_PERF_INIT(call) \ |
| 571 | }; | 573 | }; |
| 572 | 574 | ||
