Re: [PATCH] tracing, function_graph: simplify test for tracing

From: Frederic Weisbecker
Date: Wed Jan 13 2010 - 09:55:12 EST


On Wed, Jan 13, 2010 at 07:38:30PM +0800, Lai Jiangshan wrote:
>
> For function_graph, a calling function is to be traced only when
> it is enabled or it is nested in a enabled function.
>
> Current code uses TSK_TRACE_FL_GRAPH to test whether it is nested or not.
> read the code, we can get this:
> (trace->depth > 0) <==> (TSK_TRACE_FL_GRAPH is set)
>
> trace->depth is more explicit to tell that it is nested.
> So we use trace->depth directly and simplify the code.
>
> No functionality is changed.
> TSK_TRACE_FL_GRAPH is not removed now, it is left for future usage.
>
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> ---


Looks prety good to me. Nice simplification, the less checks we
have in this hot path, the better.

Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>

--
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/