makedumpfile -g with recent kernels

Atsushi Kumagai kumagai-atsushi at
Thu Aug 2 01:12:51 EDT 2012

Hello Stefan,

On Mon, 09 Jul 2012 11:17:13 +0200
Stefan Bader <stefan.bader at> wrote:

> Hi,
> I am not sure whether this really is the preferred way as I heard the required
> info now is in vmcore and vmcoreinfo would not be needed anymore. But just to
> have it produce some output I noticed that it trips again over some member of
> struct page that moved into some anonymous structure/union combo.
> There was some code that was quite specific for the page.mapping case (which now
> seems to be outside again). I changed the code to be more generic. It did fix my
> _count problem and should also handle the mapping case (though I could not test).
> So maybe this would be worth adding to the upstream code.
> -Stefan
> Please include me in cc's as I am not subscribed to this ml.

Thank you for your nice work!

I think your idea is basically good, however your patch can't take care of
the member of union (e.g. page.lru in kernel 3.2). 
Because the member of union hasn't DW_AT_data_member_location and dwarf_info.member_offset
isn't be initialized. Therefore, adjust_member_offset() doesn't work for the member of union.

  static void
  adjust_member_offset(Dwarf_Die *die)
          long offset;

          if (dwarf_info.member_offset == NOT_FOUND_STRUCTURE)     // this comparison is always true
          if (!get_data_member_location(die, &offset))
          dwarf_info.member_offset += offset;

At least, the change below works fine without regression.

diff --git a/dwarf_info.c b/dwarf_info.c
index 583df53..03e4c90 100644
--- a/dwarf_info.c
+++ b/dwarf_info.c
@@ -520,7 +520,9 @@ search_member(Dwarf_Die *die)
                         * Get the member offset.
-                       if (!get_data_member_location(walker, &offset))
+                       if (dwarf_tag(die) == DW_TAG_union_type)
+                               offset = 0;
+                       else if (!get_data_member_location(walker, &offset))
                        dwarf_info.member_offset = offset;
                        return TRUE;

Unless you have better way to fix this issue, I'll merge your patch into
the next version with the change above.

By the way, this fix enable us also to get the offset of page._mapcount and
page.private, it's very helpful for the new method of free page filtering.

Atsushi Kumagai

More information about the kexec mailing list