[Crash-utility] Fix bug of list -h

qiaonuohan qiaonuohan at cn.fujitsu.com
Fri Jun 1 03:52:17 UTC 2012


Hello Dave,

When investigating list command, I found the "-h" is involved but not
discussed in help page. And then I tried to use, but I find some
problems with it.

The first, I made patch to show it. The "ld->start" should be the
pointer to the structure list_head.

And the second one, I am not sure about the reason why you don't
display the node related to the address user input. I will take the
tasks of task_struct as an example.


crash> task_struct.tasks ffff8800371a0ac0
   tasks = {
     next = 0xffffffff81a8d468,
     prev = 0xffff88004a9e0f88
   }
crash> list task_struct.tasks -s task_struct.tasks -h ffff8800371a0ac0
ffffffff81a8d020
   tasks = {
     next = 0xffff88004eaf1908,
     prev = 0xffff8800371a0f08
   }
ffff88004eaf14c0
   tasks = {
     next = 0xffff88004eaf0ec8,
     prev = 0xffffffff81a8d468
   }
...

As the command shows, the command neglect the task_struct at
ffff8800371a0ac0. I don't know why it is omitted. And if only one node
is in the list, why prints "(empty)"?

                 readmem(ld->start, KVADDR, &ld->start, sizeof(void *),
                         "LIST_HEAD contents", FAULT_ON_ERROR);
                 if (ld->start == ld->end) {
                         fprintf(fp, "(empty)\n");
                         return;
                 }


-- 
--
Regards
Qiao Nuohan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-list-h.patch
Type: text/x-patch
Size: 1122 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120601/1890cb73/attachment.bin>


More information about the Crash-utility mailing list