summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorFilipe Brandenburger2014-03-01 06:32:16 +0100
committerSteven Rostedt2014-03-07 16:06:10 +0100
commit5859fa1a146ef5bf79953767f4ceb546fe4214b3 (patch)
tree7e46fd7e6faa3baa903a5b3fea1649b7d5d7d6bc /include/trace
parenttracing/module: Replace include of tracepoint.h with jump_label.h in module.h (diff)
downloadkernel-qcow2-linux-5859fa1a146ef5bf79953767f4ceb546fe4214b3.tar.gz
kernel-qcow2-linux-5859fa1a146ef5bf79953767f4ceb546fe4214b3.tar.xz
kernel-qcow2-linux-5859fa1a146ef5bf79953767f4ceb546fe4214b3.zip
tracing: Correctly expand len expressions from __dynamic_array macro
This fixes expansion of the len argument in __dynamic_array macros. The previous code from commit 7d536cb3f would not fully evaluate the expression before multiplying its result by the size of the type. This went unnoticed because the length stored in the high 16 bits of the offset (which is the one that was broken here) is only used by filter_pred_strloc which only acts on strings for which the size of the type is 1. Link: http://lkml.kernel.org/r/1393651938-16418-2-git-send-email-filbranden@google.com Signed-off-by: Filipe Brandenburger <filbranden@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/ftrace.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 1cc2265caa52..21250056b7da 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -363,7 +363,7 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
#define __dynamic_array(type, item, len) \
__data_offsets->item = __data_size + \
offsetof(typeof(*entry), __data); \
- __data_offsets->item |= (len * sizeof(type)) << 16; \
+ __data_offsets->item |= ((len) * sizeof(type)) << 16; \
__data_size += (len) * sizeof(type);
#undef __string