Skip to content

Commit

Permalink
xen/console: Set the default log level to INFO for release builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Roger Pau Monné <[email protected]>
Reviewed-by: Andrew Cooper <[email protected]>
  • Loading branch information
rosslagerwall authored and andyhhp committed Aug 29, 2023
1 parent 47342d8 commit 8c01f26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/misc/xen-command-line.pandoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions xen/drivers/char/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 8c01f26

Please sign in to comment.