Skip to content

Commit c3b1064

Browse files
Jin Yaoacmel
authored andcommitted
perf report: Fix no branch type statistics report issue
Previously we could get the report of branch type statistics. For example: # perf record -j any,save_type ... # t perf report --stdio # # Branch Statistics: # COND_FWD: 40.6% COND_BWD: 4.1% CROSS_4K: 24.7% CROSS_2M: 12.3% COND: 44.7% UNCOND: 0.0% IND: 6.1% CALL: 24.5% RET: 24.7% But now for the recent perf, it can't report the branch type statistics. It's a regression issue caused by commit 40c39e3 ("perf report: Fix a no annotate browser displayed issue"), which only counts the branch type statistics for browser mode. This patch moves the branch_type_count() outside of ui__has_annotation() checking, then branch type statistics can work for stdio mode. Fixes: 40c39e3 ("perf report: Fix a no annotate browser displayed issue") Signed-off-by: Jin Yao <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 3b7a15b commit c3b1064

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/perf/builtin-report.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,24 +186,23 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
186186
{
187187
struct hist_entry *he = iter->he;
188188
struct report *rep = arg;
189-
struct branch_info *bi;
189+
struct branch_info *bi = he->branch_info;
190190
struct perf_sample *sample = iter->sample;
191191
struct evsel *evsel = iter->evsel;
192192
int err;
193193

194+
branch_type_count(&rep->brtype_stat, &bi->flags,
195+
bi->from.addr, bi->to.addr);
196+
194197
if (!ui__has_annotation() && !rep->symbol_ipc)
195198
return 0;
196199

197-
bi = he->branch_info;
198200
err = addr_map_symbol__inc_samples(&bi->from, sample, evsel);
199201
if (err)
200202
goto out;
201203

202204
err = addr_map_symbol__inc_samples(&bi->to, sample, evsel);
203205

204-
branch_type_count(&rep->brtype_stat, &bi->flags,
205-
bi->from.addr, bi->to.addr);
206-
207206
out:
208207
return err;
209208
}

0 commit comments

Comments
 (0)