lkml.org 
[lkml]   [2009]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/13] tracing: Extract calls to trace_define_common_fields()
Li Zefan wrote:
> Call trace_define_common_fields() in event_create_dir() only.
>
> text data bss dec hex filename
> 5346802 1961864 7103260 14411926 dbe896 vmlinux.o.old
> 5345151 1961864 7103260 14410275 dbe223 vmlinux.o
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>

I think this is a urgent patch for mainline.

I have found a regression at trace_kprobe, and I'm lucky to find that this
patch can also fix this regression.


> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1113,10 +1113,6 @@ static int kprobe_event_define_fields(struct ftrace_event_call *event_call)
> struct kprobe_trace_entry field;
> struct trace_probe *tp = (struct trace_probe *)event_call->data;
>
> - ret = trace_define_common_fields(event_call);
> - if (!ret)
> - return ret;
> -
> DEFINE_FIELD(unsigned long, ip, FIELD_STRING_IP, 0);
> DEFINE_FIELD(int, nargs, FIELD_STRING_NARGS, 1);
> /* Set argument names as fields */
> @@ -1131,10 +1127,6 @@ static int kretprobe_event_define_fields(struct ftrace_event_call *event_call)
> struct kretprobe_trace_entry field;
> struct trace_probe *tp = (struct trace_probe *)event_call->data;
>
> - ret = trace_define_common_fields(event_call);
> - if (!ret)
> - return ret;
> -
> DEFINE_FIELD(unsigned long, func, FIELD_STRING_FUNC, 0);
> DEFINE_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP, 0);
> DEFINE_FIELD(int, nargs, FIELD_STRING_NARGS, 1);

"if (!ret)" is wrong. trace_define_common_fields() returns zero when success.
So "unsigned long, func", "unsigned long, ret_ip" ...etc are NOT "defined"
and filters can not be applied for trace_kprobe.

Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>



\
 
 \ /
  Last update: 2009-12-08 06:39    [W:0.158 / U:2.884 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site