public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf hist: Improve srcfile sort key performance (really)
Date: Thu, 23 Mar 2023 09:54:02 -0300	[thread overview]
Message-ID: <ZBxL6nfhW/gwixx8@kernel.org> (raw)
In-Reply-To: <20230323025005.191239-1-namhyung@kernel.org>

Em Wed, Mar 22, 2023 at 07:50:05PM -0700, Namhyung Kim escreveu:
> The earlier commit f0cdde28fecc ("perf hist: Improve srcfile sort key
> performance") updated the srcfile logic but missed to change the ->cmp()
> callback which is called for every sample.  It should use the same logic
> like in the srcline to speed up the processing because it'd return the
> same information repeatedly for the same address.  The real processing
> will be done in sort__srcfile_collapse().

Thanks, applied.

- Arnaldo

 
> Fixes: pf0cdde28fecc ("perf hist: Improve srcfile sort key performance")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/sort.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index e11e68ecf0a2..2b5cc8e4aa6e 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -657,12 +657,7 @@ static char *hist_entry__get_srcfile(struct hist_entry *e)
>  static int64_t
>  sort__srcfile_cmp(struct hist_entry *left, struct hist_entry *right)
>  {
> -	if (!left->srcfile)
> -		left->srcfile = hist_entry__get_srcfile(left);
> -	if (!right->srcfile)
> -		right->srcfile = hist_entry__get_srcfile(right);
> -
> -	return strcmp(right->srcfile, left->srcfile);
> +	return sort__srcline_cmp(left, right);
>  }
>  
>  static int64_t
> -- 
> 2.40.0.rc1.284.g88254d51c5-goog
> 

-- 

- Arnaldo

      reply	other threads:[~2023-03-23 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  2:50 [PATCH] perf hist: Improve srcfile sort key performance (really) Namhyung Kim
2023-03-23 12:54 ` Arnaldo Carvalho de Melo [this message]

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=ZBxL6nfhW/gwixx8@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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