[Crash-utility] printing the linked structures

Dave Anderson anderson at redhat.com
Fri Mar 8 15:31:47 UTC 2013



----- Original Message -----
> Hi,
> 
> Here is a scenario in which three structures (of type 'struct
> anon_vma_chain') are linked with the element 'struct list_head
> same_anon_vma'. Please check the following structure.
> 
> crash> struct anon_vma_chain -o
> struct anon_vma_chain {
>    [0] struct vm_area_struct *vma;
>    [4] struct anon_vma *anon_vma;
>    [8] struct list_head same_vma;
>   [16] struct list_head same_anon_vma;
> }
> SIZE: 24
> 
> The following are the three structures that are linked:
> 
> crash> anon_vma_chain -l anon_vma_chain.same_anon_vma 0xe4315510
> struct anon_vma_chain {
>   vma = 0xe43144f0,
>   anon_vma = 0xe49e2d98,
>   same_vma = {
>     next = 0xe4314528,
>     prev = 0xe43154f0
>   },
>   same_anon_vma = {
>     next = 0xe4fe4f60,
>     prev = 0xe4e833a8
>   }
> }
> 
> same_anon_vma.next=0xe4fe4f60 from the previous structure, is used to
> extract the next structure.
> 
> crash> anon_vma_chain -l anon_vma_chain.same_anon_vma 0xe4fe4f60
> struct anon_vma_chain {
>   vma = 0xe4fe85f8,
>   anon_vma = 0xe49e2d98,
>   same_vma = {
>     next = 0xe4fe8630,
>     prev = 0xe4fe4f40
>   },
>   same_anon_vma = {
>     next = 0xe45a1df8,
>     prev = 0xe4315510
>   }
> }
> 
> 
> same_anon_vma.next=0xe45a1df8 from the previous structure, is used to
> extract the next structure.
> 
> crash> anon_vma_chain -l anon_vma_chain.same_anon_vma 0xe45a1df8
> struct anon_vma_chain {
>   vma = 0xe45a73e8,
>   anon_vma = 0xe49e2d98,
>   same_vma = {
>     next = 0xe45a7420,
>     prev = 0xe45a1dd8
>   },
>   same_anon_vma = {
>     next = 0xe461fb40,
>     prev = 0xe4fe4f60
>   }
> }
> 
> Is there something like "anon_vma_chain -l
> anon_vma_chain.same_anon_vma 0xe4315510 -c 3" to get three structures
> that are linked using anon_vma_chain.same_anon_vma. Actually
> "anon_vma_chain -l anon_vma_chain.same_anon_vma 0xe4315510 -c 3"
> doesn't work in this case. It seems like -c option works only in case
> of array of structures. Could someone help me to print the above
> three
> structures with a single command?
> 
> Thanks,
> Yogesh

Check out the "list" command, and use its -s option to print
each structure in the list.

Dave




More information about the Crash-utility mailing list