Running Android systrace on device

saimonjingai picture saimonjingai · Jun 20, 2013 · Viewed 8.3k times · Source

I'm unable to run the Android SDK tool called systrace.pl because I get errors like:

error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory 

And indeed the /sys/kernel/debug/tracing directory doesn't even exist.

A little research showed I need to enable debugfs with the following command:

mount -o rw,remount -t debugfs none /sys/kernel/debug

Running mount there afterwards indicates the debugfs is running:

#mount
...
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
...

And I have trace enabled (all items) in the developer settings menu. I'm using the stock ROM 4.1.1 on a Samsung Galaxy S3.

There's a lot of articles out there on systrace for Android but nothing seems to solve the problem of no files actually being generated in /sys/kernel/debug/tracing...

Answer

Luis picture Luis · Nov 30, 2013

Take a look at this document:

Tracing on Android 4.3 and higher

To run a trace on Android 4.3 and higher devices:

Make sure the device is connected through a USB cable and is enabled for debugging.

I think that systrace must be run on a device, not an emulator. I'm getting the same error in my emulator.