|
From: Frederic W. <fwe...@gm...> - 2009-10-03 00:57:05
|
On Fri, Sep 25, 2009 at 11:20:54AM -0700, Masami Hiramatsu wrote:
> Check result of create_event_dir() and add ftrace_event_call to
> ftrace_events list only if it is succeeded. Thanks Li for pointing it out.
>
> Signed-off-by: Masami Hiramatsu <mhi...@re...>
> Cc: Steven Rostedt <ro...@go...>
> Cc: Jim Keniston <jke...@us...>
> Cc: Ananth N Mavinakayanahalli <an...@in...>
> Cc: Andi Kleen <ak...@li...>
> Cc: Christoph Hellwig <hc...@in...>
> Cc: Frank Ch. Eigler <fc...@re...>
> Cc: Frederic Weisbecker <fwe...@gm...>
> Cc: H. Peter Anvin <hp...@zy...>
> Cc: Ingo Molnar <mi...@el...>
> Cc: Jason Baron <jb...@re...>
> Cc: K.Prasad <pr...@li...>
> Cc: Lai Jiangshan <la...@cn...>
> Cc: Li Zefan <li...@cn...>
> Cc: Peter Zijlstra <pe...@in...>
> Cc: Srikar Dronamraju <sr...@li...>
> Cc: Tom Zanussi <tza...@gm...>
> ---
>
> kernel/trace/trace_events.c | 29 +++++++++++++++++++++--------
> 1 files changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index a4b7c9a..f03cda3 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -957,12 +957,14 @@ static int __trace_add_event_call(struct ftrace_event_call *call)
> if (!d_events)
> return -ENOENT;
>
> - list_add(&call->list, &ftrace_events);
> 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);
> + pr_warning("Could not create directory of trace events/%s\n",
> + call->name);
We already have such warnings in event_create_dir, with even more granularity
against the failure reason. The patch is fine, but I'll just remove the warning
introduced inside while applying it.
Thanks.
PS: Also I guess we could add the event in the list right from
event_create_dir()...
|