Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375453
b: refs/heads/master
c: da511bf
h: refs/heads/master
i:
  375451: 4923908
v: v3
  • Loading branch information
Steven Rostedt (Red Hat) committed May 10, 2013
1 parent d040527 commit d29932f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 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: 1cf4c0732db3cd3c49cadbc60ff6bda08604e6fa
refs/heads/master: da511bf33e47ea1f33f4b672f7da166d2a1b8a91
32 changes: 20 additions & 12 deletions trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,24 @@ __register_event(struct ftrace_event_call *call, struct module *mod)
return 0;
}

static struct ftrace_event_file *
trace_create_new_event(struct ftrace_event_call *call,
struct trace_array *tr)
{
struct ftrace_event_file *file;

file = kmem_cache_alloc(file_cachep, GFP_TRACE);
if (!file)
return NULL;

file->event_call = call;
file->tr = tr;
atomic_set(&file->sm_ref, 0);
list_add(&file->list, &tr->events);

return file;
}

/* Add an event to a trace directory */
static int
__trace_add_new_event(struct ftrace_event_call *call,
Expand All @@ -1540,15 +1558,10 @@ __trace_add_new_event(struct ftrace_event_call *call,
{
struct ftrace_event_file *file;

file = kmem_cache_alloc(file_cachep, GFP_TRACE);
file = trace_create_new_event(call, tr);
if (!file)
return -ENOMEM;

file->event_call = call;
file->tr = tr;
atomic_set(&file->sm_ref, 0);
list_add(&file->list, &tr->events);

return event_create_dir(tr->event_dir, file, id, enable, filter, format);
}

Expand All @@ -1563,15 +1576,10 @@ __trace_early_add_new_event(struct ftrace_event_call *call,
{
struct ftrace_event_file *file;

file = kmem_cache_alloc(file_cachep, GFP_TRACE);
file = trace_create_new_event(call, tr);
if (!file)
return -ENOMEM;

file->event_call = call;
file->tr = tr;
atomic_set(&file->sm_ref, 0);
list_add(&file->list, &tr->events);

return 0;
}

Expand Down

0 comments on commit d29932f

Please sign in to comment.