diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-04-20 10:47:33 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-14 09:33:49 -0400 |
commit | 8f0820183056ad26dabc0202115848a92f1143fc (patch) | |
tree | c9e1cb9d41e37d5075704efbde3c97121820e0c5 /kernel/trace/trace_kprobe.c | |
parent | 23e117fa44429cc054cb27d5621d64e4ced91e52 (diff) |
tracing: Create class struct for events
This patch creates a ftrace_event_class struct that event structs point to.
This class struct will be made to hold information to modify the
events. Currently the class struct only holds the events system name.
This patch slightly increases the size, but this change lays the ground work
of other changes to make the footprint of tracepoints smaller.
With 82 standard tracepoints, and 618 system call tracepoints
(two tracepoints per syscall: enter and exit):
text data bss dec hex filename
4913961 1088356 861512 6863829 68bbd5 vmlinux.orig
4914025 1088868 861512 6864405 68be15 vmlinux.class
This patch also cleans up some stale comments in ftrace.h.
v2: Fixed missing semi-colon in macro.
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 1251e367bae9..eda220bf2065 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -332,8 +332,8 @@ static struct trace_probe *alloc_trace_probe(const char *group, | |||
332 | goto error; | 332 | goto error; |
333 | } | 333 | } |
334 | 334 | ||
335 | tp->call.system = kstrdup(group, GFP_KERNEL); | 335 | tp->call.class->system = kstrdup(group, GFP_KERNEL); |
336 | if (!tp->call.system) | 336 | if (!tp->call.class->system) |
337 | goto error; | 337 | goto error; |
338 | 338 | ||
339 | INIT_LIST_HEAD(&tp->list); | 339 | INIT_LIST_HEAD(&tp->list); |
@@ -361,7 +361,7 @@ static void free_trace_probe(struct trace_probe *tp) | |||
361 | for (i = 0; i < tp->nr_args; i++) | 361 | for (i = 0; i < tp->nr_args; i++) |
362 | free_probe_arg(&tp->args[i]); | 362 | free_probe_arg(&tp->args[i]); |
363 | 363 | ||
364 | kfree(tp->call.system); | 364 | kfree(tp->call.class->system); |
365 | kfree(tp->call.name); | 365 | kfree(tp->call.name); |
366 | kfree(tp->symbol); | 366 | kfree(tp->symbol); |
367 | kfree(tp); | 367 | kfree(tp); |
@@ -374,7 +374,7 @@ static struct trace_probe *find_probe_event(const char *event, | |||
374 | 374 | ||
375 | list_for_each_entry(tp, &probe_list, list) | 375 | list_for_each_entry(tp, &probe_list, list) |
376 | if (strcmp(tp->call.name, event) == 0 && | 376 | if (strcmp(tp->call.name, event) == 0 && |
377 | strcmp(tp->call.system, group) == 0) | 377 | strcmp(tp->call.class->system, group) == 0) |
378 | return tp; | 378 | return tp; |
379 | return NULL; | 379 | return NULL; |
380 | } | 380 | } |
@@ -399,7 +399,7 @@ static int register_trace_probe(struct trace_probe *tp) | |||
399 | mutex_lock(&probe_lock); | 399 | mutex_lock(&probe_lock); |
400 | 400 | ||
401 | /* register as an event */ | 401 | /* register as an event */ |
402 | old_tp = find_probe_event(tp->call.name, tp->call.system); | 402 | old_tp = find_probe_event(tp->call.name, tp->call.class->system); |
403 | if (old_tp) { | 403 | if (old_tp) { |
404 | /* delete old event */ | 404 | /* delete old event */ |
405 | unregister_trace_probe(old_tp); | 405 | unregister_trace_probe(old_tp); |
@@ -798,7 +798,7 @@ static int probes_seq_show(struct seq_file *m, void *v) | |||
798 | char buf[MAX_ARGSTR_LEN + 1]; | 798 | char buf[MAX_ARGSTR_LEN + 1]; |
799 | 799 | ||
800 | seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p'); | 800 | seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p'); |
801 | seq_printf(m, ":%s/%s", tp->call.system, tp->call.name); | 801 | seq_printf(m, ":%s/%s", tp->call.class->system, tp->call.name); |
802 | 802 | ||
803 | if (!tp->symbol) | 803 | if (!tp->symbol) |
804 | seq_printf(m, " 0x%p", tp->rp.kp.addr); | 804 | seq_printf(m, " 0x%p", tp->rp.kp.addr); |