[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5419CAFC.4040604@hp.com>
Date: Wed, 17 Sep 2014 13:55:08 -0400
From: Waiman Long <waiman.long@...com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Peter Zijlstra <peterz@...radead.org>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Scott J Norton <scott.norton@...com>,
Don Zickus <dzickus@...hat.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH v2] perf mem: improves DSO long names search speed with
RB tree
On 09/17/2014 10:51 AM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 16, 2014 at 03:08:19PM -0400, Waiman Long escreveu:
>> +++ b/tools/perf/util/dso.c
>> @@ -611,17 +611,93 @@ struct dso *dso__kernel_findnew(struct machine *machine, const char *name,
>> return dso;
>> }
>>
>> +/*
>> + * RB root of DSOs sorted by the long name
>> + */
>> +static struct rb_root dso__longname_root = { NULL };
> Use RB_ROOT, like in:
>
> [acme@zoo linux]$ grep -w rb_root mm/vmalloc.c
> static struct rb_root vmap_area_root = RB_ROOT;
> [acme@zoo linux]$
I don't use RB_ROOT here because it gave compilation error.
> But then can't this be made non-static, i.e. at the 'struct machine'
> level? I.e. it is more likely that DSOs with the same long name are
> really the same thing on a single 'struct machine', not accross multiple
> ones or even multiple sessions (i.e. across multiple 'struct machines').
>
> IIRC Adrian also pointed this out.
>
> - Arnaldo
>
>
Yes, I am going to put the rb_root in the machine structure level as
suggested by Adrian. So the static rb_root will be gone. I also found
out that the dso__load_sym() function in util/symbol-elf.c may create
DSOs of the same long name which can be either "[kernel.allsyms]" or
"/lib/modules/.../vmlinux".
Cheers,
Longman
--
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