All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 0/6] printk log level and print rate.
Date: Thu, 26 Oct 2006 23:19:21 -0400	[thread overview]
Message-ID: <45417AB9.3030709@redhat.com> (raw)

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

             reply	other threads:[~2006-10-27  3:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-27  3:19 Steven Rostedt [this message]
2006-10-27  7:59 ` [PATCH 0/6] printk log level and print rate Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45417AB9.3030709@redhat.com \
    --to=srostedt@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.