一、問題:
在使用crash工具分析vmcore時,常會遇到內核模塊符號不能解析的問題,如:
crash> struct igbadapter 0xffff81032bef56b8
struct: invalid data structure reference: igbadapter
二、原因:
那是因爲沒有找到igb驅動模塊的符號信息。原因爲:只使用了vmlinux文件(包含內核符號),而其它的單獨加載的內核模塊的符號信息實際是沒有包含在vmlinux文件中的,需要使用單獨加載。
模塊的debug符號信息在kernel-debuginfo包(針對redhat系發行版)中有。所以,其實只需要安裝kernel-debuginfo包就可以了。
三、解決
加載相應的符號信息後就即可正常訪問。具體如下:
crash> mod -s igb /usr/lib/debug/lib/modules/2.6.18-164.el5/kernel/drivers/net/igb/igb.ko.debug
MODULE NAME SIZE OBJECT FILE
ffffffff88285380 igb 116181 /usr/lib/debug/lib/modules/2.6.18-164.el5/kernel/drivers/net/igb/igb.ko.debug
crash> struct igb_adapter
struct igb_adapter {
struct timer_list watchdog_timer;
struct timer_list phy_info_timer;
struct vlan_group *vlgrp;
u16 mng_vlan_id;
u32 bd_number;
u32 rx_buffer_len;
u32 wol;
u32 en_mng_pt;
u16 link_speed;
u16 link_duplex;
unsigned int total_tx_bytes;
unsigned int total_tx_packets;
unsigned int total_rx_bytes;
unsigned int total_rx_packets;
u32 itr;
u32 itr_setting;
u16 tx_itr;
u16 rx_itr;
struct work_struct reset_task;
struct work_struct watchdog_task;
bool fc_autoneg;
...