Re: [PATCH v2 08/13] tracing: Improve panic/die notifiers

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

 



On Tue, 16 Aug 2022 10:57:20 -0400
Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

> > static int trace_die_panic_handler(struct notifier_block *self,
> > 				unsigned long ev, void *unused)
> > {
> > 	if (!ftrace_dump_on_oops)
> > 		return NOTIFY_DONE;
> > 
> > 	/* The die notifier requires DIE_OOPS to trigger */
> > 	if (self == &trace_die_notifier && ev != DIE_OOPS)
> > 		return NOTIFY_DONE;
> > 
> > 	ftrace_dump(ftrace_dump_on_oops);
> > 
> > 	return NOTIFY_DONE;
> > }  
> 
> Or better yet:
> 
> 	if (ftrace_dump_on_oops) {
> 
> 		/* The die notifier requires DIE_OOPS to trigger */
> 		if (self != &trace_die_notifier || ev == DIE_OOPS)
> 			ftrace_dump(ftrace_dump_on_oops);
> 	}
> 	return NOTIFY_DONE;
> 

That may be more consolidated but less easy to read and follow. This is far
from a fast path.

As I maintain this bike-shed, I prefer the one I suggested ;-)

-- Steve

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



[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