gprof

411 views
Skip to first unread message

marij...@gmail.com

unread,
Jan 14, 2015, 7:01:47 PM1/14/15
to native-cli...@googlegroups.com
In toolchange there is gprof, but how can gmon.out be generated for nexe?
(I stuck at:
x86_64-nacl-g++ a.cpp -pg -o out
.../nacl_sdk/pepper_39/toolchain/linux_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/bin/ld: cannot find gcrt1.o: No such file or directory)

Is there any other tool for profiling nexe?

Thanks

Soeren Balko

unread,
Feb 13, 2015, 11:32:01 PM2/13/15
to native-cli...@googlegroups.com
Having the same problem, but was able to locate gcrt1.o / crt1.o in the toolchain (just look for those files and make sure to add them to the linker command). 

marij...@gmail.com

unread,
Feb 18, 2015, 10:22:30 AM2/18/15
to native-cli...@googlegroups.com
- with toolchain newlib there is error: /x86_64-nacl-ld: cannot find gcrt1.o 
- with toolchain  glibc there is error: undefined reference to `_mcount'
(with pepper_39, pepper_40)

Where did you find gcrt1.o / crt1.o  for newlib?

Derek Schuff

unread,
Feb 23, 2015, 12:31:00 PM2/23/15
to native-cli...@googlegroups.com
Hi Soeren and marijana,
Currently neither nacl-gcc nor clang supports profiling via gprof. This is something we'd be interested in supporting sometime but aside from just implementing the profiling runtime unter nacl (gcrt1.o etc) there would have to be additional plumbing in the browser to get the data out of the Chromium sandbox. Some have had some success using system-wide profilers like CodeAnalyst or VTune on Windows or oprofile or perf on Linux. The one complication with that is that the profilers on 64-bit systems don't understand the nexe's code addresses (which are 32-bit addresses from the nexe added to a base register which is different for every run). That can be worked around with some scripting, but it's definitely more painful than it should be. Theres also an experimental tool called xray in the NaCl source tree ( https://chromium.googlesource.com/native_client/src/native_client.git/+/master/tools/xray/ ) that you can build directly into your code to instrument it, and then you can programatically do whatever you want with the information.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages