|
From: Jeremy F. <je...@go...> - 2005-03-24 21:27:12
|
Nicholas Nethercote wrote:
> As for coverage, Cachegrind can give you a crude form of coverage
> information, but it doesn't give percentage coverage. I believe Ben
> Elliston was looking at writing a coverage tool with Valgrind that
> would produce gcov-compatible output files. AIUI, one of the
> difficulties is that gcov output is done on a basic block basis, and
> Valgrind's notion of a basic block is subtly different from that of a
> compiler's.
I guess that might be an issue. Valgrind doesn't really know where a BB
starts, only where it started executing. If you have a loop of the form:
start: preamble
loop: body
code
if !done goto loop
then Valgrind sees that as two basic blocks: one extending from start to
the goto, and one from loop to goto.
> The Valgrind 3.0 series will use the new dynamic binary translator
> Vex, which translates multiple basic blocks at a time; this may make
> things trickier again.
One presumes the instrumenter can (or could in principle) find out where
Vex decided to merge BBs, and can insert per-BB code at those points.
J
|