Skip to content

printk log level and print rate.

Steven Rostedt xen-devel 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesNew
  2. v16 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6log level printk rate limitxen/arch/x86/mm.c xen/drivers/char/console.c xen/include/xen/lib.h+64 -30 replies
2/6log level setupxen/drivers/char/console.c xen/include/xen/config.h xen/include/xen/lib.h+165 -130 replies
3/6log level DPRINTK common codexen/common/event_channel.c xen/common/grant_table.c xen/common/memory.c +4 more+42 -320 replies
4/6log level DPRINTK x86xen/arch/x86/domain.c xen/arch/x86/extable.c xen/arch/x86/hvm/hvm.c +13 more+100 -720 replies
5/6log level power pc DPRINTKxen/arch/powerpc/mm.c xen/arch/powerpc/shadow.c+3 -30 replies
6/6log level ia64 DPRINTKxen/arch/ia64/vmx/vlsapic.c xen/arch/ia64/vmx/vmx_hypercall.c xen/arch/ia64/vmx/vmx_init.c +6 more+60 -400 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH 0/6 V2] printk log level and print rate.

Changes since last version:
* Got rid of oops_in_progress
* Use milliseconds instead of jiffies in print rate limit.
* added xen_startup=1 and cleared in console_endboot

----

The following is a rewrite of the printk log levels (plus the added print rate limit) as for Keir's suggestions.

This touches a lot so please test.

We have now four log levels to choose from, as well as a GUEST flag for prints that are controlled by something that a guest does. I tried to go though practically all DPRINTKs to see what level it should be and whether or not a GUEST should be tagged to it. But, being human and not knowing the fine details of the code surrounding the prints, I'm sure I tagged things wrong. So that said, here are the new tags:

XENLOG_ERR - non guest fatal error message. The ship is sinking. XENLOG_WARNING - non guest warning message, we can plug the holes. XENLOG_INFO - non guest info message, counting the fish we catch. XENLOG_DEBUG - non guest debug message, keep all fish, even if they are
under the limit.

XENLOG_G_ERR - guest fatal error, One of the boats is sinking. XENLOG_G_WARNING - guest warning message, we can dump the water out. XENLOG_G_INFO - guest info message, count the people on board. XENLOG_G_DEBUG - guest debug message, smuggle the illegal immigrants.

Basically, we don't trust guests. So we differentiate the guest messages with the _G_ option so that we can process these prints differently. Basically, we add a print rate limit to them.

There's also a xen_startup variable, that currently isn't set, but it should be set to 1 on startup (print everything) and cleared after dom0 is up and running. I haven't added this in yet.

There's 4 thresholds too.
XENLOG_UPPER_THRESHOLD
XENLOG_LOWER_THRESHOLD
XENLOG_GUEST_UPPER_THRESHOLD
XENLOG_GUEST_LOWER_THRESHOLD

For both the non-guest and guest, they have an upper and lower threshold. Since ERR is 0 and DEBUG is 3, what these thresholds represent is that anything above the upper is ignored, anything below the lower is always printed, and any thing in between (inclusive) is rate limited.

If the lower is greater than the upper, then only the upper is recognized, and there is no rate limiting performed. All above the upper is ignored, and all below or equal to the upper is printed.

ToDo:

1) Add a config option for changing the default thresholds
2) Having a keyhandler to change the default thresholds
3) Add a hypercall to let Dom0 change the default thresholds
4) Add a sysctl to have userspace in Dom0 change the default thresholds (** seeing a pattern here? **)
5) Tag the bare printks to use the log levels.

Currently (as Keir suggested) the default thresholds are:

non guest: upper=1 lower=2 (ERR/WARNING printed, but nothing else)
guest: upper=1 lower=0 (ERR/WARNING print rated, nothing else printed)

Feel free to comment.

-- Steve