Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141000
b: refs/heads/master
c: 28bea27
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 20, 2009
1 parent 198a9bb commit 01cf2db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23725aeeab10ba02bcf10ec49ad73146b54cb52f
refs/heads/master: 28bea271e58e429eccfad3d7ee2ad12d6ee015bf
15 changes: 14 additions & 1 deletion trunk/kernel/trace/trace_events_stage_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,19 @@ static void ftrace_unreg_event_##call(void) \
{ \
unregister_trace_##call(ftrace_event_##call); \
} \

\
static struct ftrace_event_call event_##call; \
\
static int ftrace_init_event_##call(void) \
{ \
int id; \
\
id = register_ftrace_event(NULL); \
if (!id) \
return -ENODEV; \
event_##call.id = id; \
return 0; \
}

#undef TRACE_FORMAT
#define TRACE_FORMAT(call, proto, args, fmt) \
Expand All @@ -140,6 +152,7 @@ __attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_events"))) event_##call = { \
.name = #call, \
.system = __stringify(TRACE_SYSTEM), \
.raw_init = ftrace_init_event_##call, \
.regfunc = ftrace_reg_event_##call, \
.unregfunc = ftrace_unreg_event_##call, \
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ int register_ftrace_event(struct trace_event *event)

mutex_lock(&trace_event_mutex);

if (!event) {
ret = next_event_type++;
goto out;
}

if (!event->type)
event->type = next_event_type++;
else if (event->type > __TRACE_LAST_TYPE) {
Expand Down

0 comments on commit 01cf2db

Please sign in to comment.