makedumpfile -g with recent kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Stefan,

On Mon, 09 Jul 2012 11:17:13 +0200
Stefan Bader <stefan.bader at canonical.com> 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
                  return;
          if (!get_data_member_location(die, &offset))
                  return;
          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))
                                continue;
                        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.

  http://lists.infradead.org/pipermail/kexec/2012-June/006441.html


Thanks
Atsushi Kumagai



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux