Does Android Systrace tool internally use strace or ftrace?

Systrace . The Android tool calls inside itself a tool called atrace , which is and extends ftrace or strace (Linux tools).

If we connect via the emulator console (ADB shell) to Android Jelly Bean, we can execute the strace tool, but cannot execute the ftrace strong> tool (the command is not installed).

While doing some research on the Internet, I found that strace is the predecessor of ftrace : http://crtags.blogspot.de/2012/04/dtrace-ftrace-ltrace-strace-so-many-to.html

Searching for Android source code, the most “internal” link I found is Trace.h : http://androidxref.com/4.1.1/xref/frameworks/native/include/utils/Trace.h

I think this file is then resolved for the native Linux driver.

However, I still cannot know whether this implementation driver applies to strace or ftrace . “Usually,” it must be ftrace because it is newer, but in this case I don’t know why we cannot run ftrace from the emulator. In contrast, strace is fully accessible from the emulator.

Then someone knows if the Systrace tool Android uses very low strace or ftrace ?

Thanks!

+6
source share
1 answer

I follow the instructions for ftrace here : http://www.linuxforu.com/2010/11/kernel-tracing-with-ftrace-part-1/

Everything works perfectly. I have not been able to execute ftrace before, because the interaction and retrieval of data is done using logical paths.

To execute ftrace , after the correct configuration (many steps ...) inside the adb shell:

root@android :# cat /sys/kernel/debug/tracing/trace > mytracefile.txt 

atrace simplifies the configuration process, so we can access the trace information as follows:

 root@android :# atrace -s -w -t 100 > mytracefile.txt 

On the other hand, I found information on executing strace here: http://www.hokstad.com/5-simple-ways-to-troubleshoot-using-strace

All of these examples have been successfully executed in my environment using the adb shell.

The interaction and access to the results of both tools is very different.

Now I can say that the systrace tool for Android is based on atrace , which in turn is based on ftrace .

strace is also supported, but serves other purposes and does not apply to systrace .

Hi,

+5
source

All Articles