lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 7 Jan 2015 16:47:06 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH 5/5] perf diff: Fix -o/--order option behavior

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

Do you really think it's needed?

Yes, it'll be called twice but I think it's a relatively rare case as
most entries will be sorted by the sort_idx and baseline columns.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ