aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-04-22 11:46:44 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-14 14:20:30 -0400
commit0405ab80aa94afb13bf9ac4a6fc9f2923d4b9114 (patch)
tree43eedc09bb15ecfda26adb661d59badeacea0de6 /include/trace
parent2e33af029556cb8bd22bf4f86f42d540249177ea (diff)
tracing: Move raw_init from events to class
The raw_init function pointer in the event is used to initialize various kinds of events. The type of initialization needed is usually classed to the kind of event it is. Two events with the same class will always have the same initialization function, so it makes sense to move this to the class structure. Perhaps even making a special system structure would work since the initialization is the same for all events within a system. But since there's no system structure (yet), this will just move it to the class. text data bss dec hex filename 4913961 1088356 861512 6863829 68bbd5 vmlinux.orig 4900375 1053380 861512 6815267 67fe23 vmlinux.fields 4900382 1048964 861512 6810858 67ecea vmlinux.init The text grew very slightly, but this is a constant growth that happened with the changing of the C files that call the init code. The bigger savings is the data which will be saved the more events share a class. Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/ftrace.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index c7e3bcd5d52f..e7eb33420b06 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -431,8 +431,9 @@ static inline notrace int ftrace_get_offsets_##call( \
431 * static struct ftrace_event_class __used event_class_<template> = { 431 * static struct ftrace_event_class __used event_class_<template> = {
432 * .system = "<system>", 432 * .system = "<system>",
433 * .define_fields = ftrace_define_fields_<call>, 433 * .define_fields = ftrace_define_fields_<call>,
434 * .fields = LIST_HEAD_INIT(event_class_##call.fields), \ 434 * .fields = LIST_HEAD_INIT(event_class_##call.fields),
435 * .probe = ftrace_raw_event_##call, \ 435 * .raw_init = trace_event_raw_init,
436 * .probe = ftrace_raw_event_##call,
436 * }; 437 * };
437 * 438 *
438 * static struct ftrace_event_call __used 439 * static struct ftrace_event_call __used
@@ -440,7 +441,6 @@ static inline notrace int ftrace_get_offsets_##call( \
440 * __attribute__((section("_ftrace_events"))) event_<call> = { 441 * __attribute__((section("_ftrace_events"))) event_<call> = {
441 * .name = "<call>", 442 * .name = "<call>",
442 * .class = event_class_<template>, 443 * .class = event_class_<template>,
443 * .raw_init = trace_event_raw_init,
444 * .event = &ftrace_event_type_<call>, 444 * .event = &ftrace_event_type_<call>,
445 * .print_fmt = print_fmt_<call>, 445 * .print_fmt = print_fmt_<call>,
446 * }; 446 * };
@@ -566,6 +566,7 @@ static struct ftrace_event_class __used event_class_##call = { \
566 .system = __stringify(TRACE_SYSTEM), \ 566 .system = __stringify(TRACE_SYSTEM), \
567 .define_fields = ftrace_define_fields_##call, \ 567 .define_fields = ftrace_define_fields_##call, \
568 .fields = LIST_HEAD_INIT(event_class_##call.fields),\ 568 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
569 .raw_init = trace_event_raw_init, \
569 .probe = ftrace_raw_event_##call, \ 570 .probe = ftrace_raw_event_##call, \
570 _TRACE_PERF_INIT(call) \ 571 _TRACE_PERF_INIT(call) \
571}; 572};
@@ -579,7 +580,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
579 .name = #call, \ 580 .name = #call, \
580 .class = &event_class_##template, \ 581 .class = &event_class_##template, \
581 .event = &ftrace_event_type_##call, \ 582 .event = &ftrace_event_type_##call, \
582 .raw_init = trace_event_raw_init, \
583 .print_fmt = print_fmt_##template, \ 583 .print_fmt = print_fmt_##template, \
584}; 584};
585 585
@@ -594,7 +594,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
594 .name = #call, \ 594 .name = #call, \
595 .class = &event_class_##template, \ 595 .class = &event_class_##template, \
596 .event = &ftrace_event_type_##call, \ 596 .event = &ftrace_event_type_##call, \
597 .raw_init = trace_event_raw_init, \
598 .print_fmt = print_fmt_##call, \ 597 .print_fmt = print_fmt_##call, \
599} 598}
600 599