super_blocks没有导出

在模块中,经过查询super_blocks列表,来遍历系统中的全部super_block,可是出现与下面相似的错误:html

http://stackoverflow.com/q/5051111/941650node

 

也能够参考他的解决方法,到System.map中去查找真实地址,不过这样不是解决问题的最好方法。linux

先贴出当前的代码app

   1: #include <linux/module.h>
   2: #include <linux/fs.h>
   3:  
   4: MODULE_LICENSE("GPL");
   5:  
   6:  
   7: void printRawData(unsigned long size, const u_char* data)
   8: {
   9:     if (size == 0)
  10:     {
  11:         return;
  12:     }
  13:  
  14:     printk("Memory at 0x%08x\n", (u32)data);
  15:     unsigned long i = 0;
  16:     for (i=0;i<16;i++)
  17:     {
  18:         printk("%4X", i);
  19:     }
  20:     printk("\n");
  21:     for (i=0;i<16;i++)
  22:     {
  23:         printk("%4s", "__");
  24:     }
  25:  
  26:     char lineSummary[17] = {0,};
  27:     unsigned long pos = 0;
  28:     for (i=0;i<size;i++)
  29:     {
  30:         if ((pos = i % 16) == 0)
  31:         {
  32:             if (i != 0)
  33:             {
  34:                 printk(" ---- %s\n", lineSummary);
  35:                 memset(lineSummary, 0, 17);
  36:             }
  37:             else
  38:             {
  39:                 printk("\n");
  40:             }        
  41:         }
  42:  
  43:         printk("  %02X", *(data + i));
  44:  
  45:         if (*(data + i) >= 0x20 && *(data + i) <= 0x7E)
  46:         {
  47:             lineSummary[pos] = *(data + i);
  48:         }
  49:         else
  50:         {
  51:             lineSummary[pos] = ' ';
  52:         }
  53:     }
  54:  
  55:     if (size % 16 != 0)
  56:     {
  57:         for (i=0;i<16 - (size%16);i++)
  58:         {
  59:             printk("    ");
  60:         }
  61:     }
  62:  
  63:     printk(" ---- %s\n", lineSummary);
  64:     printk("\n");    
  65: }
  66:  
  67: void AnalyzeSuperBlock()
  68: {
  69:     struct super_block* item;
  70:     struct list_head * super_blocks = 0xc1778bc0;
  71:  
  72:     list_for_each_entry(item,super_blocks,s_list)
  73:     {
  74:         printk("super_block 0x%08X %s\n", item, item->s_id);
  75:     }
  76: }
  77:  
  78: static int pslist_init()
  79: {
  80:     printk("###################################################################\n");
  81:     AnalyzeSuperBlock();
  82:     return 0;
  83: }
  84:  
  85: static void pslist_exit()
  86: {
  87:     printk("###################################################################\n");
  88: }
  89:  
  90:  
  91:  
  92: module_init(pslist_init);
  93: module_exit(pslist_exit);

结果:post

   1: [153479.359674] ###################################################################
   2: [153479.359677] super_block 0xF5404800 sysfs
   3: [153479.359678] super_block 0xF5404A00 rootfs
   4: [153479.359679] super_block 0xF5404C00 bdev
   5: [153479.359680] super_block 0xF5404E00 proc
   6: [153479.359681] super_block 0xF545AC00 tmpfs
   7: [153479.359682] super_block 0xF545AE00 devtmpfs
   8: [153479.359683] super_block 0xF5464400 debugfs
   9: [153479.359684] super_block 0xF5464A00 sockfs
  10: [153479.359685] super_block 0xF551F800 pipefs
  11: [153479.359686] super_block 0xF551FA00 anon_inodefs
  12: [153479.359686] super_block 0xF551FC00 securityfs
  13: [153479.359687] super_block 0xF5792200 devpts
  14: [153479.359688] super_block 0xF57A8000 hugetlbfs
  15: [153479.359689] super_block 0xF57A8800 mqueue
  16: [153479.359690] super_block 0xF4C57000 sysfs
  17: [153479.359691] super_block 0xF4C4AC00 tmpfs
  18: [153479.359692] super_block 0xF4DB3C00 fusectl
  19: [153479.359693] super_block 0xF4D57000 sda1
  20: [153479.359694] super_block 0xF4C99600 tmpfs
  21: [153479.359695] super_block 0xF4D3CC00 tmpfs
  22: [153479.359696] super_block 0xEF20DC00 binfmt_misc
  23: [153479.359697] super_block 0xF2F23C00 vboxsf
  24: [153479.359698] super_block 0xEF12AA00 vboxsf
  25: [153479.359699] super_block 0xEE76B800 vboxsf
  26: [153479.359700] super_block 0xF2CBC600 fuse
  27: [153479.359701] super_block 0xEDA70400 vboxsf
  28: [153479.361922] ###################################################################

转载于:https://www.cnblogs.com/long123king/p/3534664.htmlspa