summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-05-20 19:21:47 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-05-26 20:31:50 +0200
commit0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00 (patch)
treeaf3d210c8db9adcf117580c949fb708badcb520b /include/trace
parent62ba180e80f4194a498585ac0e4c07daa8ca08d1 (diff)
downloadop-kernel-dev-0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00.zip
op-kernel-dev-0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00.tar.gz
tracing: add __print_symbolic to trace events
This patch adds __print_symbolic which is similar to __print_flags but works for an enumeration type instead. That is, there is only a one to one mapping between the values and the symbols. When a match is made, then it is printed, otherwise the hex value is outputed. [ Impact: add interface for showing symbol names in events ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/ftrace.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 22c9471..87fc227 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -130,6 +130,14 @@
ftrace_print_flags_seq(p, delim, flag, flags); \
})
+#undef __print_symbolic
+#define __print_symbolic(value, symbol_array...) \
+ ({ \
+ static const struct trace_print_flags symbols[] = \
+ { symbol_array, { -1, NULL }}; \
+ ftrace_print_symbols_seq(p, value, symbols); \
+ })
+
#undef TRACE_EVENT
#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
enum print_line_t \
OpenPOWER on IntegriCloud