linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hp.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Scott J Norton <scott.norton@hp.com>,
	Don Zickus <dzickus@redhat.com>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH v2] perf mem: improves DSO long names search speed with RB tree
Date: Wed, 17 Sep 2014 13:55:08 -0400	[thread overview]
Message-ID: <5419CAFC.4040604@hp.com> (raw)
In-Reply-To: <20140917145102.GA2770@kernel.org>

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

      reply	other threads:[~2014-09-17 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 19:08 [PATCH v2 0/1] perf mem: improves DSO long names search speed with RB tree Waiman Long
2014-09-16 19:08 ` [PATCH v2] " Waiman Long
2014-09-17  6:22   ` Adrian Hunter
2014-09-17 14:08     ` Waiman Long
2014-09-17 14:51   ` Arnaldo Carvalho de Melo
2014-09-17 17:55     ` Waiman Long [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5419CAFC.4040604@hp.com \
    --to=waiman.long@hp.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=dzickus@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=scott.norton@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).