[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090202195021.83bd0b80.akpm@linux-foundation.org>
Date: Mon, 2 Feb 2009 19:50:21 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Arjan van de Ven <arjan@...radead.org>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 2/3] trace: fix default boot up tracer
On Mon, 02 Feb 2009 21:38:32 -0500 Steven Rostedt <rostedt@...dmis.org> wrote:
> @@ -510,8 +520,25 @@ int register_tracer(struct tracer *type)
> out:
> tracing_selftest_running = false;
> mutex_unlock(&trace_types_lock);
> - 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;
> }
The fun and games which register_tracer() plays with lock_kernel() tell
us that this function is only called at bootup time and hence could be
__init. A quick whizz through callers confirms that.
And if register_tracer() is also only callable at bootup, one suspects
that unregister_tracer() isn't useful. And lo, it has no callers.
This leads one to further surmise that trace_types_lock a) could be
__initdata and b) could be removed (the list is only altered when we're
running single-threaded). This appears to be the case.
--
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