FTrace in Android

310 views
Skip to first unread message

nitin barthwal

unread,
Jun 25, 2013, 3:02:53 AM6/25/13
to android-...@googlegroups.com
Hello

I am Nitin , and I am trying to learn FTrace for Kernel Debugging in Android Platform using JBP ,Kernel  3.4.0  . I am facing a few challenges .

My question  --

1)   First of all if I checked the available_tracers folder and came to know that I have -
       cat available_tracers
       wakeup_rt   wakeup   nop

I want to use function tracer , but it is not available in available_tracers list.

So how can I use function tracer.??
 
2)   After I succeed in making current_tracer to function , How to use this  ? How can I do actual debugging checking by referring trace file..

Please help me with queries.


Thanks & Regards
Nitin Barthwal

cary....@gmail.com

unread,
Jun 25, 2013, 9:19:33 AM6/25/13
to android-...@googlegroups.com, nitin barthwal
On 06/25/2013 03:02 PM, nitin barthwal wrote:
> Hello
>
> I am Nitin , and I am trying to learn FTrace for Kernel Debugging in
> Android Platform using JBP ,Kernel 3.4.0 . I am facing a few
> challenges .
>
> My question --
>
> 1) First of all if I checked the available_tracers folder and came
> to know that I have -
> cat available_tracers
> wakeup_rt wakeup nop
> I want to use function tracer , but it is not available in
> available_tracers list.
>
> So how can I use function tracer.??

First you need configure function tracer in kernel.
>
> 2) After I succeed in making current_tracer to function , How to use
> this ? How can I do actual debugging checking by referring trace file..
>
> Please help me with queries.
you need to
echo function > current_tracer
echo 1 > /proc/sys/kernel/ftrace_enabled
echo 1 > tracing_on
echo 1 > tracing_enabled
cat trace
>
>
> Thanks & Regards
> Nitin Barthwal
>
> --
> You received this message because you are subscribed to the Google
> Groups "android-platform" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to android-platfo...@googlegroups.com.
> To post to this group, send email to android-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-platform.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Glenn Kasten

unread,
Jun 25, 2013, 10:00:02 AM6/25/13
to android-...@googlegroups.com, nitin barthwal
Look at the configuration options named CONFIG_FTRACE and CONFIG_*_TRACER. 

James Snee

unread,
Jun 25, 2013, 10:23:45 AM6/25/13
to android-...@googlegroups.com
Hi Nitin,

As with other responses, you first need to re-compile the Kernel with support for the function tracer. If you use menuconfig then most of the tracing options are in the 'kernel hacking' sub-category. Most importantly in your case you want to enable the function tracer here. When built and booted you can enable the function tracer in the same way as the other tracers.

The trace is written to the 'trace' file and as mentioned by others, you can just cat this to make sure it's being written to. 

Remember that FTrace writes into a small ring buffer, which means that traces can be quite short. If you want to trace for longer periods of time I would recommend looking into the trace pipe. 

HTH

James
Reply all
Reply to author
Forward
0 new messages