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]
Message-ID: <20140515114315.GB4009@krava.brq.redhat.com>
Date:	Thu, 15 May 2014 13:43:15 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Andi Kleen <andi@...stfloor.org>,
	Don Zickus <dzickus@...hat.com>
Subject: Re: [PATCH 04/20] perf tools: Support event grouping in hpp ->sort()

On Mon, May 12, 2014 at 03:28:37PM +0900, Namhyung Kim wrote:

SNIP

> +static int __hpp__sort(struct hist_entry *a, struct hist_entry *b,
> +		       hpp_field_fn get_field)
> +{
> +	s64 ret;
> +	int i, nr_members;
> +	struct perf_evsel *evsel;
> +	struct hist_entry *pair;
> +	u64 *fields_a, *fields_b;
> +
> +	ret = field_cmp(get_field(a), get_field(b));
> +	if (ret || !symbol_conf.event_group)
> +		return ret;
> +
> +	evsel = hists_to_evsel(a->hists);
> +	if (!perf_evsel__is_group_event(evsel))
> +		return ret;
> +
> +	nr_members = evsel->nr_members;
> +	fields_a = calloc(sizeof(*fields_a), nr_members);
> +	fields_b = calloc(sizeof(*fields_b), nr_members);
> +
> +	if (!fields_a || !fields_b)
> +		goto out;
> +
> +	list_for_each_entry(pair, &a->pairs.head, pairs.node) {
> +		evsel = hists_to_evsel(pair->hists);
> +		fields_a[perf_evsel__group_idx(evsel)] = get_field(pair);
> +	}
> +
> +	list_for_each_entry(pair, &b->pairs.head, pairs.node) {
> +		evsel = hists_to_evsel(pair->hists);
> +		fields_b[perf_evsel__group_idx(evsel)] = get_field(pair);
> +	}
> +
> +	for (i = 1; i < nr_members; i++) {
> +		ret = fields_a[i] - fields_b[i];

should we call here ^^^call  field_cmp ?

jirka
--
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