tracing/filters: distinguish between signed and unsigned fields
The new filter comparison ops need to be able to distinguish between signed and unsigned field types, so add an is_signed flag/param to the event field struct/trace_define_fields(). Also define a simple macro, is_signed_type() to determine the signedness at compile time, used in the trace macros. If the is_signed_type() macro won't work with a specific type, a new slightly modified version of TRACE_FIELD() called TRACE_FIELD_SIGN(), allows the signedness to be set explicitly. [ Impact: extend trace-filter code for new feature ] Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: fweisbec@gmail.com Cc: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <1240905893.6416.120.camel@tropicana> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -26,7 +26,7 @@ static DEFINE_MUTEX(event_mutex);
|
||||
LIST_HEAD(ftrace_events);
|
||||
|
||||
int trace_define_field(struct ftrace_event_call *call, char *type,
|
||||
char *name, int offset, int size)
|
||||
char *name, int offset, int size, int is_signed)
|
||||
{
|
||||
struct ftrace_event_field *field;
|
||||
|
||||
@@ -44,6 +44,7 @@ int trace_define_field(struct ftrace_event_call *call, char *type,
|
||||
|
||||
field->offset = offset;
|
||||
field->size = size;
|
||||
field->is_signed = is_signed;
|
||||
list_add(&field->link, &call->fields);
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user