给定带有调试符号的未剥离的vmlinux(通常包含与您的内核版本匹配的“linux-devel”或“linux-headers”包),您可以使用binutils附带的addr2line程序将地址转换为源文件中的行.
考虑这个呼叫追踪:
Call Trace:
[] ? finish_task_switch+0x3d/0x120
[] __schedule+0x3b0/0x9d0
[] schedule+0x29/0x70
[] schedule_hrtimeout_range_clock.part.24+0xdc/0xf0
[] ? hrtimer_get_res+0x50/0x50
[] ? schedule_hrtimeout_range_clock.part.24+0x7f/0xf0
[] schedule_hrtimeout_range_clock+0x19/0x60
[] schedule_hrtimeout_range+0x13/0x20
[] poll_schedule_timeout+0x49/0x70
[] do_sys_poll+0x423/0x550
[] ? sock_recvmsg+0x9c/0xd0
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] ? poll_select_copy_remaining+0x140/0x140
[] SyS_poll+0x5e/0x100
[] system_call_fastpath+0x16/0x1b
然后可以找到poll_select_copy_remaining中调用者的地址:
$addr2line -e /tmp/vmlinux ffffffff811a8c50
/tmp/linux-3.15-rc8/fs/select.c:209