[Crash-utility] Fix bug of list -h
Dave Anderson
anderson at redhat.com
Fri Jun 1 12:55:11 UTC 2012
----- Original Message -----
> 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.
There are "problems" with it because it is not supported/advertised.
Either I started work on it and never completed it, or maybe I realized
that there was no need for it. I honestly don't remember. In any case,
Petr Tesarik was planning to look into resurrecting it as well:
[Crash-utility] What should "list -h" be doing?
https://www.redhat.com/archives/crash-utility/2012-April/msg00030.html
Petr, is this patch what you had in mind?
Dave
> 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
>
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>
More information about the Crash-utility
mailing list