Android Systrace tool internally uses strace or ftrace?
Asked Answered
D

1

7

Systrace Android tool calls internally a tool called atrace which is and extension of ftrace or strace (Linux tools).

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

Doing some reseach over the Internet I found that strace is a predecessor of ftrace: http://crtags.blogspot.de/2012/04/dtrace-ftrace-ltrace-strace-so-many-to.html

Looking to Android Source Code, the most "internal" reference that I found is Trace.h file: http://androidxref.com/4.1.1/xref/frameworks/native/include/utils/Trace.h

I think that this file is then resolved to a native Linux driver.

However, I'm still unable to know if this implementation driver belongs to strace or ftrace. "Normally", it should be ftrace because it is newer, but in that case I don't know why we can not run ftrace from the emulator. In contrast, strace is completely available from the emulator.

Then, does someone knows if Systrace Android tool uses at a very low level strace or ftrace?

Thank you!

Dennadennard answered 8/4, 2013 at 12:6 Comment(0)
D
7

I've follow the instructions found here, related to ftrace,: http://www.linuxforu.com/2010/11/kernel-tracing-with-ftrace-part-1/

Everything works perfect. I wasn't able to execute ftrace before because interacting and retrieving data is done via logical paths.

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

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

atrace makes configuration process easier, so we can access to trace information the following way:

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

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

All indicated examples were successfully executed in my environment using adb shell.

Interaction and access to results of both tools are very different.

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

strace is also supported but serves to another purposes and is not related to systrace.

Regards,

Dennadennard answered 9/4, 2013 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.