All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6 V2] printk log level and print rate.
@ 2006-10-27 15:31 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2006-10-27 15:31 UTC (permalink / raw)
  To: xen-devel, Keir.Fraser

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-27 15:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-27 15:31 [PATCH 0/6 V2] printk log level and print rate Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.