Re: [PATCH] ftrace: fix current_tracer error return

From: Frédéric Weisbecker
Date: Tue Oct 28 2008 - 21:09:35 EST


2008/10/29 Steven Rostedt <rostedt@xxxxxxxxxxx>:
>
> On Wed, 29 Oct 2008, Fr?d?ric Weisbecker wrote:
>> >
>> > My test scripts automatically set or unset /proc/sys/kernel/ftrace_enabled
>> >
>> > I believe I wanted that to be default off when dynamic ftrace was not
>> > active. Currently, it really shouldn't matter, because there's a check to
>> > make sure that ftrace has a registered function before calling it.
>> >
>> > That was just my preference. But if you find it less confusing, then
>> > having ftrace_enabled as default on even when dynamic ftrace is not
>> > enabled, is fine with me.
>> >
>> > -- Steve
>> >
>> >
>>
>> Thanks. I guess this bug was there for several days. But since I
>
> But this was not a bug :-/
>
> I believe I purposely set it that way. The bug was that you did not know
> that you could enable it with /proc/sys/kernel/ftrace_enabled ;-)

Ah ok. I better understand now.
But IMHO I guess that would better for developpers who will use
it to have something directly enabled whithout touching this file at each start.

>
>> always used dynamic ftrace, I've not
>> seen it until yesterday. (BTW I didn't tested with dynamic since this
>> patch). I had one other bug that made the set of
>> function tracer blocking during the write on current_trace with
>> dynamic ftrace. I will have a look on it.
>
> Hmm, that could be a bug, but I do not know the details.
>
>>
>> Actually one thing that makes me a bit confused is the use of these
>> two vars: ftrace_enabled and ftrace_disabled.
>> They are not used for the same purpose but their name suggest the same
>> role.... :-)
>
> Well, the code documents it pretty well:
>
> /* ftrace_enabled is a method to turn ftrace on or off */
> int ftrace_enabled __read_mostly;
> static int last_ftrace_enabled;
>
> /*
> * ftrace_disabled is set when an anomaly is discovered.
> * ftrace_disabled is much stronger than ftrace_enabled.
> */
> static int ftrace_disabled __read_mostly;

Oops... I missed it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/