|
From: Nicholas N. <nj...@ca...> - 2004-03-14 11:14:19
|
On Sun, 14 Mar 2004, Josef Weidendorfer wrote: > > > The skin is pretty stupid, it just records hits on instructions when it > > > sees the INCEIP instruction. It also tries to do some conditional jump > > > analysis. I've written a python script that will annotate source and > > > show you what lines have been executed. > > Stupid question: Can't you use Cachegrind for this? Yes, I think the --show=Ir option will give you it. > > You might want to have a look at vgprof. I wrote it with the intention > > of making Valgrind interoperate with gprof by generating gprof-format > > files. Unfortunately, the gprof format is horrible and inextensible, so > > the only way it can work is by hacking gprof itself, which isn't fun. > > So better use Cachegrind format? You will get source annotation for free > (using cg_annotate or KCachegrind). > I found the Cachegrind file format to be astonishing flexible to use for > different purposes (in contrast to my own extensions .-). And it is quite > space saving because of ASCII (!), too: No need to store 8 bytes for a 64 bit > counter in a binary format, as most of the counters are small numbers. Main problem with using Cachegrind for coverage is that it's massive overkill -- it will run much slowler than necessary because of all the cache simulation stuff. 2nd problem is that you can't aggregate counts over multiple runs of a program. Enough people have asked about coverage that I wonder if it's worth doing properly with a separate tool? Jeremy's VGProf is a good start, but requiring a patched gprof is not nice. N |