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:
- Used menuconfig and enabled all the options under KernelHacking->Tracers. The final .config which was generated had all the ftrace options enabled.
- Created new system and boot images with the generated zImage.
- If I try doing mount -t debugfs nodev /sys/kernel/debug I get a message saying 'mount: Device or resource busy'. I guess it is already mounted. I tried unmounting and remounting it but that didn't do anything for me.
- Now in adb shell I can already see /sys/kernel/debug created. But if I look into available_tracers all I can see are blk and nop.
- Now if I run the output the trace file this is what I get:
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