public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wangnan (F)" <wangnan0@huawei.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>, <namhyung@kernel.org>,
	<lizefan@huawei.com>, <pi3orama@163.com>,
	<linux-kernel@vger.kernel.org>, <jolsa@kernel.org>,
	<masami.hiramatsu.pt@hitachi.com>
Subject: Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore
Date: Fri, 6 Nov 2015 21:34:55 +0800	[thread overview]
Message-ID: <563CAC7F.4040302@huawei.com> (raw)
In-Reply-To: <20151106131950.GA13236@kernel.org>



On 2015/11/6 21:19, Arnaldo Carvalho de Melo wrote:
> Em Fri, Nov 06, 2015 at 09:46:12AM +0000, Wang Nan escreveu:
>> In dso__split_kallsyms_for_kcore(), current code adjusts symbol's
>> address but only reinsert it into rbtree if the symbol belongs to
>> another map. However, the expression for adjusting symbol (pos->start -=
>> curr_map->start - curr_map->pgoff) can change the relative order between
>> two symbols (even if the affected symbols are in different maps, in
>> kcore case they are possible to share one same dso), which damages the
>> rbtree.
> Right, some code does change the symbol values it gets from whatever
> symtab (kallsyms, ELF, JIT maps, etc) when it should instead use the per
> map data structure (struct map) and its ->{map,unmap}_ip, ->pgoff,
> ->reloc, members for that :-\
>
> I.e. 'struct dso' should be just what comes from the symtab, while
> 'struct map' should be about where that DSO is in memory.
>
> With that in mind, do you still think your fix is the correct one?

Not very sure. I'm not familar with this part of code. Actually
speaking I don't understand the relationship between what you said
and what I found...

I spent a whole day to answer Masami's question that why
kernel_get_symbol_address_by_name success but __find_kernel_function()
fail in my platform, and described it in commit message.
This patch is the best one I can find. It solves my problem but may be
incorrect. Just want you and other know my result. Please let
me know if you and other want further information. Now its pirority
is low because patch 98d3b25 and Masami's update are already enough
for me.

I'll go back to BPF stuff. There are still much work to do :-)

Thank you.

> Adrian?
>
> - Arnaldo
>   



  reply	other threads:[~2015-11-06 13:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  9:46 [PATCH] perf tools: Rebuild rbtree when adjusting symbols for kcore Wang Nan
2015-11-06 13:19 ` [PATCH] perf symbols/KCORE: " Arnaldo Carvalho de Melo
2015-11-06 13:34   ` Wangnan (F) [this message]
2015-11-06 14:03     ` Arnaldo Carvalho de Melo
2015-11-06 14:33       ` pi3orama
2015-11-06 13:59   ` Adrian Hunter
2015-11-06 14:31     ` pi3orama
2015-11-06 18:51     ` Arnaldo Carvalho de Melo
2015-11-09  8:26       ` Adrian Hunter
2015-11-09 14:56         ` Arnaldo Carvalho de Melo
2015-11-10 13:41           ` Adrian Hunter
2015-11-11  7:02     ` Wangnan (F)
2015-11-11 20:44       ` Arnaldo Carvalho de Melo
2015-11-12  6:42         ` Adrian Hunter
2015-11-16 10:58     ` [tip:perf/urgent] perf symbols: " tip-bot for Adrian Hunter

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=563CAC7F.4040302@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=namhyung@kernel.org \
    --cc=pi3orama@163.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