public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: warn on vmlinux without dwarf
@ 2013-05-15 18:43 Cliff Wickman
  2013-05-20  2:20 ` Atsushi Kumagai
  0 siblings, 1 reply; 3+ messages in thread
From: Cliff Wickman @ 2013-05-15 18:43 UTC (permalink / raw)
  To: kexec; +Cc: d.hatayama, kumagai-atsushi

From: Cliff Wickman <cpw@sgi.com>

If the vmlinux does not have dwarf information makedumpfile fails in
a rather obscure way, with a flood of redundant errors,

Make it fail with more of a hint of what is wrong.

Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 dwarf_info.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: makedumpfile.mmap/dwarf_info.c
===================================================================
--- makedumpfile.mmap.orig/dwarf_info.c
+++ makedumpfile.mmap/dwarf_info.c
@@ -139,6 +139,10 @@ process_module (Dwfl_Module *dwflmod,
 
 	/* get a debug context descriptor.*/
 	dwarf_info.dwarfd = dwfl_module_getdwarf (dwflmod, &dwbias);
+	if (dwarf_info.dwarfd == NULL) {
+		fprintf(stderr, "makedumpfile: dwfl_module_getdwarf error\n");
+		exit(1);
+	}
 	dwarf_info.elfd = dwarf_getelf(dwarf_info.dwarfd);
 
 	mod_name = dwfl_module_info(dwflmod, NULL, NULL, NULL, NULL, NULL,

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] makedumpfile: warn on vmlinux without dwarf
  2013-05-15 18:43 [PATCH] makedumpfile: warn on vmlinux without dwarf Cliff Wickman
@ 2013-05-20  2:20 ` Atsushi Kumagai
  2013-05-20 12:17   ` Cliff Wickman
  0 siblings, 1 reply; 3+ messages in thread
From: Atsushi Kumagai @ 2013-05-20  2:20 UTC (permalink / raw)
  To: cpw; +Cc: d.hatayama, kexec

On Wed, 15 May 2013 13:43:59 -0500
Cliff Wickman <cpw@sgi.com> wrote:

> From: Cliff Wickman <cpw@sgi.com>
> 
> If the vmlinux does not have dwarf information makedumpfile fails in
> a rather obscure way, with a flood of redundant errors,
> 
> Make it fail with more of a hint of what is wrong.
> 
> Signed-off-by: Cliff Wickman <cpw@sgi.com>
> ---
>  dwarf_info.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> Index: makedumpfile.mmap/dwarf_info.c
> ===================================================================
> --- makedumpfile.mmap.orig/dwarf_info.c
> +++ makedumpfile.mmap/dwarf_info.c
> @@ -139,6 +139,10 @@ process_module (Dwfl_Module *dwflmod,
>  
>  	/* get a debug context descriptor.*/
>  	dwarf_info.dwarfd = dwfl_module_getdwarf (dwflmod, &dwbias);
> +	if (dwarf_info.dwarfd == NULL) {
> +		fprintf(stderr, "makedumpfile: dwfl_module_getdwarf error\n");
> +		exit(1);
> +	}

I agree to insert this message here, but don't agree to abort without
any error handling.
I think the code below seems better:

 	if (dwarf_info.dwarfd == NULL) {
 		ERRMSG("dwfl_module_getdwarf error.\n");
 		return DWARF_CB_ABORT;
 	}


Thanks
Atsushi Kumagai

>  	dwarf_info.elfd = dwarf_getelf(dwarf_info.dwarfd);
>  
>  	mod_name = dwfl_module_info(dwflmod, NULL, NULL, NULL, NULL, NULL,
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] makedumpfile: warn on vmlinux without dwarf
  2013-05-20  2:20 ` Atsushi Kumagai
@ 2013-05-20 12:17   ` Cliff Wickman
  0 siblings, 0 replies; 3+ messages in thread
From: Cliff Wickman @ 2013-05-20 12:17 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: d.hatayama, kexec

On Mon, May 20, 2013 at 11:20:44AM +0900, Atsushi Kumagai wrote:
> On Wed, 15 May 2013 13:43:59 -0500
> Cliff Wickman <cpw@sgi.com> wrote:
> 
> > From: Cliff Wickman <cpw@sgi.com>
> > 
> > If the vmlinux does not have dwarf information makedumpfile fails in
> > a rather obscure way, with a flood of redundant errors,
> > 
> > Make it fail with more of a hint of what is wrong.
> > 
> > Signed-off-by: Cliff Wickman <cpw@sgi.com>
> > ---
> >  dwarf_info.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > Index: makedumpfile.mmap/dwarf_info.c
> > ===================================================================
> > --- makedumpfile.mmap.orig/dwarf_info.c
> > +++ makedumpfile.mmap/dwarf_info.c
> > @@ -139,6 +139,10 @@ process_module (Dwfl_Module *dwflmod,
> >  
> >  	/* get a debug context descriptor.*/
> >  	dwarf_info.dwarfd = dwfl_module_getdwarf (dwflmod, &dwbias);
> > +	if (dwarf_info.dwarfd == NULL) {
> > +		fprintf(stderr, "makedumpfile: dwfl_module_getdwarf error\n");
> > +		exit(1);
> > +	}
> 
> I agree to insert this message here, but don't agree to abort without
> any error handling.
> I think the code below seems better:
> 
>  	if (dwarf_info.dwarfd == NULL) {
>  		ERRMSG("dwfl_module_getdwarf error.\n");
>  		return DWARF_CB_ABORT;
>  	}

Agreed.  An error code is good.

-Cliff
> 
> 
> Thanks
> Atsushi Kumagai
> 
> >  	dwarf_info.elfd = dwarf_getelf(dwarf_info.dwarfd);
> >  
> >  	mod_name = dwfl_module_info(dwflmod, NULL, NULL, NULL, NULL, NULL,
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec

-- 
Cliff Wickman
SGI
cpw@sgi.com
(651) 683-3824

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-20 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 18:43 [PATCH] makedumpfile: warn on vmlinux without dwarf Cliff Wickman
2013-05-20  2:20 ` Atsushi Kumagai
2013-05-20 12:17   ` Cliff Wickman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox