diff options
author | kaf24@localhost.localdomain <kaf24@localhost.localdomain> | 2006-10-27 23:47:30 +0100 |
---|---|---|
committer | kaf24@localhost.localdomain <kaf24@localhost.localdomain> | 2006-10-27 23:47:30 +0100 |
commit | df82928d90e66486d0f1ac390e71405fa6172bbf (patch) | |
tree | 913f24498948e2516c22f3de2d5bcc213b98d751 /xen/include/xen/config.h | |
parent | 9bbcb18fab4edcd8341fd0fecc888b8e886b30e8 (diff) | |
download | xen-df82928d90e66486d0f1ac390e71405fa6172bbf.tar.gz xen-df82928d90e66486d0f1ac390e71405fa6172bbf.tar.bz2 xen-df82928d90e66486d0f1ac390e71405fa6172bbf.zip |
[XEN] Some cleanups to the log-level stuff. Largely this
is a rename and slight interface change to DPRINTK (now
replaced by dprintk() and gdprintk()). Also shuffle some
log-level definitions around and tweak the semantics of
the upper threshold.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/config.h')
-rw-r--r-- | xen/include/xen/config.h | 73 |
1 files changed, 11 insertions, 62 deletions
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index 97c9d824f6..0cb6dadf5c 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -29,7 +29,7 @@ * it to allow for DoS by causing the HV to print out a lot of * info, so where ever the guest has control of what is printed * we use the XENLOG_GUEST to distinguish that the output is - * controled by the Guest. + * controlled by the guest. * * To make it easier on the typing, the above log levels all * have a corresponding _G_ equivalent that appends the @@ -51,65 +51,8 @@ #define XENLOG_MAX 3 /* - * To control the amount of printing, thresholds are added. - * These thresholds correspond to the above log levels. - * There's an upper and lower threshold for non-guests - * and Guest. This works as follows: - * - * If printk log level > upper threshold - * don't print anything - * - * If printk log level >= lower threshold - * rate limit the print (keep the amount down) - * - * Otherwise, just print. - * - * Note, in the above algorithm, to never rate limit - * simply make the lower threshold greater than the upper. - * This way the output will never be rate limited. - * - * For example: - * lower = 2; upper = 1; - * This will always print ERR and WARNING messages - * but will not print anything else. Nothing is - * rate limited. - */ -/* - * Defaults: - * For the HV, always print ERR and WARNING - * but nothing for INFO and DEBUG. - * - * For Guests, always rate limit ERR and WARNING - * but never print for INFO and DEBUG. - */ -#ifndef XENLOG_UPPER_THRESHOLD -#define XENLOG_UPPER_THRESHOLD 1 -#endif -#ifndef XENLOG_LOWER_THRESHOLD -#define XENLOG_LOWER_THRESHOLD 2 -#endif -#ifndef XENLOG_GUEST_UPPER_THRESHOLD -#define XENLOG_GUEST_UPPER_THRESHOLD 1 -#endif -#ifndef XENLOG_GUEST_LOWER_THRESHOLD -#define XENLOG_GUEST_LOWER_THRESHOLD 0 -#endif - -/* - * The XENLOG_DEFAULT is the default given to printks that - * do not have any print level associated to it. - */ -#ifndef XENLOG_DEFAULT -#define XENLOG_DEFAULT 1 /* Warning */ -#endif -#ifndef XENLOG_GUEST_DEFAULT -#define XENLOG_GUEST_DEFAULT 1 /* Warning */ -#endif - -/* * Some code is copied directly from Linux. * Match some of the Linux log levels to Xen. - * (Should these be Guest logs?? - SDR) */ #define KERN_ERR XENLOG_ERR #define KERN_CRIT XENLOG_ERR @@ -123,12 +66,18 @@ #define __iomem #define __user -#define DPRINTK(_f, _a...) printk("(file=%s, line=%d) " _f, \ - __FILE__ , __LINE__ , ## _a ) - #ifndef __ASSEMBLY__ + +int current_domain_id(void); +#define dprintk(_l, _f, _a...) \ + printk(_l "%s:%d: " _f, __FILE__ , __LINE__ , ## _a ) +#define gdprintk(_l, _f, _a...) \ + printk(XENLOG_GUEST _l "%s:%d:d%d " _f, __FILE__, \ + __LINE__, current_domain_id() , ## _a ) + #include <xen/compiler.h> -#endif + +#endif /* !__ASSEMBLY__ */ #define __STR(...) #__VA_ARGS__ #define STR(...) __STR(__VA_ARGS__) |