How to interpret qemu trace files / qtools / traceview

194 views
Skip to first unread message

martin d.

unread,
Nov 26, 2008, 6:27:34 AM11/26/08
to android-platform
Hello,

I am trying to measure how much overhead IPC in Android causes.
For this I do a simple calculation of some random numbers once
in one Activity and a second time via a Service. When I compare
the run times, calculation via a Service is only about 20% as fast.

The time comparison does not say much about how much CPU time
is used. To get more details I would like to use qemu's -trace
switch [1].

Now I don't know what to do with the trace files named
qtrace.[bb, exc, insn, method, pid, static). The qtools from
android-src/development/emulator/qtools offer the executables
bb2sym, bbprof, bb_dump and check_trace. Can anyone give me some
hints on how to use those? They do produce a lot of output which
I don't know how to interpret.

Also the traceview tool which can be used to view traces gathered
with startMethodTracing() (android.os.Debug) looks quite good. Is
there
a way to convert the qemu trace files so they can be read with
traceview?

Thanks,

MartinD:

[1] http://code.google.com/android/reference/android/os/Debug.html#startNativeTracing()

Dianne Hackborn

unread,
Nov 26, 2008, 12:31:47 PM11/26/08
to android-...@googlegroups.com
On Wed, Nov 26, 2008 at 3:27 AM, martin d. <mailmar...@gmx.de> wrote:
I am trying to measure how much overhead IPC in Android causes.
For this I do a simple calculation of some random numbers once
in one Activity and a second time via a Service. When I compare
the run times,  calculation via a Service is only about 20% as fast.

The time comparison does not say much about how much CPU time
is used. To get more details I would like to use qemu's -trace
switch [1].

I'm not sure why you say it doesn't tell you how much CPU time is used?  All of that overhead should be CPU time.  What else would it be?

Unfortunately I can't help with using traceview, but yes there is a way to show emulator traces in it.

--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support.  All such questions should be posted on public forums, where I and others can see and answer them.

fadden

unread,
Nov 26, 2008, 4:33:11 PM11/26/08
to android-platform
On Nov 26, 3:27 am, "martin d." <mailmartin....@gmx.de> wrote:
> Also the traceview tool which can be used to view traces gathered
> with startMethodTracing() (android.os.Debug) looks quite good. Is
> there
> a way to convert the qemu trace files so they can be read with
> traceview?

This applies to an emulator run from git sources...

0. Make sure that development/tools/traceview/etc/manifest.txt says
"com.android.traceview.MainWindow" on the first line, not
"com.google". If it doesn't, change it, remove out/host/common/obj/
JAVA_LIBRARIES/traceview_intermediates/javalib.jar, and rebuild.
(Otherwise, "traceview" won't start. The current sources are correct,
so if you're synced up with git you're fine.)

1. Start the emulator with the trace flag, e.g. "emulator -trace foo".
2. Hit F9 to start tracing. Hit it again to stop tracing.
3. Exit the emulator.
4. Run "tracedmdump foo". tracedmdump is a shell command added when
you sourced "envsetup.sh".
5. "traceview out/target/product/generic/traces/foo/dmtrace".
Reply all
Reply to author
Forward
0 new messages