diff mbox series

xen/console: Set the default log level to INFO for release builds

Message ID 20230824090258.96775-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen/console: Set the default log level to INFO for release builds | expand

Commit Message

Roger Pau Monné Aug. 24, 2023, 9:02 a.m. UTC
From: Ross Lagerwall <ross.lagerwall@citrix.com>

Not displaying INFO messages by default on release builds is not
helpful, as messages of that level are relevant for hypervisor
operation.  For example messages related to livepatches applied and
reverted are of INFO level.

Custom builds that require less verbose output can adjust it using the
command line, but attempt to provide all relevant information by
default on release builds.

Adjust the loglevel of printks that don't have an associated level to
INFO instead of WARNING, since INFO will now be printed by default on
all builds.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.pandoc | 2 +-
 xen/drivers/char/console.c        | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Cooper Aug. 24, 2023, 9:51 a.m. UTC | #1
On 24/08/2023 10:02 am, Roger Pau Monne wrote:
> From: Ross Lagerwall <ross.lagerwall@citrix.com>
>
> Not displaying INFO messages by default on release builds is not
> helpful, as messages of that level are relevant for hypervisor
> operation.  For example messages related to livepatches applied and
> reverted are of INFO level.
>
> Custom builds that require less verbose output can adjust it using the
> command line, but attempt to provide all relevant information by
> default on release builds.
>
> Adjust the loglevel of printks that don't have an associated level to
> INFO instead of WARNING, since INFO will now be printed by default on
> all builds.
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

This is very long overdue.
diff mbox series

Patch

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 5f388eb560c9..a3145983f623 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1706,7 +1706,7 @@  This option is available for hypervisors built with CONFIG_DEBUG_LOCKS only.
 ### loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
-> Default: `loglvl=warning`
+> Default: `loglvl=info`
 
 > Can be modified at runtime
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 0e410fa086df..f81b8b6b47d0 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -136,8 +136,8 @@  static DEFINE_SPINLOCK(console_lock);
  * the lower threshold equal to the upper.
  */
 #ifdef NDEBUG
-#define XENLOG_UPPER_THRESHOLD       2 /* Do not print INFO and DEBUG  */
-#define XENLOG_LOWER_THRESHOLD       2 /* Always print ERR and WARNING */
+#define XENLOG_UPPER_THRESHOLD       3 /* Do not print DEBUG  */
+#define XENLOG_LOWER_THRESHOLD       3 /* Always print INFO, ERR and WARNING */
 #define XENLOG_GUEST_UPPER_THRESHOLD 2 /* Do not print INFO and DEBUG  */
 #define XENLOG_GUEST_LOWER_THRESHOLD 0 /* Rate-limit ERR and WARNING   */
 #else
@@ -150,7 +150,7 @@  static DEFINE_SPINLOCK(console_lock);
  * The XENLOG_DEFAULT is the default given to printks that
  * do not have any print level associated with them.
  */
-#define XENLOG_DEFAULT       1 /* XENLOG_WARNING */
+#define XENLOG_DEFAULT       2 /* XENLOG_INFO */
 #define XENLOG_GUEST_DEFAULT 1 /* XENLOG_WARNING */
 
 static int __read_mostly xenlog_upper_thresh = XENLOG_UPPER_THRESHOLD;