lkml.org 
[lkml]   [2009]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 19/24] ftrace: Fix trace_add_event_call() to initialize list
Li Zefan wrote:
>> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
>> index ba34920..83cc2c0 100644
>> --- a/kernel/trace/trace_events.c
>> +++ b/kernel/trace/trace_events.c
>> @@ -1010,9 +1010,12 @@ static int __trace_add_event_call(struct ftrace_event_call *call)
>> return -ENOENT;
>>
>> list_add(&call->list, &ftrace_events);
>> - return event_create_dir(call, d_events, &ftrace_event_id_fops,
>> + ret = event_create_dir(call, d_events, &ftrace_event_id_fops,
>> &ftrace_enable_fops, &ftrace_event_filter_fops,
>> &ftrace_event_format_fops);
>> + if (ret < 0)
>> + list_del(&call->list);
>> + return ret;
>
> seems it's a bit better to call list_add() after event_create_dir()
> returns 0.

Sure, that's another way to do. But I'm afraid that will make a difference
from trace_module_add_events() path.

---
call->mod = mod;
list_add(&call->list, &ftrace_events);
event_create_dir(call, d_events,
&file_ops->id, &file_ops->enable,
&file_ops->filter, &file_ops->format);
---
Anyway, this also needs to check the result of event_create_dir().

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



\
 
 \ /
  Last update: 2009-09-23 10:19    [W:0.063 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site