OSDN Git Service

perf report: Fix no branch type statistics report issue
authorJin Yao <yao.jin@linux.intel.com>
Fri, 13 Mar 2020 13:46:07 +0000 (21:46 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 17 Mar 2020 21:01:40 +0000 (18:01 -0300)
commitc3b10649a80e9da2892c1fd3038c53abd57588f6
tree6ab8b0f07d2af2651b5899949873d6f57d1ac8a5
parent3b7a15b0643d42e4dca78c5aed8f1ad209a3d1ab
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 40c39e304641 ("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: 40c39e304641 ("perf report: Fix a no annotate browser displayed issue")
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200313134607.12873-1-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-report.c