From: Josef Weidendorfer Date: Tue, 15 May 2018 18:11:41 +0000 (+0200) Subject: callgrind: fix setting call counter to zero if requested X-Git-Tag: VALGRIND_3_14_0~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d48686019b53f6afb89769775e67b1990071025d;p=thirdparty%2Fvalgrind.git callgrind: fix setting call counter to zero if requested We did not set the call cost counters in CLG_(zero_bbcc) to zero, which gets called by requests to set counters to zero - via client request - when entering a function if configured so - via gdb monitor command (used by callgrind_control -z) Counters are also set to zero after they are dumped out to a file. This does not use CLG_(zero_bbcc), and was doing the right thing. This fixes bug 392449. --- diff --git a/callgrind/bbcc.c b/callgrind/bbcc.c index 5716b07a70..7ba4e8a870 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) - CLG_(init_cost)( CLG_(sets).full, jcc->cost ); + 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;