public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 4/5] perf diff: Fix output ordering to honor next column
Date: Wed, 7 Jan 2015 16:42:58 +0900	[thread overview]
Message-ID: <20150107074258.GE849@sejong> (raw)
In-Reply-To: <20150104181640.GB29388@krava.brq.redhat.com>

Hi Jiri,

On Sun, Jan 04, 2015 at 07:16:40PM +0100, Jiri Olsa wrote:
> 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

Right, I thought that too.  But it requires adding '__maybe_unused
fmt' argument to all callbacks so I just decided to use a quick
solution.  I'll convert to pass the fmt argument as it'll make
possible future changes easier.

Thanks,
Namhyung

  reply	other threads:[~2015-01-07  7:45 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 [this message]
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=20150107074258.GE849@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