Cc: Frank Ch. Eigler <fche@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Peter Zijlstra <a.p.zijlstra@...>, Christoph Hellwig <hch@...>, Gregory Haskins <ghaskins@...>, Arnaldo Carvalho de Melo <acme@...>, Thomas Gleixner <tglx@...>, Tim Bird <tim.bird@...>, Sam Ravnborg <sam@...>, Steven Rostedt <srostedt@...>, Paul Mackerras <paulus@...>, Daniel Walker <dwalker@...>
Almost.. I would add :
static int trace_switch_to_enabled;
if (likely(!trace_switch_to_enabled))
return;
And some code to activate the trace_switch_to_enabled variable (ideally
keeping a refcount).
By doing this, we would have the minimum impact on the scheduled when
disabled.
But remember that this trace_switch_to_enabled could be enabled for both
markers and your tracer, so you might need to put a branch at the
beginning of trace_context_switch() too.
Mathieu
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--