summaryrefslogtreecommitdiffstats
path: root/include/trace/trace_events.h
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2018-05-10 18:40:21 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-05-29 14:29:13 +0200
commit4a0772cf0674346f3c1ff1043e440523b7e3131b (patch)
tree671556af17697d8aca4e28fc7de0e74c9109a924 /include/trace/trace_events.h
parenttracing: Have zero size length in filter logic be full string (diff)
downloadlinux-4a0772cf0674346f3c1ff1043e440523b7e3131b.tar.xz
linux-4a0772cf0674346f3c1ff1043e440523b7e3131b.zip
tracing: Prevent further users of zero size static arrays in trace events
A zero size static array has special meaning in the ftrace infrastructure. Trace events are for recording data in the trace buffers that is normally difficult to obtain via probes or function tracing. There is no reason for any trace event to declare a zero size static array. If one does, BUILD_BUG_ON() will trigger and prevent the kernel from compiling. Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/trace/trace_events.h')
-rw-r--r--include/trace/trace_events.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index bfda803b0a09..4ecdfe2e3580 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -422,6 +422,7 @@ static struct trace_event_functions trace_event_type_funcs_##call = { \
do { \
char *type_str = #type"["__stringify(len)"]"; \
BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
+ BUILD_BUG_ON(len <= 0); \
ret = trace_define_field(event_call, type_str, #item, \
offsetof(typeof(field), item), \
sizeof(field.item), \