lkml.org 
[lkml]   [2015]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] perf diff: Fix output ordering to honor next column
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


\
 
 \ /
  Last update: 2015-01-04 19:41    [W:0.117 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site