Re: How to get profile data?
Chris Pickett <[email protected]>
| Newsgroups | gmane.comp.java.vm.sablevm.devel |
|---|---|
| Message-ID | <[email protected]> |
Grzegorz B. Prokopski wrote: > On Tue, 2004-10-26 at 09:50, Chris Pickett wrote: > >>Grzegorz B. Prokopski wrote: >> >>>On Mon, 2004-10-25 at 22:33, fei yang wrote: >>> >>>> I am a student coming from China and I am interesting in GC >>>>Algorithm. Now I write a new algorithm based sablevm1.0.9(include >>>>three parts: class-library-1.0.9, native-library-1.0.9, sablevm-1.0.9) >>>>in RedHat 7.3, with gcc 2.96. but I can't get profile data. >>> >>>Firstly, 1.0.9 is *very* old. You should really be using latest >>>released version, which ATM is 1.1.6. Or, it might turn out, that in > > [...] > >>>In current development versions I added --with-profiling= configure >>>switch, that has two values "gprof" or "nostatic". If you want to >>>use gprof, just use --with-profiling=gprof. If you want to use >>>qprof - you'll need to pass --with-profiling=nostatic. This switch >>>will remove "static" keyword from definitions of many functions of >>>libsablevm, making the functions visible to outside worlds and also >>>profiler (i.e. qprof). >> >>Thanks. Note that when I was profiling I could never get gprof to work >>properly with SableVM -- it doesn't support multiple threads. > > > Actually I don't think SVM 1.0.9 made such extensive use of "static" > keyword as newer versions, so I tend to believe the problem reported > by the original sender was actually a problem with gprof being unable > to track calls made by library. > > So actually it should be possible to profile 1.0.9 quite easily with > any reasonable profiler. I think we should also note that RH 7.3 is > *heavily* obsolete, and so is gprof in gcc 2.96. Well, I tried every profiler I could find and the only useful one was qprof. Again see that CHANGES file in my sandbox for details (I really should rename the file, but whatever). Out-of-the-box gprof does not work with multithreaded systems [1], you need a patch [2]. Even with the patch applied, I still couldn't get it to work (whereas I got usable results out of qprof, even with the static and inline keywords there, because I hadn't used them for my own code). [1] http://www.kegel.com/gprof.html [2] http://sam.zoy.org/writings/programming/gprof.html Really, qprof is the only good userland tool (OProfile and Prospect would probably be okay too, but need root/kernel access to install and are a pain). It's a shame it's not maintained or packaged very well. I think I wrote about all this on the mailing list at the time as well. Cheers, Chris