From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Waiman Long <Waiman.Long@hp.com>,
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>,
Douglas Hatch <doug.hatch@hp.com>,
Don Zickus <dzickus@redhat.com>, Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH v4 2/2] perf tool: improves DSO long names lookup speed with rbtree
Date: Mon, 29 Sep 2014 13:02:47 +0900 [thread overview]
Message-ID: <87d2afhy54.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140926142234.GC3879@kernel.org> (Arnaldo Carvalho de Melo's message of "Fri, 26 Sep 2014 11:22:34 -0300")
On Fri, 26 Sep 2014 11:22:34 -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 24, 2014 at 11:45:40AM -0400, Waiman Long escreveu:
>> + /*
>> + * Find node with the matching name
>> + */
>> + while (*p) {
>> + struct dso *this = rb_entry(*p, struct dso, rb_node);
>> + long rc = (long)strcmp(name, this->long_name);
>> +
>> + parent = *p;
>> + if (rc == 0) {
>> + /*
>> + * In case the new DSO is a duplicate of an existing
>> + * one, print an one-time warning & sort the entry
>> + * by its DSO address.
>> + */
>> + if (!dso || (dso == this))
>> + return this; /* Find matching dso */
>> + /*
>> + * The kernel DSOs may have duplicated long name,
>> + * so don't print warning for them.
>> + */
>> + if (!warned && !strstr(name, "kernel.kallsyms")
>> + && !strstr(name, "/vmlinux")) {
>> + pr_warning("Duplicated dso long name: %s\n",
>> + name);
>
> Huh? Can you elaborate on this? Ho can we add multiple DSOs with the
> exact same name into this tree? Have you actually seen this in practice?
> I guess so, judging by the comment above ("may have").
I guess it's because we split maps and dsos by section name (for kernel
only). Please look at dso__load_sym() - If map_groups__find_by_name()
with short name + section name fails, it creates a new dso and map, and
then curr_dso->long_name will be set as dso->long_name.
Thanks,
Namhyung
>
> I'll try the patch to see if I get these warnings...
>
> But initial reaction to these long casts and fallbacking to pointer
> arithmetic for tree searching/inserting looked ugly :-\
next prev parent reply other threads:[~2014-09-29 4:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 15:45 [PATCH v4 0/2] perf tool: improves DSO long names search speed with rbtree Waiman Long
2014-09-24 15:45 ` [PATCH v4 1/2] perf tool: encapsulate dsos list head into struct dsos Waiman Long
2014-09-26 14:06 ` Arnaldo Carvalho de Melo
2014-09-29 3:54 ` Namhyung Kim
2014-09-29 17:30 ` Waiman Long
2014-09-29 18:09 ` Arnaldo Carvalho de Melo
2014-09-29 18:40 ` Waiman Long
2014-09-26 14:12 ` Arnaldo Carvalho de Melo
2014-09-29 17:26 ` Waiman Long
2014-09-29 18:07 ` Arnaldo Carvalho de Melo
2014-09-24 15:45 ` [PATCH v4 2/2] perf tool: improves DSO long names lookup speed with rbtree Waiman Long
2014-09-26 14:22 ` Arnaldo Carvalho de Melo
2014-09-29 4:02 ` Namhyung Kim [this message]
2014-09-29 17:25 ` Waiman Long
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=87d2afhy54.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=Waiman.Long@hp.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=doug.hatch@hp.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