From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com,
alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org,
ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH] perf report: Fix no branch type statistics report issue
Date: Fri, 13 Mar 2020 16:24:25 -0300 [thread overview]
Message-ID: <20200313192425.GD9917@kernel.org> (raw)
In-Reply-To: <20200313134607.12873-1-yao.jin@linux.intel.com>
Em Fri, Mar 13, 2020 at 09:46:07PM +0800, Jin Yao escreveu:
> Previously we could get the report of branch type statistics.
>
> For example,
>
> perf record -j any,save_type ...
> 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")
Thanks, tested before/after, matches description, applied.
- Arnaldo
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
> tools/perf/builtin-report.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index d7c905f7520f..5f4045df76f4 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -186,24 +186,23 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
> {
> struct hist_entry *he = iter->he;
> struct report *rep = arg;
> - struct branch_info *bi;
> + struct branch_info *bi = he->branch_info;
> struct perf_sample *sample = iter->sample;
> struct evsel *evsel = iter->evsel;
> int err;
>
> + branch_type_count(&rep->brtype_stat, &bi->flags,
> + bi->from.addr, bi->to.addr);
> +
> if (!ui__has_annotation() && !rep->symbol_ipc)
> return 0;
>
> - bi = he->branch_info;
> err = addr_map_symbol__inc_samples(&bi->from, sample, evsel);
> if (err)
> goto out;
>
> err = addr_map_symbol__inc_samples(&bi->to, sample, evsel);
>
> - branch_type_count(&rep->brtype_stat, &bi->flags,
> - bi->from.addr, bi->to.addr);
> -
> out:
> return err;
> }
> --
> 2.17.1
>
--
- Arnaldo
next prev parent reply other threads:[~2020-03-13 19:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 13:46 [PATCH] perf report: Fix no branch type statistics report issue Jin Yao
2020-03-13 19:24 ` Arnaldo Carvalho de Melo [this message]
2020-03-19 14:10 ` [tip: perf/core] " tip-bot2 for Jin Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313192425.GD9917@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.com \
--cc=yao.jin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.