diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-06 11:45:42 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-06 11:45:42 -0500 |
commit | 546e5354a6e4ec760ac03ef1148e9a4762abb5f5 (patch) | |
tree | ed9a867384f400f1270786e2cafa0d107ace6b75 /include/linux/kernel.h | |
parent | af438c0f114b6f731b923b5c07150f6159471502 (diff) | |
parent | fef20d9c1380f04ba9492d6463148db07b413708 (diff) |
Merge branch 'core/printk' into tracing/ftrace
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4614a8a034b..7aef15c4645e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -242,6 +242,19 @@ extern struct ratelimit_state printk_ratelimit_state; | |||
242 | extern int printk_ratelimit(void); | 242 | extern int printk_ratelimit(void); |
243 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 243 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
244 | unsigned int interval_msec); | 244 | unsigned int interval_msec); |
245 | |||
246 | /* | ||
247 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
248 | */ | ||
249 | #define printk_once(x...) ({ \ | ||
250 | static int __print_once = 1; \ | ||
251 | \ | ||
252 | if (__print_once) { \ | ||
253 | __print_once = 0; \ | ||
254 | printk(x); \ | ||
255 | } \ | ||
256 | }) | ||
257 | |||
245 | #else | 258 | #else |
246 | static inline int vprintk(const char *s, va_list args) | 259 | static inline int vprintk(const char *s, va_list args) |
247 | __attribute__ ((format (printf, 1, 0))); | 260 | __attribute__ ((format (printf, 1, 0))); |
@@ -253,6 +266,10 @@ static inline int printk_ratelimit(void) { return 0; } | |||
253 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | 266 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ |
254 | unsigned int interval_msec) \ | 267 | unsigned int interval_msec) \ |
255 | { return false; } | 268 | { return false; } |
269 | |||
270 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
271 | #define printk_once(x...) printk(x) | ||
272 | |||
256 | #endif | 273 | #endif |
257 | 274 | ||
258 | extern int printk_needs_cpu(int cpu); | 275 | extern int printk_needs_cpu(int cpu); |