From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Arjan van de Ven <arjan@infradead.org>,
Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 2/3] trace: fix default boot up tracer
Date: Tue, 3 Feb 2009 06:29:13 +0100 [thread overview]
Message-ID: <20090203052913.GC28361@elte.hu> (raw)
In-Reply-To: <20090203024358.332574797@goodmis.org>
* Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> Peter Zijlstra started the functionality to start up a default
> tracing at bootup. This patch finishes the work.
>
> Now if you add 'ftrace=<tracer>' to the command line, when that tracer
> is registered on bootup, that tracer is selected and starts tracing.
>
> Note, all selftests for tracers that are registered after this tracer
> is disabled. This prevents the selftests from disturbing the running
> tracer, or the running tracer from disturbing the selftest.
>
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
> kernel/trace/trace.c | 60 +++++++++++++++++++++++++++++++++++++++++++++-----
> 1 files changed, 54 insertions(+), 6 deletions(-)
applied to tip/tracing/ftrace, thanks Steve!
This portion is a bit ugly:
> - lock_kernel();
>
> + if (!ret && default_bootup_tracer) {
> + if (!strncmp(default_bootup_tracer, type->name,
> + BOOTUP_TRACER_SIZE)) {
> + printk(KERN_INFO "Starting tracer '%s'\n",
> + type->name);
> + /* Do we want this tracer to start on bootup? */
> + tracing_set_tracer(type->name);
> + default_bootup_tracer = NULL;
> + /* disable other selftests, since this will break it. */
> + tracing_selftest_disabled = 1;
> +#ifdef CONFIG_FTRACE_STARTUP_TEST
> + printk(KERN_INFO "Disabling FTRACE selftests due"
> + " to running tracer '%s'\n", type->name);
> +#endif
> + }
> + }
> +
> + lock_kernel();
> return ret;
This could be done as:
if (ret || default_bootup_tracer)
goto out_relock;
if (strncmp(default_bootup_tracer, type->name, BOOTUP_TRACER_SIZE))
goto out_relock;
...
out_relock:
lock_kernel();
return ret;
And we lose a lot of crappy linebreaks that way as well - beyond making the
purpose of the BKL bits clearer. Hm?
Ingo
next prev parent reply other threads:[~2009-02-03 5:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 2:38 [PATCH 0/3] ftrace: updates for tip Steven Rostedt
2009-02-03 2:38 ` [PATCH 1/3] trace: disable branch tracer on alpha Steven Rostedt
2009-02-03 5:19 ` Ingo Molnar
2009-02-03 2:38 ` [PATCH 2/3] trace: fix default boot up tracer Steven Rostedt
2009-02-03 3:50 ` Andrew Morton
2009-02-03 4:12 ` Steven Rostedt
2009-02-03 4:20 ` Andrew Morton
2009-02-03 4:33 ` Steven Rostedt
2009-02-03 5:00 ` Andrew Morton
2009-02-03 5:29 ` Ingo Molnar [this message]
2009-02-03 9:26 ` Frederic Weisbecker
2009-02-03 2:38 ` [PATCH 3/3] trace: let boot trace be chosen by command line Steven Rostedt
2009-02-03 5:31 ` Ingo Molnar
2009-02-03 9:31 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090203052913.GC28361@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox