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 4/5] perf diff: Fix output ordering to honor next column
Date: Sun, 4 Jan 2015 19:16:40 +0100	[thread overview]
Message-ID: <20150104181640.GB29388@krava.brq.redhat.com> (raw)
In-Reply-To: <1419656793-32756-4-git-send-email-namhyung@kernel.org>

On Sat, Dec 27, 2014 at 02:06:32PM +0900, Namhyung Kim wrote:

SNIP

>  	if (!pairs_left || !pairs_right)
>  		return pairs_left ? -1 : 1;
>  
> -	p_left  = get_pair_data(left,  &data__files[sort_compute]);
> -	p_right = get_pair_data(right, &data__files[sort_compute]);
> +	p_left  = get_pair_data(left,  &data__files[sort_idx]);
> +	p_right = get_pair_data(right, &data__files[sort_idx]);
>  
>  	if (!p_left && !p_right)
>  		return 0;
> @@ -555,8 +560,13 @@ hist_entry__cmp_nop(struct hist_entry *left __maybe_unused,
>  static int64_t
>  hist_entry__cmp_baseline(struct hist_entry *left, struct hist_entry *right)
>  {
> -	if (sort_compute)
> -		return 0;
> +	/*
> +	 * This function will be called first for each entry to resort
> +	 * output.  Next compare-functions use this idx to find their
> +	 * data and increase it for next data so we need to initialize
> +	 * it everytime.
> +	 */
> +	data_idx = 0;

hum, could we omit the global 'data_idx' variable usage by passing
'struct perf_hpp_fmt' into color fmt callbacks? (like hist_entry__cmp_delta..)

we could get the data_idx from 'struct diff_hpp_fmt'::idx

jirka

  reply	other threads:[~2015-01-04 18:16 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 [this message]
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
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=20150104181640.GB29388@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.