All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
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: Sun, 4 Jan 2015 19:26:56 +0100	[thread overview]
Message-ID: <20150104182656.GC29388@krava.brq.redhat.com> (raw)
In-Reply-To: <1419656793-32756-5-git-send-email-namhyung@kernel.org>

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?

jirka

  reply	other threads:[~2015-01-04 18:27 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 [this message]
2015-01-07  7:47     ` Namhyung Kim
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=20150104182656.GC29388@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@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 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.