|
From: Damien C. <dam...@gm...> - 2011-04-21 07:42:17
Attachments:
callgrind.1
|
Hi
When I launch callgrind with option --toggle-collect on a binary built
from the source code below: valgrind --tool=callgrind
"--toggle-collect=f1()" $BINARY
I get the attached output file.
When it is opened with kcachegrind it looks like the Instruction
Fetches ("Ir" column) is correct compared to a run without the
--toggle-collect option (half the value without the --toggle-collect
option).
The "Count" column indicates one call to function f() but two calls to
function g(), I would have expected only one call to g().
Is it something expected ?
Thanks.
source code:
static void g()
{
...
}
static void f()
{
g();
}
static void f1()
{
f();
}
static void f2()
{
f();
}
int main() {
f1();
f2();
}
|
|
From: Josef W. <Jos...@gm...> - 2011-04-27 19:13:02
|
On Thursday 21 April 2011, Damien CLAUDE wrote:
> Hi
>
> When I launch callgrind with option --toggle-collect on a binary built
> from the source code below: valgrind --tool=callgrind
> "--toggle-collect=f1()" $BINARY
> I get the attached output file.
>
> When it is opened with kcachegrind it looks like the Instruction
> Fetches ("Ir" column) is correct compared to a run without the
> --toggle-collect option (half the value without the --toggle-collect
> option).
> The "Count" column indicates one call to function f() but two calls to
> function g(), I would have expected only one call to g().
You are right.
Looks like a bug, yes. Can you file a bug report for that?
Thanks,
Josef
> Is it something expected ?
>
> Thanks.
>
> source code:
>
> static void g()
> {
> ...
> }
>
> static void f()
> {
> g();
> }
>
> static void f1()
> {
> f();
> }
>
> static void f2()
> {
> f();
> }
>
> int main() {
> f1();
> f2();
> }
>
|