https://bugs.kde.org/show_bug.cgi?id=399355

--- Comment #6 from Philippe Waroquiers <philippe.waroqui...@skynet.be> ---
(In reply to Nick Nethercote from comment #5)
> Created attachment 115743 [details]
> Updated version
> 
> This fixes the problem that Philippe identified.
Thanks for the fix.
Here is some more feedback with bigger files (that I will attach).

I still obtain some error messages:
  callgrind_diff callgrind.out.counterp1.24494.5
callgrind.out.counterp1.17960.5 > d.out
  Use of uninitialized value in subtraction (-) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_diff line 159.
  Use of uninitialized value in subtraction (-) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_diff line 159.
  Use of uninitialized value in subtraction (-) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_diff line 159.
  ...

The numbers obtained in the resulting file seems also not realistic.
E.g. when I look in kcachegrind the intruction fetch costs for
curtain__airspace__list__curtain_impl__airspaces_iter__asp_iter__slave__next
(a leaf function), I see:
9_933_891_910 in the 24494.5 file
and 9_901_341_110 in the 17960.5 file,
but d.out contains
fl=/cm/build12/cm/ot/ELD/GEO_FLIGHT!22.5.0.87/build_G!19.OP.L7/sources/group_iterator_g.adb
fn=curtain__airspace__list__curtain_impl__airspaces_iter__asp_iter__slave__next
0 3731582914 74 963

callgrind_annotate d.out produces some output but mixed with errors after some
lines:
  Use of uninitialized value in multiplication (*) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_annotate line 910.
  Use of uninitialized value in multiplication (*) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_annotate line 910.
  Use of uninitialized value in multiplication (*) at
/home/philippe/valgrind/git/fixes/Inst/bin/callgrind_annotate line 910.

Also, when reading the resulting file with kcachegrind, that gives a list
of errors such as:
  kcachegrind(31363): Loading "./d.out" : 9 :  "Garbage at end of cost line
('-151919000 -2 -3')" 
  kcachegrind(31363): Loading "./d.out" : 15 :  "Garbage at end of cost line
('-1 -4963')" 
  kcachegrind(31363): Loading "./d.out" : 21 :  "Garbage at end of cost line
('-1')" 
  kcachegrind(31363): Loading "./d.out" : 30 :  "Garbage at end of cost line
('-546')" 
  kcachegrind(31363): Loading "./d.out" : 36 :  "Garbage at end of cost line
('-470934')" 
  kcachegrind(31363): Loading "./d.out" : 42 :  "Garbage at end of cost line
('-161016 -1 -1')" 
  kcachegrind(31363): Loading "./d.out" : 48 :  "Garbage at end of cost line
('-30')" 


kcachegrind looks to be more strict about the callgrind format, that according
to the callgrind format grammar documentation, only allows costs >= 0:
  Costs := (Number Space+)+
  Number := HexNumber | (Digit)+

Not clear if it would be easy to enhance kcachegrind to support negative costs
(maybe Josef can give an idea of the complexity of this).

The alternative is to have callgrind_diff producing a file with twice more
events
than the compared files: for each event (e.g. instruction fetch/syscount),
have 2 new costs in the diff file:
  Instruction Fetch Increase     Instruction Fetch Decrease
  Syscount Increase
and then the cost will always be positive.

Brainstorm idea: if ever the callgrind format allows it, it would be nice
to have a 'delta call' output also, i.e. have for each 
'call A to B'  in each file produce some costs like
 A has called B     Calls Increase     Calls Decrease
(I guess this would imply to output a fake call from A to B in the diff file
and associate some costs to this call, showing the increase/decrease).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to