From: Stefan Bader <stefan.bader@canonical.com>
To: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: kexec@lists.infradead.org
Subject: Re: makedumpfile -g with recent kernels
Date: Mon, 06 Aug 2012 09:39:53 +0200 [thread overview]
Message-ID: <501F74C9.9070508@canonical.com> (raw)
In-Reply-To: <20120806145418.5fc2e5473aeb94f0348b023e@mxc.nes.nec.co.jp>
[-- Attachment #1.1: Type: text/plain, Size: 3121 bytes --]
On 06.08.2012 07:54, Atsushi Kumagai wrote:
> Hello Stefan,
>
> On Thu, 02 Aug 2012 10:23:13 +0200
> Stefan Bader <stefan.bader@canonical.com> wrote:
>
>>> 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)
>>
>> Hm, should that not be die_type to check what the walker is on? And in that case
>> it seems that check was made just before... So maybe it would be ok to assume 0
>> as the offset when getting here...?
>
> As you said, the walker will be a member of union or struct when reaching here,
> because is_anonymous_container() already checked the walker.
>
> However, get_data_member_location() must succeed if the walker is a member of struct
> while it doesn't succeed if the walker is a member of union.
> That's why I added the code to check whether the walker is a member of union or not.
Right, I was just wondering whether that would allow to simplify even more. Like
this:
case DWARF_INFO_GET_MEMBER_OFFSET_1ST_UNION:
if (!get_die_type(walker, &die_type))
continue;
if (dwarf_tag(&die_type) != DW_TAG_union_type)
continue;
/*
* At this point it is clear that this is a union.
* Though unions have no offset elements (the offset
* is always 0. So get_data_member_location would fail.
*/
dwarf_info.member_offset = 0;
return TRUE;
>
>
> Thanks
> Atsushi Kumagai
>
>>> + 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
>>>
>>
>>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2012-08-06 7:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4FFAA199.5040608@canonical.com>
2012-08-02 5:12 ` makedumpfile -g with recent kernels Atsushi Kumagai
2012-08-02 5:47 ` HATAYAMA Daisuke
2012-08-02 6:04 ` Atsushi Kumagai
2012-08-02 8:23 ` HATAYAMA Daisuke
2012-08-07 6:24 ` Atsushi Kumagai
2012-08-07 7:36 ` HATAYAMA Daisuke
[not found] ` <501A38F1.8030801@canonical.com>
2012-08-06 5:54 ` Atsushi Kumagai
2012-08-06 7:39 ` Stefan Bader [this message]
2012-08-07 6:23 ` Atsushi Kumagai
[not found] ` <5020C8D9.7060303@canonical.com>
2012-08-14 5:03 ` Atsushi Kumagai
2012-08-14 9:48 ` Stefan Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=501F74C9.9070508@canonical.com \
--to=stefan.bader@canonical.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.