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


Groups > linux.kernel > #1446343

[Question] for duplicate symbols, kallsyms and vmlinux may retain different symbol

From Songshan Gong <gongss@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [Question] for duplicate symbols, kallsyms and vmlinux may retain different symbol
Date 2016-07-19 13:20 +0200
Message-ID <rWBea-3l1-25@gated-at.bofh.it> (permalink)
References <rWzcl-27O-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


I try to fix the failure of testcase 'test__vmlinux_matches_kallsyms', 
and meet a kind of failure because of duplicate symbols.

For example,two functions:
kretprobe_trampoline_holder and kretprobe_trampoline

(1)They all start from the same addr,0x011b180;

(2)kretprobe_trampoline_holder is STB_LOCAL,
    kretprobe_trampoline is STB_GLOBAL;

(3) for kallsyms, because we cann't get the correct size of each symbol 
from /proc/kallsyms, before symbols__fixup_duplicate(), perf assumes 
each symbol's size is zero, so when choose_best_symbol(), we get 
kretprobe_trampoline because perf prefers 'a global symbol over a 
non-global one';

(4) for vmlinux, by readelf, I found that:
size of kretprobe_trampoline_holder is 4, not zero;
size of kretprobe_trampoline is zero;
So when choose_best_symbol(), we get pretprobe_trampoline_holder instead 
because perf prefers 'A symbol with non-zero length' and this condition 
is judged before 'prefer a global symbol';

I have a idea to fix this problem, but may be inappropriate:
Could we move the judge of symbol size to the bottom of the judge 
whether a symbol is global?

Anyone else have good idea?

Song Shan Gong

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


Thread

[PATCH RFC V1] perf tests: ignore symbols before kernel start Song Shan Gong <gongss@linux.vnet.ibm.com> - 2016-07-19 11:10 +0200
  [Question] for duplicate symbols, kallsyms and vmlinux may retain  different symbol Songshan Gong <gongss@linux.vnet.ibm.com> - 2016-07-19 13:20 +0200

csiph-web