|
From: Josef W. <Jos...@gm...> - 2007-05-24 19:00:24
|
On Thursday 24 May 2007, aul...@mi... wrote:
> Nick,
>
> Thank you for the fast reply! I commented out the dlclose, rebuilt, and
> callgrind works much better.
Good.
> It is still complaining about the
> "Possible precedence problem" but it seems to have done the real work
> anyway.
The "uninitialized value" warnings are gone?
Can you try the following short patch to get rid of the warning?
==================================================
--- callgrind_annotate (Revision 6742)
+++ callgrind_annotate (Arbeitskopie)
@@ -867,7 +867,7 @@
if ($summary_CC->[$sort_order[$i]] >0) {
$prop = $prop / $summary_CC->[$sort_order[$i]];
}
- $reached_all_thresholds &= ($prop >= $thresholds[$i]);
+ $reached_all_thresholds &&= ($prop >= $thresholds[$i]);
}
last if $reached_all_thresholds;
==================================================
It seems I failed to forward port this from cachegrind/cg_annotate ;-)
> Now I just hope I can remember this for the next time I use callgrind.
> At least it will be in the list archives now for me to find. :D
Yes, probably worth mentioning in the manual
(Or do something about this).
> On Wed, 23 May 2007 Nicholas Nethercote wrote:
> Josef might be able to give more info, but the basic problem is caused
> by the dlopen'd library subsequently being dlclosed. Cachegrind handles
> this, but Callgrind does not -- all the information for the instructions
> in the library get merged into a single "???" entry. (Cachegrind used
> to do the same thing, and then I worked out a fix, but I think there was
> some reason why that fix wasn't appropriate for Callgrind.)
The issue is that at time of profile writing, debug info for dlclosed
libraries is not available anymore.
Cachegrind now associates event counters to source line numbers already
at instrumentation time. Callgrind instead associates counters more or
less to instruction addresses, to be able to write the counters at
instruction granularity into the profile file.
But this difference is not really an excuse - I should be able to
retrieve source line numbers at instrumentation time, too (at the cost
of additional memory use).
I will look into this.
> A hacky possible workaround: can you avoid dlclosing the library?
Or just write out the profile file before dlclosing:
valgrind --tool=callgrind --dump-before=dlclose ....
Oh, sorry.
There is no command line tool to merge the profiles :-(
You have to use KCachegrind to load the files instead.
Josef
|