Hello,
I am running callgrind with --collect-jumps=yes. I want to parse the callgrind
out-files to generate coverage reports. I am getting many conditional jumps
that I don't understand though. For instance this line is reported as a
conditional jump:
char host[USC_STRING_LENGTH]="";
The callgrind out-file section for this line is:
0x406460 46 1
0x40646b 46 1
0x406472 46 1
0x406479 46 1
0x406484 46 1
0x406489 46 1
0x40648c 46 1
0x40648e 46 1
0x406499 46 1
0x4064a0 46 1
0x4064a7 46 1
0x4064ae 46 1
jcnd=1/1 0x4064ae 46
0x4064ae 46
0x4064ae 46 15
jcnd=14/15 0x4064ae 46
0x4064ae 46
In source view in QCachegrind it suppresses this jump (I read it does that for
all "same-line" or "next-line" jumps) but in assembly view it confirms this as
a jump:
40 6460 48 c7 85 90 fe ff ff movq $0x0,-0x170(%rbp)
40 6467 00 00 00 00
40 646B 48 8d 85 98 fe ff ff lea -0x168(%rbp),%rax
40 6472 48 89 85 b0 48 ff ff mov %rax,-0xb750(%rbp)
40 6479 48 c7 85 a8 48 ff ff movq $0x0,-0xb758(%rbp)
40 6480 00 00 00 00
40 6484 b8 78 00 00 00 mov $0x78,%eax
40 6489 83 f8 08 cmp $0x8,%eax
40 648C 72 23 jb <main+0x207>
40 648E 48 c7 85 a0 48 ff ff movq $0xf,-0xb760(%rbp)
40 6495 0f 00 00 00
40 6499 48 8b bd b0 48 ff ff mov -0xb750(%rbp),%rdi
40 64A0 48 8b 8d a0 48 ff ff mov -0xb760(%rbp),%rcx
40 64A7 48 8b 85 a8 48 ff ff mov -0xb758(%rbp),%rax
40 64AE ┌->f3 48 ab rep stos %rax,%es:(%rdi)
└- Jump 15 of 16 times to 0x4064AE
(I hope the ASCII comes out readable)
Can anyone explain why this is a conditional jump?
The source line mentioned above is in the "main" function in file
UscFtpLinkTest.cc which includes UscConfiguration.h which includes UscCommon.h
which defines the constant as:
int USC_STRING_LENGTH = 128;
I am using Benjamin Meyer's tool
(http://benjamin-meyer.blogspot.de/2007/12/valgrind-callgrind-tools-part-3-code.html)
to parse the callgrind files and generate coverage reports. It does have a
serious bug though with jump coverage calculations and I was wondering if this
has anything to do with it.
Thanks in advance,
Costas Skarakis
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users