From: Namhyung Kim <namhyung@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 5/5] perf diff: Fix -o/--order option behavior
Date: Wed, 7 Jan 2015 16:47:06 +0900 [thread overview]
Message-ID: <20150107074706.GF849@sejong> (raw)
In-Reply-To: <20150104182656.GC29388@krava.brq.redhat.com>
On Sun, Jan 04, 2015 at 07:26:56PM +0100, Jiri Olsa wrote:
> On Sat, Dec 27, 2014 at 02:06:33PM +0900, Namhyung Kim wrote:
>
> SNIP
>
> > + return 0;
> > +
> > + fmt = zalloc(sizeof(*fmt));
> > + if (fmt == NULL) {
> > + pr_err("Memory allocation failed\n");
> > + return -1;
> > + }
> > +
> > + fmt->cmp = hist_entry__cmp_nop;
> > + fmt->collapse = hist_entry__cmp_nop;
> > +
> > + switch (compute) {
> > + case COMPUTE_DELTA:
> > + fmt->sort = hist_entry__cmp_delta_idx;
> > + break;
> > + case COMPUTE_RATIO:
> > + fmt->sort = hist_entry__cmp_ratio_idx;
> > + break;
> > + case COMPUTE_WEIGHTED_DIFF:
> > + fmt->sort = hist_entry__cmp_wdiff_idx;
> > + break;
> > + default:
> > + BUG_ON(1);
> > + }
> > +
> > + list_add(&fmt->sort_list, &perf_hpp__sort_list);
> > + return 0;
>
> so the first 'fmt' which gets to sorting is the one for
> data__files[sort_idx] file, that sounds good..
>
> but as the sorting goes through all the perf_hpp__sort_list list,
> it will hit the 'sort_idx' data again.. should you disable sort
> function for its 'fmt' then?
Do you really think it's needed?
Yes, it'll be called twice but I think it's a relatively rare case as
most entries will be sorted by the sort_idx and baseline columns.
Thanks,
Namhyung
next prev parent reply other threads:[~2015-01-07 7:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-27 5:06 [PATCH RESEND 1/5] perf diff: Fix to sort by baseline field by default Namhyung Kim
2014-12-27 5:06 ` [PATCH RESEND 2/5] perf diff: Get rid of hists__compute_resort() Namhyung Kim
2015-01-04 16:33 ` Jiri Olsa
2015-01-28 15:06 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-12-27 5:06 ` [PATCH 3/5] perf diff: Print diff result more precisely Namhyung Kim
2015-01-04 16:47 ` Jiri Olsa
2015-01-07 14:02 ` Namhyung Kim
2015-01-28 15:07 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-12-27 5:06 ` [PATCH 4/5] perf diff: Fix output ordering to honor next column Namhyung Kim
2015-01-04 18:16 ` Jiri Olsa
2015-01-07 7:42 ` Namhyung Kim
2014-12-27 5:06 ` [PATCH 5/5] perf diff: Fix -o/--order option behavior Namhyung Kim
2015-01-04 18:26 ` Jiri Olsa
2015-01-07 7:47 ` Namhyung Kim [this message]
2015-01-07 8:10 ` Jiri Olsa
2015-01-07 13:31 ` Namhyung Kim
2015-01-08 9:53 ` [tip:perf/urgent] perf diff: Fix to sort by baseline field by default tip-bot for Namhyung Kim
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=20150107074706.GF849@sejong \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.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