All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Cc: V Srivatsa <vsrivatsa@in.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	kexec@lists.infradead.org, Dave Anderson <anderson@redhat.com>,
	Prerna Saxena <prerna@linux.vnet.ibm.com>,
	Reinhard <BUENDGEN@de.ibm.com>
Subject: Re: [PATCH v2 2/8] makedumpfile: Apply relocation while loading module debuginfo.
Date: Thu, 28 Jul 2011 16:08:15 +0530	[thread overview]
Message-ID: <4E313C17.7050609@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110728181146.d91ee265.oomichi@mxs.nes.nec.co.jp>

Hi Keni'chi,

On 07/28/2011 02:41 PM, Ken'ichi Ohmichi wrote:
> 
> Hi Mahesh,
> 
> This feature's patches are very large, and I created a devel branch
> on sourceforge git tree for sharing the code with you.
> 
> http://makedumpfile.git.sourceforge.net/git/gitweb.cgi?p=makedumpfile/makedumpfile;a=shortlog;h=refs/heads/filter-out-devel
> 
> I commited all of your patches and my cleanup patches.
> If you notice some problems or cleate some patches, please let me know them.
> 

Sure. Will take a look.

> On Wed, 27 Jul 2011 11:39:44 +0530
> Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>>>> + *
>>>> + * This function uses dwfl API's to apply relocation before reading the
>>>> + * dwarf information from module debuginfo.
>>>> + * On success, this function sets the dwarf_info.elfd and dwarf_info.dwarfd
>>>> + * after applying relocation to module debuginfo.
>>>> + */
>>>> +static int
>>>> +init_dwarf_info(void)
>>>
>>> Is the searching method of debuginfo file only for kernel module ?
>>> Or also for vmlinux ?
>>
>> Yes, the searching method is only for module debuginfo. For vmlinux we
>> set the dwarf_info.name_debuginfo before call to init_dwarf_info() and
>> we never call search routine dwfl_linux_kernel_report_offline() for
>> vmlinux. The routine dwfl_report_offline() applies the relocation on
>> specified debuginfo module. In case vmlinux it basically does nothing.
>>
>>> I feel this function is a little complex, and I'd like to make it simple.
>>> If only for kernel module, we can do it by separating the searching method
>>> from this function and calling it in case of kernel module.
>>
>> The init_dwarf_info() function gets called everytime when
>> get_debug_info() is called. The get_debug_info() is called multiple
>> times for same debuginfo file. This function tries to avoid the repeated
>> search for same debuginfo, hence the function is little complex.
>> 	- In case of kernel module the very first invocation of
>> init_dwarf_info() would call dwfl_linux_kernel_report_offline() which
>> will iterate over the available kernel modules and process the debuginfo
>> only for the module for which we are interested in.
>> 	- We set the dwarf_info.name_debuginfo with the debuginfo file name
>> found during the first invocation.
>> 	- The second invocation of init_dwarf_info() for same kernel module,
>> will find dwarf_info.name_debuginfo is already set and will avoid the
>> debuginfo search. In this case it will just apply relocation using
>> routine dwfl_report_offline().
>>
>> This function does not have any special handling code for vmlinux. The
>> function is independent of whether it is called for vmlinux or kernel
>> module. In case of vmlinux this function has absolutely no side effects.
> 
> If adding the searching method to the blow position and removing the code
> from init_dwarf_info(), I guess it makes the code simple.
> 
> @ process_config_file()
>  9402                         if (!set_dwarf_debuginfo(config->module_name,
>  9403                                                                 NULL, -1)) {
>  9404                                 ERRMSG("Skipping to next Module section\n");
>  9405                                 skip_section = 1;
>  9406                                 free_config(config);
>  9407                                 continue;
>  9408                         }
>  9409                         << HERE >> 

This may not be the correct place to call search method. We may end up
calling search method multiple times for same kernel module. I think
moving the search method inside set_dwarf_debuginfo() routine at below
position is a better place:

@set_dwarf_debuginfo()
	......
	......
	if (!strcmp(dwarf_info.module_name, "vmlinux") ||
                !strcmp(dwarf_info.module_name, "xen-syms"))
                return TRUE;
+	 << HERE >>
-        /* check to see whether module debuginfo is available */
-        if (!init_dwarf_info())
-                return FALSE;
-        else
-                clean_dwfl_info();
	 return TRUE;
}

And then we can remove search routine from init_dwarf_info(). What do
you think?

Thanks,
-Mahesh.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2011-07-28 10:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 20:01 [PATCH v2 2/8] makedumpfile: Apply relocation while loading module debuginfo Mahesh J Salgaonkar
2011-07-15  9:35 ` Ken'ichi Ohmichi
2011-07-15 10:21   ` Mahesh Jagannath Salgaonkar
2011-07-19  2:27     ` Ken'ichi Ohmichi
2011-07-19  9:59       ` Mahesh Jagannath Salgaonkar
2011-07-19 13:08         ` Ken'ichi Ohmichi
2011-07-25  8:11 ` Ken'ichi Ohmichi
2011-07-27  6:09   ` Mahesh Jagannath Salgaonkar
2011-07-28  9:11     ` Ken'ichi Ohmichi
2011-07-28 10:38       ` Mahesh Jagannath Salgaonkar [this message]
2011-07-29  7:21         ` Ken'ichi Ohmichi
2011-08-09 17:42           ` Mahesh J Salgaonkar
2011-08-10  2:30             ` Ken'ichi Ohmichi
2011-07-28 15:11       ` Mahesh Jagannath Salgaonkar
2011-07-29  7:24         ` Ken'ichi Ohmichi
     [not found] <CAA393vjc3vE3PG7EW70+8q3rTfv+yxcN-MbVGvH-nSUE9kCqVw@mail.gmail.com>
2011-07-15 15:08 ` Ken'ichi Ohmichi

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=4E313C17.7050609@linux.vnet.ibm.com \
    --to=mahesh@linux.vnet.ibm.com \
    --cc=BUENDGEN@de.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=anderson@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=oomichi@mxs.nes.nec.co.jp \
    --cc=prerna@linux.vnet.ibm.com \
    --cc=vsrivatsa@in.ibm.com \
    /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.