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

Roger Pau Monne posted 1 patch 8 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230824090258.96775-1-roger.pau@citrix.com
docs/misc/xen-command-line.pandoc | 2 +-
xen/drivers/char/console.c        | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
[PATCH] xen/console: Set the default log level to INFO for release builds
Posted by Roger Pau Monne 8 months, 2 weeks ago
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(-)

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;
-- 
2.41.0


Re: [PATCH] xen/console: Set the default log level to INFO for release builds
Posted by Andrew Cooper 8 months, 2 weeks ago
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.