From: "Jin, Yao" <yao.jin@linux.intel.com>
To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com
Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH] perf annotate: Remove hist__account_cycles from callback
Date: Thu, 14 Mar 2019 19:34:51 +0800 [thread overview]
Message-ID: <d01e89f2-3cf8-14ea-5a08-3c5ab43358d1@linux.intel.com> (raw)
In-Reply-To: <1552422174-27622-1-git-send-email-yao.jin@linux.intel.com>
Any comments for this patch or any issue is found? In testing, I just
feel it accelerates the perf annotate data processing.
Thanks
Jin Yao
On 3/13/2019 4:22 AM, Jin Yao wrote:
> The hist__account_cycles is executed when the hist_iter__branch_callback
> is called. But it looks it's not necessary. In hist__account_cycles, it
> already walks on all branch entries.
>
> This patch moves the hist__account_cycles out of callback, now the data
> processing is much faster than before.
>
> For example,
> perf record -b ...
> perf annotate
>
> The before/after output should be no change.
>
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
> tools/perf/builtin-annotate.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 67f9d9f..77deb3a 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -159,8 +159,6 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
> struct perf_evsel *evsel = iter->evsel;
> int err;
>
> - hist__account_cycles(sample->branch_stack, al, sample, false);
> -
> bi = he->branch_info;
> err = addr_map_symbol__inc_samples(&bi->from, sample, evsel);
>
> @@ -199,6 +197,8 @@ static int process_branch_callback(struct perf_evsel *evsel,
> if (a.map != NULL)
> a.map->dso->hit = 1;
>
> + hist__account_cycles(sample->branch_stack, al, sample, false);
> +
> ret = hist_entry_iter__add(&iter, &a, PERF_MAX_STACK_DEPTH, ann);
> return ret;
> }
>
next prev parent reply other threads:[~2019-03-14 11:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-12 20:22 [PATCH] perf annotate: Remove hist__account_cycles from callback Jin Yao
2019-03-14 11:34 ` Jin, Yao [this message]
2019-03-14 12:04 ` Jiri Olsa
2019-03-14 14:17 ` Jin, Yao
2019-03-15 4:20 ` 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=d01e89f2-3cf8-14ea-5a08-3c5ab43358d1@linux.intel.com \
--to=yao.jin@linux.intel.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@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 \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).