summaryrefslogtreecommitdiff
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-09-30 01:13:33 +0300
committerSteven Rostedt <rostedt@goodmis.org>2015-09-30 11:35:18 +0300
commitb5e87c0581319481399b6d8e8d6972b5523c18e6 (patch)
tree4439fbdae48bb3dbd6b8023c25be9c618da1c11e /kernel/trace/trace.h
parent41d9c0beccbb92397bea8b04a6afd1253c064a1a (diff)
downloadlinux-b5e87c0581319481399b6d8e8d6972b5523c18e6.tar.xz
tracing: Add build bug if we have more trace_flags than bits
Add a enum that denotes the last bit of the trace_flags and have a BUILD_BUG_ON(last_bit > 32). If we add more bits than we have in trace_flags, the kernel wont build. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 8ed97872b65b..07155652254d 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -966,7 +966,11 @@ extern int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
#undef C
#define C(a, b) TRACE_ITER_##a##_BIT
-enum trace_iterator_bits { TRACE_FLAGS };
+enum trace_iterator_bits {
+ TRACE_FLAGS
+ /* Make sure we don't go more than we have bits for */
+ TRACE_ITER_LAST_BIT
+};
/*
* By redefining C, we can make TRACE_FLAGS a list of masks that