[Crash-utility] Retrying /proc values from kdump file

Dave Anderson anderson at redhat.com
Tue Mar 29 16:11:03 UTC 2016



----- Original Message -----
> One of the specific items I wanted is /proc/buddyinfo.

Well, it looks like /proc/buddyinfo date comes down to the functions
in the kernel's seq_operations structure, where:

        proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);

leads to:
  
  static const struct file_operations fragmentation_file_operations = {
          .open           = fragmentation_open,
          .read           = seq_read,
          .llseek         = seq_lseek,
          .release        = seq_release,
  }
  
which leads to:

  static int fragmentation_open(struct inode *inode, struct file *file)
  {
          return seq_open(file, &fragmentation_op);
  }
  
which leads to:

  static const struct seq_operations fragmentation_op = {
          .start  = frag_start,
          .next   = frag_next,
          .stop   = frag_stop,
          .show   = frag_show,
  };
  
where the "frag_xxx" functions pull data from each NUMA node's 
"zone" structures.  You can check the details in the kernel code, 
but from the crash utility perspective, the relevant structure 
addresses from which the data is pulled can be seen by "kmem -n",
under the "NODE_ZONES" column:
  
  crash> kmem -n
  NODE    SIZE      PGLIST_DATA       BOOTMEM_DATA       NODE_ZONES   
    0   4711935   ffff88047e5d7000        ----        ffff88047e5d7000
                                                      ffff88047e5d7800
                                                      ffff88047e5d8000
                                                      ffff88047e5d8800
      MEM_MAP          START_PADDR    START_MAPNR
  ffffea0000000040        1000             1     
  
  ZONE  NAME         SIZE       MEM_MAP      START_PADDR  START_MAPNR
    0   DMA          4095  ffffea0000000040         1000            1
    1   DMA32     1044480  ffffea0000040000      1000000         4096
    2   Normal    3663360  ffffea0004000000    100000000      1048576
    3   Movable         0                 0            0            0
  
  ...

So if you take the zone structure addresses ffff88047e5d7000, ffff88047e5d7800,
etc., you can cast each of them as zone structures to see their individul 
contents, i.e., like:

  crash> zone ffff88047e5d7000
  ...

Dave




More information about the Crash-utility mailing list