Problems with Android Native Tracing

244 views
Skip to first unread message

hongjuan zhang

unread,
Feb 16, 2012, 9:55:40 PM2/16/12
to android-...@googlegroups.com, android-developers
Hi,Everyone
I've been trying to learn the android native code profiling.I start emulator with 'emulator -trace foo',Then press F9 just before I start the browser to start profiling Then press F9 after about 30 sec or so to stop the profiling I then quit the emulator Then I start dumping the trace with 'tracedmdump  tracedmdump ~/.android/avd/avd14.avd/traces/foo/'

I get the following errors:
 generating dexlist output...
generating dmtrace data...
'Cannot read ELF header from '/home/zhj/android/out/target/product/ generic/symbols'
generating html file...
done, see /home/zhj/.android/avd/avd14.avd/traces/foo//dmtrace.html
for details
or run:
   traceview /home/zhj/.android/avd/avd14.avd/traces/foo//dmtrace'

Does anyone know why there;s a lot of errors like "Cannot read ELF header from '/home/zhj/android/out/target/product/generic/symbols"?Perhaps because of it , I cannot get any native method information,I'm so confused.If any one know the reason ,please tell me !I appreciate very much!

yours

Hongjuan Zhang

Vik

unread,
Apr 3, 2012, 6:06:10 PM4/3/12
to Android Building
Hi,

Were you able to resolve this? I am stuck here too!

Also I see that post_trace will report only 2 dynamic blocks which
makes no sense.
I debugging the trace reading mechanism, I have a feeling that the
trace data has a
problem and it does not store the proper "path" for each event. This
is the reason why we
see these errors too.

Thanks,
Vik

Vik

unread,
Apr 18, 2012, 12:06:03 AM4/18/12
to Android Building
People from the future, for your benefit:
I think I found a solution for this particular problem. I debugged
the
goldfish kernel and saw that the data it was dumping tto the
goldfish_trace
device was indeed correct. But after translation, when qemu tries to
execute this store instruction
it is unable to map the guest virtual address to host physical
address. Because of this,
the actual data written to the qtrace* file was incorrect.
This happens because of the call:
vstrcpy() in qemu/hw/goldfish_trace.c
Instead using (as hinted by one of the comments below in that file):
memcheck_get_guest_kernel_string()
helped me get over this issue. Thus the path names are recorded
correctly
and I dont get the "Cannot read ELF header " errors.

That apart, my native code profiling is still broken. I am seeing
several
bad basic blocks recorded!

Thanks,
Vikram
Graduate Student
Department of Computer Science and Engineering
University of California, San Diego
http://www.cse.ucsd.edu/~vibhatt
Reply all
Reply to author
Forward
0 new messages