Re: [PATCH][RESEND] ftrace: Add a script to produce a hierarchical view of a function trace

From: Frédéric Weisbecker
Date: Sun Oct 26 2008 - 19:26:45 EST


2008/10/27 Steven Rostedt <rostedt@xxxxxxxxxxx>:
>
>
> On Sun, 26 Oct 2008, Frederic Weisbecker wrote:
>
>> This script parses a function trace and then produces a hierarchical view of the
>> function call stack after processing it into a tree.
>>
>> You can see the result on attachment. You will find the raw trace and the hierarchical view.
>
> Very nice and useful tool!
>
> Just one thing...
>
>>
>> Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
>> ---
>> diff --git a/scripts/draw_functrace.py b/scripts/draw_functrace.py
>> new file mode 100755
>> index 0000000..e6496bd
>> --- /dev/null
>> +++ b/scripts/draw_functrace.py
>> @@ -0,0 +1,119 @@
>> +#!/usr/bin/python
>> +
>> +"""
>> +Copyright 2008 (c) Frederic Weisbecker <fweisbec@xxxxxxxxx>
>> +Licensed under the terms of the GNU GPL License version 2
>> +
>> +This script parses a trace provided by the function tracer in
>> +kernel/trace/trace_functions.c
>> +The resulted trace is processed into a tree to produce a more human
>> +view of the call stack by drawing textual but hierarchical tree of
>> +calls. Only the functions's names and the the call time are provided.
>> +
>> +Usage:
>> + Be sure that you have CONFIG_FUNCTION_TRACER
>> + # mkdir /debugfs
>> + # mount -t debug debug /debug
>> + # echo function > /debug/tracing/current_tracer
>> + # cat /debug/tracing/current_tracer > ~/raw_trace_func
>
> Do you really mean to write "function" into ~/raw_trace_func?


Oops. No I wanted to write

cat /debug/tracing/trace_pipe > ~/raw_trace_func

> Also, I just tried this out (replacing current_tracer with trace) and I
> just get ---Root (Nowhere)

Really? Could you send me your trace? Perhaps a problem with the
regular expression.
--
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/