Re: getting values of local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> How can i get the value of a structure variable used in a kernel module.The
> structure is private to the module. Using struct command did not yield any
> result as the structure type is unknown to crash. Thanks.
> 
> --
> Vivek Anand T Kallampally
> 

Have you loaded the debuginfo data of the kernel module into the crash session?

For example, in the "fs/nfs/mount_clnt.c" kernel module there is this declaration:

 static struct rpc_stat mnt_stats;

Without loading the debuginfo data of the "nfs" module, there is only minimal 
information available about the data structure instance, namely just its virtual
address, its section, and the module that it's contained within:

  crash> sym mnt_stats
  ffffffffa086bca0 (b) mnt_stats [nfs]
  crash> p mnt_stats
  p: gdb request failed: p mnt_stats
  crash> whatis mnt_stats
  whatis: gdb request failed: whatis mnt_stats
  crash>

Loading the debuginfo data of the module (usually) brings in the additional 
information into the crash session:

  crash> mod -s nfs
       MODULE       NAME                     SIZE  OBJECT FILE
  ffffffffa086b920  nfs                    169344  /lib/modules/3.9.10-100.fc17.x86_64/kernel/fs/nfs/nfs.ko 
  crash> whatis mnt_stats
  struct rpc_stat mnt_stats;
  crash> p mnt_stats
  mnt_stats = $2 = {
    program = 0x0, 
    netcnt = 0, 
    netudpcnt = 0, 
    nettcpcnt = 0, 
    nettcpconn = 0, 
    netreconn = 3, 
    rpccnt = 6, 
    rpcretrans = 0, 
    rpcauthrefresh = 6, 
    rpcgarbage = 0
  }
  crash> 
  
Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux