| Summary: | callgrind not clearing the number of calls properly | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | JeromeM <djedjeist> |
| Component: | callgrind | Assignee: | Josef Weidendorfer <josef.weidendorfer> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | philippe.waroquiers |
| Priority: | NOR | ||
| Version First Reported In: | 3.13.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | use to reproduce | ||
The below patch seems to solve the problem.
As I do not know much about callgrind, it would be nice
if Jozef could give his opinion about the patch before push.
Thanks
diff --git a/callgrind/bbcc.c b/callgrind/bbcc.c
index 5716b07a7..91018ebd7 100644
--- a/callgrind/bbcc.c
+++ b/callgrind/bbcc.c
@@ -100,8 +100,10 @@ void CLG_(zero_bbcc)(BBCC* bbcc)
bbcc->cost[i] = 0;
for(i=0;i <= bbcc->bb->cjmp_count;i++) {
bbcc->jmp[i].ecounter = 0;
- for(jcc=bbcc->jmp[i].jcc_list; jcc; jcc=jcc->next_from)
+ for(jcc=bbcc->jmp[i].jcc_list; jcc; jcc=jcc->next_from) {
CLG_(init_cost)( CLG_(sets).full, jcc->cost );
+ jcc->call_counter = 0;
+ }
}
bbcc->ecounter_sum = 0;
bbcc->ret_counter = 0;
Fixed in commit d48686. Thanks to Philippe for the patch! |
Created attachment 111701 [details] use to reproduce Hi, I want to get some Callgrind dumps during a specific period of my process. To clear datas, I use command: exec callgrind_control --zero $PID But I can see, after this command, some resilient calls. I have attached a simple test case to reproduce (tutu.c) main() -> f1() -> f() -> g() Clear datas with callgrind_control -> f2() -> f() -> g() end I expect to get in the callgrind dump only one call to g() but I see two calls to g(). Is it an expected behavior? Thanks, Jerome