aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-04-20 10:47:33 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-14 09:33:49 -0400
commit8f0820183056ad26dabc0202115848a92f1143fc (patch)
treec9e1cb9d41e37d5075704efbde3c97121820e0c5 /include/trace
parent23e117fa44429cc054cb27d5621d64e4ced91e52 (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 'include/trace')
-rw-r--r--include/trace/ftrace.h44
1 files changed, 19 insertions, 25 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 75dd7787fb37..7dcdfd824aab 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -62,7 +62,10 @@
62 struct trace_entry ent; \ 62 struct trace_entry ent; \
63 tstruct \ 63 tstruct \
64 char __data[0]; \ 64 char __data[0]; \
65 }; 65 }; \
66 \
67 static struct ftrace_event_class event_class_##name;
68
66#undef DEFINE_EVENT 69#undef DEFINE_EVENT
67#define DEFINE_EVENT(template, name, proto, args) \ 70#define DEFINE_EVENT(template, name, proto, args) \
68 static struct ftrace_event_call \ 71 static struct ftrace_event_call \
@@ -430,22 +433,6 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
430 * 433 *
431 * Override the macros in <trace/trace_events.h> to include the following: 434 * Override the macros in <trace/trace_events.h> to include the following:
432 * 435 *
433 * static void ftrace_event_<call>(proto)
434 * {
435 * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
436 * }
437 *
438 * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused)
439 * {
440 * return register_trace_<call>(ftrace_event_<call>);
441 * }
442 *
443 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
444 * {
445 * unregister_trace_<call>(ftrace_event_<call>);
446 * }
447 *
448 *
449 * For those macros defined with TRACE_EVENT: 436 * For those macros defined with TRACE_EVENT:
450 * 437 *
451 * static struct ftrace_event_call event_<call>; 438 * static struct ftrace_event_call event_<call>;
@@ -497,17 +484,21 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
497 * 484 *
498 * static const char print_fmt_<call>[] = <TP_printk>; 485 * static const char print_fmt_<call>[] = <TP_printk>;
499 * 486 *
487 * static struct ftrace_event_class __used event_class_<template> = {
488 * .system = "<system>",
489 * };
490 *
500 * static struct ftrace_event_call __used 491 * static struct ftrace_event_call __used
501 * __attribute__((__aligned__(4))) 492 * __attribute__((__aligned__(4)))
502 * __attribute__((section("_ftrace_events"))) event_<call> = { 493 * __attribute__((section("_ftrace_events"))) event_<call> = {
503 * .name = "<call>", 494 * .name = "<call>",
504 * .system = "<system>", 495 * .class = event_class_<template>,
505 * .raw_init = trace_event_raw_init, 496 * .raw_init = trace_event_raw_init,
506 * .regfunc = ftrace_reg_event_<call>, 497 * .regfunc = ftrace_raw_reg_event_<call>,
507 * .unregfunc = ftrace_unreg_event_<call>, 498 * .unregfunc = ftrace_raw_unreg_event_<call>,
508 * .print_fmt = print_fmt_<call>, 499 * .print_fmt = print_fmt_<call>,
509 * .define_fields = ftrace_define_fields_<call>, 500 * .define_fields = ftrace_define_fields_<call>,
510 * } 501 * };
511 * 502 *
512 */ 503 */
513 504
@@ -627,7 +618,10 @@ static struct trace_event ftrace_event_type_##call = { \
627 618
628#undef DECLARE_EVENT_CLASS 619#undef DECLARE_EVENT_CLASS
629#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 620#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
630static const char print_fmt_##call[] = print; 621static const char print_fmt_##call[] = print; \
622static struct ftrace_event_class __used event_class_##call = { \
623 .system = __stringify(TRACE_SYSTEM) \
624};
631 625
632#undef DEFINE_EVENT 626#undef DEFINE_EVENT
633#define DEFINE_EVENT(template, call, proto, args) \ 627#define DEFINE_EVENT(template, call, proto, args) \
@@ -636,7 +630,7 @@ static struct ftrace_event_call __used \
636__attribute__((__aligned__(4))) \ 630__attribute__((__aligned__(4))) \
637__attribute__((section("_ftrace_events"))) event_##call = { \ 631__attribute__((section("_ftrace_events"))) event_##call = { \
638 .name = #call, \ 632 .name = #call, \
639 .system = __stringify(TRACE_SYSTEM), \ 633 .class = &event_class_##template, \
640 .event = &ftrace_event_type_##call, \ 634 .event = &ftrace_event_type_##call, \
641 .raw_init = trace_event_raw_init, \ 635 .raw_init = trace_event_raw_init, \
642 .regfunc = ftrace_raw_reg_event_##call, \ 636 .regfunc = ftrace_raw_reg_event_##call, \
@@ -644,7 +638,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
644 .print_fmt = print_fmt_##template, \ 638 .print_fmt = print_fmt_##template, \
645 .define_fields = ftrace_define_fields_##template, \ 639 .define_fields = ftrace_define_fields_##template, \
646 _TRACE_PERF_INIT(call) \ 640 _TRACE_PERF_INIT(call) \
647} 641};
648 642
649#undef DEFINE_EVENT_PRINT 643#undef DEFINE_EVENT_PRINT
650#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 644#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
@@ -655,7 +649,7 @@ static struct ftrace_event_call __used \
655__attribute__((__aligned__(4))) \ 649__attribute__((__aligned__(4))) \
656__attribute__((section("_ftrace_events"))) event_##call = { \ 650__attribute__((section("_ftrace_events"))) event_##call = { \
657 .name = #call, \ 651 .name = #call, \
658 .system = __stringify(TRACE_SYSTEM), \ 652 .class = &event_class_##template, \
659 .event = &ftrace_event_type_##call, \ 653 .event = &ftrace_event_type_##call, \
660 .raw_init = trace_event_raw_init, \ 654 .raw_init = trace_event_raw_init, \
661 .regfunc = ftrace_raw_reg_event_##call, \ 655 .regfunc = ftrace_raw_reg_event_##call, \