Horms
2006-May-15 07:47 UTC
[Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
console: allow a panic to be triggered from the xen console I''m not sure how useful this is generally, but its proving quite useful for me while working on kdump/kexec. Signed-Off-By: Horms <horms@verge.net.au> diff -r 91c77df11b43 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Wed May 10 17:30:42 2006 +0100 +++ b/xen/drivers/char/console.c Mon May 15 15:19:16 2006 +0900 @@ -701,6 +701,19 @@ void panic(const char *fmt, ...) machine_restart(0); } +static void do_panic_trigger(unsigned char key) +{ + printk("triggering panic\n"); + panic("CPU%d triggered panic\n", smp_processor_id()); +} + +static __init int register_panic_trigger(void) +{ + register_keyhandler(''p'', do_panic_trigger, "trigger a panic"); + return 0; +} +__initcall(register_panic_trigger); + /* * Local variables: * mode: C _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Horms
2006-Jul-07 01:09 UTC
[Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
Hi, this is a resend of this patch, which I believe is a simple but useful feature. I have used it extensively to test the kdump patches which I have been developing with my colleague Magnus Damm. It is probably useful for other purposes too, and is analogous to the trigger crashdump feature of Linux''s sysrq. -- Horms console: allow a panic to be triggered from the xen console I''m not sure how useful this is generally, but its proving quite useful for me while working on kdump/kexec. Signed-Off-By: Horms <horms@verge.net.au> diff -r 91c77df11b43 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Wed May 10 17:30:42 2006 +0100 +++ b/xen/drivers/char/console.c Mon May 15 15:19:16 2006 +0900 @@ -701,6 +701,19 @@ void panic(const char *fmt, ...) machine_restart(0); } +static void do_panic_trigger(unsigned char key) +{ + printk("triggering panic\n"); + panic("CPU%d triggered panic\n", smp_processor_id()); +} + +static __init int register_panic_trigger(void) +{ + register_keyhandler(''p'', do_panic_trigger, "trigger a panic"); + return 0; +} +__initcall(register_panic_trigger); + /* * Local variables: * mode: C _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jul-10 16:50 UTC
Re: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
On 7 Jul 2006, at 02:09, Horms wrote:> this is a resend of this patch, which I believe is a simple but > useful feature. I have used it extensively to test the kdump > patches which I have been developing with my colleague Magnus Damm. > It is probably useful for other purposes too, and is analogous > to the trigger crashdump feature of Linux''s sysrq.On Linux the sysrq only does anything if kexec is in use and a crash image has been provided (crash_kexec). Perhaps you should do the same and make this part of the Xen portion of your kexec patches? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christian Limpach
2006-Jul-10 20:44 UTC
Re: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
On 7/10/06, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 7 Jul 2006, at 02:09, Horms wrote: > > > this is a resend of this patch, which I believe is a simple but > > useful feature. I have used it extensively to test the kdump > > patches which I have been developing with my colleague Magnus Damm. > > It is probably useful for other purposes too, and is analogous > > to the trigger crashdump feature of Linux''s sysrq. > > On Linux the sysrq only does anything if kexec is in use and a crash > image has been provided (crash_kexec). Perhaps you should do the same > and make this part of the Xen portion of your kexec patches?Also please use D (dump?) instead of p. p is already used by the performance counters. I''m a bit concerned that we might eventually run out of keys... Is this really useful? christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Horms
2006-Jul-11 00:48 UTC
Re: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
On Mon, Jul 10, 2006 at 05:50:46PM +0100, Keir Fraser wrote:> > On 7 Jul 2006, at 02:09, Horms wrote: > > >this is a resend of this patch, which I believe is a simple but > >useful feature. I have used it extensively to test the kdump > >patches which I have been developing with my colleague Magnus Damm. > >It is probably useful for other purposes too, and is analogous > >to the trigger crashdump feature of Linux''s sysrq. > > On Linux the sysrq only does anything if kexec is in use and a crash > image has been provided (crash_kexec). Perhaps you should do the same > and make this part of the Xen portion of your kexec patches?Sure, I can do that. Though a general panic button seemed more useful to me at the time. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Horms
2006-Jul-11 00:51 UTC
Re: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
On Mon, Jul 10, 2006 at 09:44:57PM +0100, Christian Limpach wrote:> On 7/10/06, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > > >On 7 Jul 2006, at 02:09, Horms wrote: > > > >> this is a resend of this patch, which I believe is a simple but > >> useful feature. I have used it extensively to test the kdump > >> patches which I have been developing with my colleague Magnus Damm. > >> It is probably useful for other purposes too, and is analogous > >> to the trigger crashdump feature of Linux''s sysrq. > > > >On Linux the sysrq only does anything if kexec is in use and a crash > >image has been provided (crash_kexec). Perhaps you should do the same > >and make this part of the Xen portion of your kexec patches? > > Also please use D (dump?) instead of p. p is already used by the > performance counters. > > I''m a bit concerned that we might eventually run out of keys... Is > this really useful?Its definately useful for testing, definately during development, perhaps for production systems. I''ll change it over to use D, incoporate Keir''s suggestion, and include it in the next kexec patches. It can always be axed if it prooves troublesome. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jul-11 06:31 UTC
Re: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
On 11 Jul 2006, at 01:48, Horms wrote:>> On Linux the sysrq only does anything if kexec is in use and a crash >> image has been provided (crash_kexec). Perhaps you should do the same >> and make this part of the Xen portion of your kexec patches? > > Sure, I can do that. Though a general panic button seemed more > useful to me at the time.We already have ''d'' key for obtaining a backtrace and register dump on every CPU in the system. I don''t think a panic would be any more useful than that. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel