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: <20160121104330.GD13547@krava.brq.redhat.com>
Date:	Thu, 21 Jan 2016 11:43:30 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Jiri Olsa <jolsa@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Stephane Eranian <eranian@...gle.com>,
	Andi Kleen <andi@...stfloor.org>,
	Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 01/17] perf hists: Basic support of hierarchical report
 view

On Sun, Jan 17, 2016 at 01:03:01AM +0900, Namhyung Kim wrote:

SNIP

> +}
> +
> +static bool hists__hierarchy_insert_entry(struct hists *hists,
> +					  struct rb_root *root,
> +					  struct hist_entry *he)
> +{
> +	struct perf_hpp_fmt *fmt;
> +	struct hist_entry *new = NULL;
> +	struct hist_entry *parent = NULL;
> +	int depth = 0;
> +
> +	perf_hpp__for_each_sort_list(fmt) {
> +		if (!perf_hpp__is_sort_entry(fmt) &&
> +		    !perf_hpp__is_dynamic_entry(fmt))
> +			continue;
> +
> +		/* insert copy of 'he' for each fmt into the hierarchy */
> +		new = hierarchy_insert_entry(hists, root, he, fmt);
> +		if (new == NULL)
> +			break;

so hierarchy_insert_entry can fail because of memory allocation
but the resort path does not cover any error path because it only
shuffles entries from in-tree into sorted tree

would it make more sense to do this in 'in-tree addition' path?
and keep the resort functions to do only resort stuff

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ