Commit fb7ae981 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Steven Rostedt

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: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4B273D3A.6020007@cn.fujitsu.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent e96dc967
...@@ -414,7 +414,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ ...@@ -414,7 +414,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
ret = trace_define_field(event_call, #type "[" #len "]", #item, \ ret = trace_define_field(event_call, #type "[" #len "]", #item, \
offsetof(typeof(field), item), \ offsetof(typeof(field), item), \
sizeof(field.item), 0, FILTER_OTHER); \ sizeof(field.item), \
is_signed_type(type), FILTER_OTHER); \
if (ret) \ if (ret) \
return ret; return ret;
...@@ -422,8 +423,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ ...@@ -422,8 +423,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
#define __dynamic_array(type, item, len) \ #define __dynamic_array(type, item, len) \
ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \
offsetof(typeof(field), __data_loc_##item), \ offsetof(typeof(field), __data_loc_##item), \
sizeof(field.__data_loc_##item), 0, \ sizeof(field.__data_loc_##item), \
FILTER_OTHER); is_signed_type(type), FILTER_OTHER);
#undef __string #undef __string
#define __string(item, src) __dynamic_array(char, item, -1) #define __string(item, src) __dynamic_array(char, item, -1)
......
...@@ -158,7 +158,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ ...@@ -158,7 +158,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \
BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
ret = trace_define_field(event_call, #type "[" #len "]", #item, \ ret = trace_define_field(event_call, #type "[" #len "]", #item, \
offsetof(typeof(field), item), \ offsetof(typeof(field), item), \
sizeof(field.item), 0, FILTER_OTHER); \ sizeof(field.item), \
is_signed_type(type), FILTER_OTHER); \
if (ret) \ if (ret) \
return ret; return ret;
...@@ -168,8 +169,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ ...@@ -168,8 +169,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \
ret = trace_define_field(event_call, #type "[" #len "]", #item, \ ret = trace_define_field(event_call, #type "[" #len "]", #item, \
offsetof(typeof(field), \ offsetof(typeof(field), \
container.item), \ container.item), \
sizeof(field.container.item), 0, \ sizeof(field.container.item), \
FILTER_OTHER); \ is_signed_type(type), FILTER_OTHER); \
if (ret) \ if (ret) \
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment