[Crash-utility] command dis fails to display name of function

qiaonuohan qiaonuohan at cn.fujitsu.com
Mon Dec 8 13:29:41 UTC 2014


Hello Dave,

When using dis command on RHEL5.11, I found a weird thing. Please check the
following execution.

<cut>
crash> dis do_wp_page | grep 591
0xffffffff8001115c <do_wp_page+591>:	callq  0xffffffff800623d0 <__sched_text_start>
crash> dis schedule
0xffffffff800623d0 <__sched_text_start>:        push   %rbp
0xffffffff800623d1 <schedule+1>:        mov    %rsp,%rbp
...
crash> dis do_wp_page | grep 591
0xffffffff8001115c <do_wp_page+591>:	callq  0xffffffff800623d0 <schedule>
crash> dis do_wp_page | grep 591
0xffffffff8001115c <do_wp_page+591>:	callq  0xffffffff800623d0 <__sched_text_start>
<cut>

schedule and __sched_text_start are always shifting.

After some investigation, I found the following sentences in
arch/x86_64/kernel/vmlinux.lds.S

<cut>
SECTIONS
{
...
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
...
<cut>

the SCHED_TEXT is defined like below
<cut>
#define SCHED_TEXT                                                      \
                 ALIGN_FUNCTION();                                       \
                 VMLINUX_SYMBOL(__sched_text_start) = .;                 \
                 *(.sched.text)                                          \
                 VMLINUX_SYMBOL(__sched_text_end) = .;
<cut>

So symbol __sched_text_start may have the same address as the first function
of *(.sched.text). And LOCK_TEXT/KPROBES_TEXT/IRQENTRY_TEXT has the same
problems. The attached patch is used to fix this.

-- 
Regards
Qiao Nuohan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dis.patch
Type: text/x-patch
Size: 651 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20141208/69599e13/attachment.bin>


More information about the Crash-utility mailing list