aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-08-06 22:33:22 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-08-26 00:32:06 -0400
commit43b51ead3f752a3935116e5b1a94254b8573734f (patch)
tree5d9e88635c85ba7b1d273dea3c4d8d96e5000154 /kernel/trace/trace_events.c
parentaa38e9fc3ea804290efd3a39316d7f7e6c945800 (diff)
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>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 5740e90f4ca1..d33bcdeffe69 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -28,7 +28,8 @@ DEFINE_MUTEX(event_mutex);
28LIST_HEAD(ftrace_events); 28LIST_HEAD(ftrace_events);
29 29
30int trace_define_field(struct ftrace_event_call *call, const char *type, 30int trace_define_field(struct ftrace_event_call *call, const char *type,
31 const char *name, int offset, int size, int is_signed) 31 const char *name, int offset, int size, int is_signed,
32 int filter_type)
32{ 33{
33 struct ftrace_event_field *field; 34 struct ftrace_event_field *field;
34 35
@@ -44,7 +45,11 @@ int trace_define_field(struct ftrace_event_call *call, const char *type,
44 if (!field->type) 45 if (!field->type)
45 goto err; 46 goto err;
46 47
47 field->filter_type = filter_assign_type(type); 48 if (filter_type == FILTER_OTHER)
49 field->filter_type = filter_assign_type(type);
50 else
51 field->filter_type = filter_type;
52
48 field->offset = offset; 53 field->offset = offset;
49 field->size = size; 54 field->size = size;
50 field->is_signed = is_signed; 55 field->is_signed = is_signed;
@@ -68,7 +73,7 @@ EXPORT_SYMBOL_GPL(trace_define_field);
68 ret = trace_define_field(call, #type, "common_" #item, \ 73 ret = trace_define_field(call, #type, "common_" #item, \
69 offsetof(typeof(ent), item), \ 74 offsetof(typeof(ent), item), \
70 sizeof(ent.item), \ 75 sizeof(ent.item), \
71 is_signed_type(type)); \ 76 is_signed_type(type), FILTER_OTHER); \
72 if (ret) \ 77 if (ret) \
73 return ret; 78 return ret;
74 79