xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: print "debug=y|n" during hypervisor startup
@ 2013-01-30 12:29 Dario Faggioli
  2013-01-30 12:35 ` Andrew Cooper
  2013-01-30 13:51 ` Keir Fraser
  0 siblings, 2 replies; 4+ messages in thread
From: Dario Faggioli @ 2013-01-30 12:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Ian Campbell

So that we can easily figure out whether or not we are running a
debug build of Xen (e.g., via `xl dmesg').

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -577,6 +577,11 @@ void __init console_init_preirq(void)
 {
     char *p;
     int sh;
+    char debug = 'n';
+
+#ifndef NDEBUG
+    debug = 'y';
+#endif
 
     serial_init_preirq();
 
@@ -608,9 +613,9 @@ void __init console_init_preirq(void)
     spin_lock(&console_lock);
     __putstr(xen_banner());
     spin_unlock(&console_lock);
-    printk("Xen version %d.%d%s (%s@%s) (%s) %s\n",
+    printk("Xen version %d.%d%s (%s@%s debug=%c) (%s) %s\n",
            xen_major_version(), xen_minor_version(), xen_extra_version(),
-           xen_compile_by(), xen_compile_domain(),
+           xen_compile_by(), xen_compile_domain(), debug,
            xen_compiler(), xen_compile_date());
     printk("Latest ChangeSet: %s\n", xen_changeset());

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

* Re: [PATCH] xen: print "debug=y|n" during hypervisor startup
  2013-01-30 12:29 [PATCH] xen: print "debug=y|n" during hypervisor startup Dario Faggioli
@ 2013-01-30 12:35 ` Andrew Cooper
  2013-01-30 13:51 ` Keir Fraser
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2013-01-30 12:35 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Keir Fraser, Ian Campbell, xen-devel

On 30/01/13 12:29, Dario Faggioli wrote:
> So that we can easily figure out whether or not we are running a
> debug build of Xen (e.g., via `xl dmesg').
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
>
> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -577,6 +577,11 @@ void __init console_init_preirq(void)
>  {
>      char *p;
>      int sh;
> +    char debug = 'n';
> +
> +#ifndef NDEBUG
> +    debug = 'y';
> +#endif

While the compiler should certainly do the right thing,


#ifndef NDEBUG
char debug = 'y';
#else
char debug = 'n';
#endif

is arguably neater.

~Andrew

>  
>      serial_init_preirq();
>  
> @@ -608,9 +613,9 @@ void __init console_init_preirq(void)
>      spin_lock(&console_lock);
>      __putstr(xen_banner());
>      spin_unlock(&console_lock);
> -    printk("Xen version %d.%d%s (%s@%s) (%s) %s\n",
> +    printk("Xen version %d.%d%s (%s@%s debug=%c) (%s) %s\n",
>             xen_major_version(), xen_minor_version(), xen_extra_version(),
> -           xen_compile_by(), xen_compile_domain(),
> +           xen_compile_by(), xen_compile_domain(), debug,
>             xen_compiler(), xen_compile_date());
>      printk("Latest ChangeSet: %s\n", xen_changeset());
>  
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH] xen: print "debug=y|n" during hypervisor startup
  2013-01-30 12:29 [PATCH] xen: print "debug=y|n" during hypervisor startup Dario Faggioli
  2013-01-30 12:35 ` Andrew Cooper
@ 2013-01-30 13:51 ` Keir Fraser
  2013-01-30 14:18   ` Dario Faggioli
  1 sibling, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2013-01-30 13:51 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel; +Cc: Ian Campbell

On 30/01/2013 04:29, "Dario Faggioli" <dario.faggioli@citrix.com> wrote:

> So that we can easily figure out whether or not we are running a
> debug build of Xen (e.g., via `xl dmesg').
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
>
> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -577,6 +577,11 @@ void __init console_init_preirq(void)
>  {
>      char *p;
>      int sh;
> +    char debug = 'n';
> +
> +#ifndef NDEBUG
> +    debug = 'y';
> +#endif
>  
>      serial_init_preirq();
>  
> @@ -608,9 +613,9 @@ void __init console_init_preirq(void)
>      spin_lock(&console_lock);
>      __putstr(xen_banner());
>      spin_unlock(&console_lock);
> -    printk("Xen version %d.%d%s (%s@%s) (%s) %s\n",
> +    printk("Xen version %d.%d%s (%s@%s debug=%c) (%s) %s\n",
>             xen_major_version(), xen_minor_version(), xen_extra_version(),
> -           xen_compile_by(), xen_compile_domain(),
> +           xen_compile_by(), xen_compile_domain(), debug,
>             xen_compiler(), xen_compile_date());

Rather odd to put it in with the xen_compile_by() info. How about before
xen_compile_date(), and not inside any brackets?

 -- Keir

>      printk("Latest ChangeSet: %s\n", xen_changeset());
>  

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

* Re: [PATCH] xen: print "debug=y|n" during hypervisor startup
  2013-01-30 13:51 ` Keir Fraser
@ 2013-01-30 14:18   ` Dario Faggioli
  0 siblings, 0 replies; 4+ messages in thread
From: Dario Faggioli @ 2013-01-30 14:18 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Ian Campbell, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1149 bytes --]

On Wed, 2013-01-30 at 05:51 -0800, Keir Fraser wrote: 
> > @@ -608,9 +613,9 @@ void __init console_init_preirq(void)
> >      spin_lock(&console_lock);
> >      __putstr(xen_banner());
> >      spin_unlock(&console_lock);
> > -    printk("Xen version %d.%d%s (%s@%s) (%s) %s\n",
> > +    printk("Xen version %d.%d%s (%s@%s debug=%c) (%s) %s\n",
> >             xen_major_version(), xen_minor_version(), xen_extra_version(),
> > -           xen_compile_by(), xen_compile_domain(),
> > +           xen_compile_by(), xen_compile_domain(), debug,
> >             xen_compiler(), xen_compile_date());
> 
> Rather odd to put it in with the xen_compile_by() info. How about before
> xen_compile_date(), and not inside any brackets?
> 
Yeah... I couldn't really make up my mind about where it was better to
put it! :-)

I'll go for what you suggest, thanks.
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)



[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2013-01-30 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 12:29 [PATCH] xen: print "debug=y|n" during hypervisor startup Dario Faggioli
2013-01-30 12:35 ` Andrew Cooper
2013-01-30 13:51 ` Keir Fraser
2013-01-30 14:18   ` Dario Faggioli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).