Kano
Kano

Reputation: 388

ftrace on android?

I've been trying to get ftrace to work on Android, but to no avail. I am using ICS with kernel 3.08. Here are the steps I followed:

tracer: nop

       TASK-PID    CPU#    TIMESTAMP  FUNCTION
          | |       |          |         |
 rb_producer-15    [000]   606.337706: ring_buffer_producer_thread: Starting  ring buffer hammer
 rb_producer-15    [000]   616.264577: ring_buffer_producer_thread: End ring buffer hammer
 rb_producer-15    [000]   616.264606: ring_buffer_producer_thread: RunningConsumer at nice: 19
 rb_producer-15    [000]   616.264609: ring_buffer_producer_thread: RunningProducer at nice: 19
 rb_producer-15    [000]   616.264612: ring_buffer_producer_thread: WARNING!!! This test is running at lowest priority.
 rb_producer-15    [000]   616.264614: ring_buffer_producer_thread: Time:  9932418 (usecs)
 rb_producer-15    [000]   616.264616: ring_buffer_producer_thread: Overruns: 0
 rb_producer-15    [000]   616.264619: ring_buffer_producer_thread: Read:  10514159  (by pages)
 rb_producer-15    [000]   616.264621: ring_buffer_producer_thread: Entries:  3491
 rb_producer-15    [000]   616.264623: ring_buffer_producer_thread: Total:  10517650
 rb_producer-15    [000]   616.264625: ring_buffer_producer_thread: Missed:  0
 rb_producer-15    [000]   616.264626: ring_buffer_producer_thread: Hit:  10517650
 rb_producer-15    [000]   616.264629: ring_buffer_producer_thread: Entriesper millisec: 1058
 rb_producer-15    [000]   616.264630: ring_buffer_producer_thread: 945 ns per entry
 rb_producer-15    [000]   616.264633: ring_buffer_producer_thread: Sleeping for 10 secs
 rb_producer-15    [000]   626.261167: ring_buffer_producer_thread: Starting ring buffer hammer

How do I enable the other tracing options, like function?

It cannot be this difficult, especially when I read about people having used ftrace on Android. There must be something I am missing here.

Any help/suggestions will be highly appreciated.

Thanks!

-Kanav

Upvotes: 2

Views: 1686

Answers (2)

rostedt
rostedt

Reputation: 21

Do not enable RING_BUFFER_BENCHMARK. That's a debug option used to test the ring buffer. Your output shows that it's enabled and is wasting a lot of your CPU.

Upvotes: 2

Kano
Kano

Reputation: 388

Ahh got it. Had forgotten to do a herring_defconfig. Also enabled only the function tracer instead of all of them. Works now.

Upvotes: 0

Related Questions