[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1336486760.14207.176.camel@gandalf.stny.rr.com>
Date: Tue, 08 May 2012 10:19:20 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: fweisbec@...il.com, mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] ftrace: No return value for ftrace_process_locs
On Wed, 2012-04-25 at 10:23 +0200, Jiri Olsa wrote:
> The return value of ftrace_process_locs is never checked. The function
> tries to update as many calls as possible and in case of error there's
> either warning output or ftrace_bug call.
>
> Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> ---
> kernel/trace/ftrace.c | 37 ++++++++++++++++---------------------
> 1 files changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index b3ceecd..e67f5b3 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1930,7 +1930,7 @@ static int ops_traces_mod(struct ftrace_ops *ops)
> return ftrace_hash_empty(hash);
> }
>
> -static int ftrace_update_code(struct module *mod)
> +static void ftrace_update_code(struct module *mod)
> {
> struct ftrace_page *pg;
> struct dyn_ftrace *p;
> @@ -1959,7 +1959,7 @@ static int ftrace_update_code(struct module *mod)
> for (i = 0; i < pg->index; i++) {
> /* If something went wrong, bail without enabling anything */
> if (unlikely(ftrace_disabled))
> - return -1;
> + return;
>
> p = &pg->records[i];
> p->flags = ref;
> @@ -1968,8 +1968,8 @@ static int ftrace_update_code(struct module *mod)
> * Do the initial record conversion from mcount jump
> * to the NOP instructions.
> */
> - if (!ftrace_code_disable(mod, p))
> - break;
> + if (WARN_ON_ONCE(!ftrace_code_disable(mod, p)))
> + return;
Why the warning? If ftrace_disabled is set, something broke a long time
ago, and the ftrace_bug gives its own warning.
I don't think this is needed.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists