diff options
Diffstat (limited to 'include/linux/printk.h')
| -rw-r--r-- | include/linux/printk.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index 9afc01e5a0a6..1249a54d17e0 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -98,9 +98,6 @@ int no_printk(const char *fmt, ...) | |||
| 98 | extern asmlinkage __printf(1, 2) | 98 | extern asmlinkage __printf(1, 2) |
| 99 | void early_printk(const char *fmt, ...); | 99 | void early_printk(const char *fmt, ...); |
| 100 | 100 | ||
| 101 | extern int printk_needs_cpu(int cpu); | ||
| 102 | extern void printk_tick(void); | ||
| 103 | |||
| 104 | #ifdef CONFIG_PRINTK | 101 | #ifdef CONFIG_PRINTK |
| 105 | asmlinkage __printf(5, 0) | 102 | asmlinkage __printf(5, 0) |
| 106 | int vprintk_emit(int facility, int level, | 103 | int vprintk_emit(int facility, int level, |
| @@ -255,6 +252,15 @@ extern void dump_stack(void) __cold; | |||
| 255 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 252 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 256 | #define pr_cont_once(fmt, ...) \ | 253 | #define pr_cont_once(fmt, ...) \ |
| 257 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) | 254 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) |
| 255 | |||
| 256 | #if defined(DEBUG) | ||
| 257 | #define pr_devel_once(fmt, ...) \ | ||
| 258 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 259 | #else | ||
| 260 | #define pr_devel_once(fmt, ...) \ | ||
| 261 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 262 | #endif | ||
| 263 | |||
| 258 | /* If you are writing a driver, please use dev_dbg instead */ | 264 | /* If you are writing a driver, please use dev_dbg instead */ |
| 259 | #if defined(DEBUG) | 265 | #if defined(DEBUG) |
| 260 | #define pr_debug_once(fmt, ...) \ | 266 | #define pr_debug_once(fmt, ...) \ |
| @@ -298,6 +304,15 @@ extern void dump_stack(void) __cold; | |||
| 298 | #define pr_info_ratelimited(fmt, ...) \ | 304 | #define pr_info_ratelimited(fmt, ...) \ |
| 299 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 305 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 300 | /* no pr_cont_ratelimited, don't do that... */ | 306 | /* no pr_cont_ratelimited, don't do that... */ |
| 307 | |||
| 308 | #if defined(DEBUG) | ||
| 309 | #define pr_devel_ratelimited(fmt, ...) \ | ||
| 310 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 311 | #else | ||
| 312 | #define pr_devel_ratelimited(fmt, ...) \ | ||
| 313 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 314 | #endif | ||
| 315 | |||
| 301 | /* If you are writing a driver, please use dev_dbg instead */ | 316 | /* If you are writing a driver, please use dev_dbg instead */ |
| 302 | #if defined(DEBUG) | 317 | #if defined(DEBUG) |
| 303 | #define pr_debug_ratelimited(fmt, ...) \ | 318 | #define pr_debug_ratelimited(fmt, ...) \ |
| @@ -321,8 +336,13 @@ extern void hex_dump_to_buffer(const void *buf, size_t len, | |||
| 321 | extern void print_hex_dump(const char *level, const char *prefix_str, | 336 | extern void print_hex_dump(const char *level, const char *prefix_str, |
| 322 | int prefix_type, int rowsize, int groupsize, | 337 | int prefix_type, int rowsize, int groupsize, |
| 323 | const void *buf, size_t len, bool ascii); | 338 | const void *buf, size_t len, bool ascii); |
| 339 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
| 340 | #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \ | ||
| 341 | dynamic_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, true) | ||
| 342 | #else | ||
| 324 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | 343 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
| 325 | const void *buf, size_t len); | 344 | const void *buf, size_t len); |
| 345 | #endif /* defined(CONFIG_DYNAMIC_DEBUG) */ | ||
| 326 | #else | 346 | #else |
| 327 | static inline void print_hex_dump(const char *level, const char *prefix_str, | 347 | static inline void print_hex_dump(const char *level, const char *prefix_str, |
| 328 | int prefix_type, int rowsize, int groupsize, | 348 | int prefix_type, int rowsize, int groupsize, |
| @@ -336,4 +356,16 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
| 336 | 356 | ||
| 337 | #endif | 357 | #endif |
| 338 | 358 | ||
| 359 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
| 360 | #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ | ||
| 361 | groupsize, buf, len, ascii) \ | ||
| 362 | dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ | ||
| 363 | groupsize, buf, len, ascii) | ||
| 364 | #else | ||
| 365 | #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ | ||
| 366 | groupsize, buf, len, ascii) \ | ||
| 367 | print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ | ||
| 368 | groupsize, buf, len, ascii) | ||
| 369 | #endif /* defined(CONFIG_DYNAMIC_DEBUG) */ | ||
| 370 | |||
| 339 | #endif | 371 | #endif |
