aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/trace/ftrace.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r--include/trace/ftrace.h58
1 files changed, 43 insertions, 15 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index a9377c0083ad..533c49f48047 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -82,6 +82,10 @@
82 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ 82 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \
83 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ 83 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
84 84
85#undef TRACE_EVENT_FLAGS
86#define TRACE_EVENT_FLAGS(name, value) \
87 __TRACE_EVENT_FLAGS(name, value)
88
85#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 89#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
86 90
87 91
@@ -129,6 +133,9 @@
129#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ 133#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
130 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) 134 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
131 135
136#undef TRACE_EVENT_FLAGS
137#define TRACE_EVENT_FLAGS(event, flag)
138
132#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 139#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
133 140
134/* 141/*
@@ -198,6 +205,19 @@
198 ftrace_print_symbols_seq(p, value, symbols); \ 205 ftrace_print_symbols_seq(p, value, symbols); \
199 }) 206 })
200 207
208#undef __print_symbolic_u64
209#if BITS_PER_LONG == 32
210#define __print_symbolic_u64(value, symbol_array...) \
211 ({ \
212 static const struct trace_print_flags_u64 symbols[] = \
213 { symbol_array, { -1, NULL } }; \
214 ftrace_print_symbols_seq_u64(p, value, symbols); \
215 })
216#else
217#define __print_symbolic_u64(value, symbol_array...) \
218 __print_symbolic(value, symbol_array)
219#endif
220
201#undef __print_hex 221#undef __print_hex
202#define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) 222#define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len)
203 223
@@ -289,13 +309,19 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
289 309
290#undef __array 310#undef __array
291#define __array(type, item, len) \ 311#define __array(type, item, len) \
292 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ 312 do { \
293 ret = trace_define_field(event_call, #type "[" #len "]", #item, \ 313 mutex_lock(&event_storage_mutex); \
314 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
315 snprintf(event_storage, sizeof(event_storage), \
316 "%s[%d]", #type, len); \
317 ret = trace_define_field(event_call, event_storage, #item, \
294 offsetof(typeof(field), item), \ 318 offsetof(typeof(field), item), \
295 sizeof(field.item), \ 319 sizeof(field.item), \
296 is_signed_type(type), FILTER_OTHER); \ 320 is_signed_type(type), FILTER_OTHER); \
297 if (ret) \ 321 mutex_unlock(&event_storage_mutex); \
298 return ret; 322 if (ret) \
323 return ret; \
324 } while (0);
299 325
300#undef __dynamic_array 326#undef __dynamic_array
301#define __dynamic_array(type, item, len) \ 327#define __dynamic_array(type, item, len) \
@@ -433,14 +459,16 @@ static inline notrace int ftrace_get_offsets_##call( \
433 * .reg = ftrace_event_reg, 459 * .reg = ftrace_event_reg,
434 * }; 460 * };
435 * 461 *
436 * static struct ftrace_event_call __used 462 * static struct ftrace_event_call event_<call> = {
437 * __attribute__((__aligned__(4)))
438 * __attribute__((section("_ftrace_events"))) event_<call> = {
439 * .name = "<call>", 463 * .name = "<call>",
440 * .class = event_class_<template>, 464 * .class = event_class_<template>,
441 * .event = &ftrace_event_type_<call>, 465 * .event = &ftrace_event_type_<call>,
442 * .print_fmt = print_fmt_<call>, 466 * .print_fmt = print_fmt_<call>,
443 * }; 467 * };
468 * // its only safe to use pointers when doing linker tricks to
469 * // create an array.
470 * static struct ftrace_event_call __used
471 * __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>;
444 * 472 *
445 */ 473 */
446 474
@@ -566,28 +594,28 @@ static struct ftrace_event_class __used event_class_##call = { \
566#undef DEFINE_EVENT 594#undef DEFINE_EVENT
567#define DEFINE_EVENT(template, call, proto, args) \ 595#define DEFINE_EVENT(template, call, proto, args) \
568 \ 596 \
569static struct ftrace_event_call __used \ 597static struct ftrace_event_call __used event_##call = { \
570__attribute__((__aligned__(4))) \
571__attribute__((section("_ftrace_events"))) event_##call = { \
572 .name = #call, \ 598 .name = #call, \
573 .class = &event_class_##template, \ 599 .class = &event_class_##template, \
574 .event.funcs = &ftrace_event_type_funcs_##template, \ 600 .event.funcs = &ftrace_event_type_funcs_##template, \
575 .print_fmt = print_fmt_##template, \ 601 .print_fmt = print_fmt_##template, \
576}; 602}; \
603static struct ftrace_event_call __used \
604__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
577 605
578#undef DEFINE_EVENT_PRINT 606#undef DEFINE_EVENT_PRINT
579#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 607#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
580 \ 608 \
581static const char print_fmt_##call[] = print; \ 609static const char print_fmt_##call[] = print; \
582 \ 610 \
583static struct ftrace_event_call __used \ 611static struct ftrace_event_call __used event_##call = { \
584__attribute__((__aligned__(4))) \
585__attribute__((section("_ftrace_events"))) event_##call = { \
586 .name = #call, \ 612 .name = #call, \
587 .class = &event_class_##template, \ 613 .class = &event_class_##template, \
588 .event.funcs = &ftrace_event_type_funcs_##call, \ 614 .event.funcs = &ftrace_event_type_funcs_##call, \
589 .print_fmt = print_fmt_##call, \ 615 .print_fmt = print_fmt_##call, \
590} 616}; \
617static struct ftrace_event_call __used \
618__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
591 619
592#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 620#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
593 621