tracing/filters: Add __field_ext() to TRACE_EVENT

Add __field_ext(), so a field can be assigned to a specific
filter_type, which matches a corresponding filter function.

For example, a later patch will allow this:
	__field_ext(const char *, str, FILTER_PTR_STR);

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A7B9272.6050709@cn.fujitsu.com>

[
  Fixed a -1 to FILTER_OTHER
  Forward ported to latest kernel.
]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Li Zefan
2009-08-07 10:33:22 +08:00
committed by Steven Rostedt
parent aa38e9fc3e
commit 43b51ead3f
6 changed files with 49 additions and 22 deletions

View File

@@ -28,7 +28,8 @@ DEFINE_MUTEX(event_mutex);
LIST_HEAD(ftrace_events);
int trace_define_field(struct ftrace_event_call *call, const char *type,
const char *name, int offset, int size, int is_signed)
const char *name, int offset, int size, int is_signed,
int filter_type)
{
struct ftrace_event_field *field;
@@ -44,7 +45,11 @@ int trace_define_field(struct ftrace_event_call *call, const char *type,
if (!field->type)
goto err;
field->filter_type = filter_assign_type(type);
if (filter_type == FILTER_OTHER)
field->filter_type = filter_assign_type(type);
else
field->filter_type = filter_type;
field->offset = offset;
field->size = size;
field->is_signed = is_signed;
@@ -68,7 +73,7 @@ EXPORT_SYMBOL_GPL(trace_define_field);
ret = trace_define_field(call, #type, "common_" #item, \
offsetof(typeof(ent), item), \
sizeof(ent.item), \
is_signed_type(type)); \
is_signed_type(type), FILTER_OTHER); \
if (ret) \
return ret;