aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-07-15 22:54:02 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-07-20 11:38:44 -0400
commit7d536cb3fb9993bdcd5a2fbaa6b0670ded4e101c (patch)
tree63c4a6ec6de75d9a2db7d677c768a5f2953fa237 /kernel
parent68fd60a8c8bca6af51805c45f286f0f2572ac977 (diff)
tracing/events: record the size of dynamic arrays
When a dynamic array is defined, we add __data_loc_foo in trace_entry to record the offset of the array, but the size of the array is not recorded, which causes 2 problems: - the event filter just compares the first 2 chars of the strings. - parsers can't parse dynamic arrays. So we encode the size of each dynamic array in the higher 16 bits of __data_loc_foo, while the offset is in lower 16 bits. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <4A5E964A.9000403@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_filter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index b9aae72d13db..1c80ef702b83 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -176,11 +176,13 @@ static int filter_pred_string(struct filter_pred *pred, void *event,
176static int filter_pred_strloc(struct filter_pred *pred, void *event, 176static int filter_pred_strloc(struct filter_pred *pred, void *event,
177 int val1, int val2) 177 int val1, int val2)
178{ 178{
179 unsigned short str_loc = *(unsigned short *)(event + pred->offset); 179 u32 str_item = *(u32 *)(event + pred->offset);
180 int str_loc = str_item & 0xffff;
181 int str_len = str_item >> 16;
180 char *addr = (char *)(event + str_loc); 182 char *addr = (char *)(event + str_loc);
181 int cmp, match; 183 int cmp, match;
182 184
183 cmp = strncmp(addr, pred->str_val, pred->str_len); 185 cmp = strncmp(addr, pred->str_val, str_len);
184 186
185 match = (!cmp) ^ pred->not; 187 match = (!cmp) ^ pred->not;
186 188