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: <87zjr3q42c.fsf@sejong.aot.lge.com>
Date:	Mon, 23 Sep 2013 18:29:15 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 1/3] perf callchain: Convert children list to rbtree

Hi,

On Sun, 22 Sep 2013 13:15:59 +0200, Jiri Olsa wrote:
> On Tue, Sep 10, 2013 at 05:24:16PM +0900, Namhyung Kim wrote:
>> From: Namhyung Kim <namhyung.kim@....com>
>
> SNIP
>
>> index 2b585bc308cf..1b22b6269213 100644
>> --- a/tools/perf/util/callchain.h
>> +++ b/tools/perf/util/callchain.h
>> @@ -21,10 +21,9 @@ enum chain_order {
>>  
>>  struct callchain_node {
>>  	struct callchain_node	*parent;
>> -	struct list_head	siblings;
>> -	struct list_head	children;
>>  	struct list_head	val;
>>  	struct rb_node		rb_node; /* to sort nodes in an rbtree */
>> +	struct rb_root		rb_root_in; /* sorted tree of children */
>>  	struct rb_root		rb_root; /* sorted tree of children */
>>  	unsigned int		val_nr;
>>  	u64			hit;
>> @@ -86,8 +85,6 @@ extern __thread struct callchain_cursor callchain_cursor;
>>  
>>  static inline void callchain_init(struct callchain_root *root)
>>  {
>> -	INIT_LIST_HEAD(&root->node.siblings);
>> -	INIT_LIST_HEAD(&root->node.children);
>>  	INIT_LIST_HEAD(&root->node.val);
>
> don't we miss rb_root_in init here, like:
>
> 	root->node.rb_root_in = RB_ROOT;

The struct callchain_root in hist entry initialized to zero so
technically it doesn't need to be set.  But I think it's better to have
explicit initializer.

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