diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-12-15 02:39:38 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-30 10:27:06 -0500 |
commit | fb7ae981cb9fe8665b9da97e8734745e030c151d (patch) | |
tree | 7b127c1bd4c0457c30f57d0f9c6ceacf69ab88c2 | |
parent | e96dc9674cb597de4fee757ed005c8465072d13f (diff) |
tracing: Fix sign fields in ftrace_define_fields_##call()
Add is_signed_type() call to trace_define_field() in ftrace macros.
The code previously just passed in 0 (false), disregarding whether
or not the field was actually a signed type.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4B273D3A.6020007@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | include/trace/ftrace.h | 7 | ||||
-rw-r--r-- | kernel/trace/trace_export.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 73523151a731..c6fe03e902ca 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -414,7 +414,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
414 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 414 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
415 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 415 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
416 | offsetof(typeof(field), item), \ | 416 | offsetof(typeof(field), item), \ |
417 | sizeof(field.item), 0, FILTER_OTHER); \ | 417 | sizeof(field.item), \ |
418 | is_signed_type(type), FILTER_OTHER); \ | ||
418 | if (ret) \ | 419 | if (ret) \ |
419 | return ret; | 420 | return ret; |
420 | 421 | ||
@@ -422,8 +423,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
422 | #define __dynamic_array(type, item, len) \ | 423 | #define __dynamic_array(type, item, len) \ |
423 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ | 424 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ |
424 | offsetof(typeof(field), __data_loc_##item), \ | 425 | offsetof(typeof(field), __data_loc_##item), \ |
425 | sizeof(field.__data_loc_##item), 0, \ | 426 | sizeof(field.__data_loc_##item), \ |
426 | FILTER_OTHER); | 427 | is_signed_type(type), FILTER_OTHER); |
427 | 428 | ||
428 | #undef __string | 429 | #undef __string |
429 | #define __string(item, src) __dynamic_array(char, item, -1) | 430 | #define __string(item, src) __dynamic_array(char, item, -1) |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 458e5bfe26d0..d4fa5dc1ee4e 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -158,7 +158,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ | |||
158 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 158 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
159 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 159 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
160 | offsetof(typeof(field), item), \ | 160 | offsetof(typeof(field), item), \ |
161 | sizeof(field.item), 0, FILTER_OTHER); \ | 161 | sizeof(field.item), \ |
162 | is_signed_type(type), FILTER_OTHER); \ | ||
162 | if (ret) \ | 163 | if (ret) \ |
163 | return ret; | 164 | return ret; |
164 | 165 | ||
@@ -168,8 +169,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ | |||
168 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 169 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
169 | offsetof(typeof(field), \ | 170 | offsetof(typeof(field), \ |
170 | container.item), \ | 171 | container.item), \ |
171 | sizeof(field.container.item), 0, \ | 172 | sizeof(field.container.item), \ |
172 | FILTER_OTHER); \ | 173 | is_signed_type(type), FILTER_OTHER); \ |
173 | if (ret) \ | 174 | if (ret) \ |
174 | return ret; | 175 | return ret; |
175 | 176 | ||