All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] printk log level and print rate.
@ 2006-10-27  3:19 Steven Rostedt
  2006-10-27  7:59 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2006-10-27  3:19 UTC (permalink / raw)
  To: xen-devel

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.

On a domain crash, I also added a oops_in_progress to notify that all 
prints should be printed regardless.

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) Have xen_startup = 1 on startup and turned to zero later.
2) Add a config option for changing the default thresholds
3) Having a keyhandler to change the default thresholds
4) Add a hypercall to let Dom0 change the default thresholds
5) Add a sysctl to have userspace in Dom0 change the default thresholds
     (** seeing a pattern here? **)
6) 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] 2+ messages in thread

* Re: [PATCH 0/6] printk log level and print rate.
  2006-10-27  3:19 [PATCH 0/6] printk log level and print rate Steven Rostedt
@ 2006-10-27  7:59 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2006-10-27  7:59 UTC (permalink / raw)
  To: Steven Rostedt, xen-devel

On 27/10/06 4:19 am, "Steven Rostedt" <srostedt@redhat.com> wrote:

> 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.

Two comments so far:

1. The rate-limiting code cannot rely on 'jiffies'. It's not required to
provide that variable in Xen (powerpc doesn't). Use NOW() and divide it down
(it returns a 64-bit nanoseconds value).

2. oops_in_progress is a bit cheesy. The user should be able to silence all
guest logging if they want. Let's remove it from the first cut of these
patches.

But basically it looks good. Please re-send all the patches after your next
round of fixups and I'll probably apply them at that point.

 -- Keir

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-27  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-27  3:19 [PATCH 0/6] printk log level and print rate Steven Rostedt
2006-10-27  7:59 ` Keir Fraser

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.