Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264018

Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore

From "Wangnan (F)" <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore
Date 2015-11-06 14:40 +0100
Message-ID <qrPpg-55Y-5@gated-at.bofh.it> (permalink)
References <qrMhI-3aK-15@gated-at.bofh.it> <qrPfC-52O-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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
>   


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf tools: Rebuild rbtree when adjusting symbols for kcore Wang Nan <wangnan0@huawei.com> - 2015-11-06 11:20 +0100
  Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting  symbols for kcore Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-06 14:30 +0100
    Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore "Wangnan (F)" <wangnan0@huawei.com> - 2015-11-06 14:40 +0100
      Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting  symbols for kcore Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-06 15:10 +0100
        Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore pi3orama <pi3orama@163.com> - 2015-11-06 15:40 +0100
    Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore Adrian Hunter <adrian.hunter@intel.com> - 2015-11-06 15:10 +0100
      Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore pi3orama <pi3orama@163.com> - 2015-11-06 15:40 +0100
      Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting  symbols for kcore Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-06 20:00 +0100
        Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore Adrian Hunter <adrian.hunter@intel.com> - 2015-11-09 09:30 +0100
          Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting  symbols for kcore Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-09 16:00 +0100
            Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore Adrian Hunter <adrian.hunter@intel.com> - 2015-11-10 14:50 +0100
      Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore "Wangnan (F)" <wangnan0@huawei.com> - 2015-11-11 08:10 +0100
        Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting  symbols for kcore Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-11 21:50 +0100
          Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols  for kcore Adrian Hunter <adrian.hunter@intel.com> - 2015-11-12 07:50 +0100
      [tip:perf/urgent] perf symbols:   Rebuild rbtree when adjusting symbols for kcore tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-11-16 12:00 +0100

csiph-web