makedumpfile -g with recent kernels
kumagai-atsushi at mxc.nes.nec.co.jp
Thu Aug 2 01:12:51 EDT 2012
On Mon, 09 Jul 2012 11:17:13 +0200
Stefan Bader <stefan.bader at canonical.com> wrote:
> 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.
> 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.
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
@@ -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;
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.
More information about the kexec