[Crash-utility] What should "list -h" be doing?

Petr Tesarik ptesarik at suse.cz
Mon Apr 16 11:49:58 UTC 2012


Hi,

I think the behaviour of the (undocumented) "list -h" command is hardly 
useful. I believe the intention was to cover cases like struct anon_vma, which 
is linked through a list_head (not at the beginning of the structure) and does 
not have an external struct list_head. However, it doesn't work for that case:

crash> struct -o anon_vma
struct anon_vma {
   [0x0] struct anon_vma *root;
   [0x4] spinlock_t lock;
   [0x8] atomic_t external_refcount;
   [0xc] struct list_head head;
}

Now, let's have an anon_vma at 0xf0749d38
crash> anon_vma 0xf0749d38
struct anon_vma {
  root = 0xf0749d38, 
  /* left out for brevity */
  head = {
    next = 0xf6c34708, 
    prev = 0xf6c34d80
  }
}

I would assume that I can walk all linked anon_vma's with

list -o anon_vma.head -h 0xf0749d38

But that still expects a pointer to struct list_head. I would have to do

list -o anon_vma.head -h 0xf0749d38+0xc

That's awkward. But maybe it's how it should work, because it's not clear what 
the "-h" should be doing.

Anyway, I think the "list" command could help with walking the anon_vma list. 
I can surely add another option letter for that purpose, but before doing 
that, I'd like to ask if this is merely missing documentation and a bug in the 
implemenatation of the existing "-h" option.

Thanks for your patience,
Petr Tesarik




More information about the Crash-utility mailing list