lkml.org 
[lkml]   [2015]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] perf diff: Fix -o/--order option behavior
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


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