diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 22:53:30 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 22:53:30 -0400 |
| commit | 357aa6aefebe888c712152cb83c9e700f98eebd1 (patch) | |
| tree | 5adac02fbfd232e8df56563c3ab2facde669ba9c /kernel | |
| parent | be88751f320a716a4327596adfe834e162c14532 (diff) | |
| parent | 47319f7186b8746521b0ee674054b29d7b35578b (diff) | |
Merge branch 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk
Pull printk updates from Petr Mladek:
- Add info about loaded kdump kernel into the dump stack header
- Move dump-stack related code from printk.c to lib/dump_stack.c
- Write message about suspending consoles in KERN_INFO log level
* 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
printk: change message to pr_info
printk: move dump stack related code to lib/dump_stack.c
print kdump kernel loaded status in stack dump
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/printk/printk.c | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index f274fbef821d..704e55129c3a 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <linux/rculist.h> | 42 | #include <linux/rculist.h> |
| 43 | #include <linux/poll.h> | 43 | #include <linux/poll.h> |
| 44 | #include <linux/irq_work.h> | 44 | #include <linux/irq_work.h> |
| 45 | #include <linux/utsname.h> | ||
| 46 | #include <linux/ctype.h> | 45 | #include <linux/ctype.h> |
| 47 | #include <linux/uio.h> | 46 | #include <linux/uio.h> |
| 48 | #include <linux/sched/clock.h> | 47 | #include <linux/sched/clock.h> |
| @@ -2162,7 +2161,7 @@ void suspend_console(void) | |||
| 2162 | { | 2161 | { |
| 2163 | if (!console_suspend_enabled) | 2162 | if (!console_suspend_enabled) |
| 2164 | return; | 2163 | return; |
| 2165 | printk("Suspending console(s) (use no_console_suspend to debug)\n"); | 2164 | pr_info("Suspending console(s) (use no_console_suspend to debug)\n"); |
| 2166 | console_lock(); | 2165 | console_lock(); |
| 2167 | console_suspended = 1; | 2166 | console_suspended = 1; |
| 2168 | up_console_sem(); | 2167 | up_console_sem(); |
| @@ -3257,60 +3256,4 @@ void kmsg_dump_rewind(struct kmsg_dumper *dumper) | |||
| 3257 | } | 3256 | } |
| 3258 | EXPORT_SYMBOL_GPL(kmsg_dump_rewind); | 3257 | EXPORT_SYMBOL_GPL(kmsg_dump_rewind); |
| 3259 | 3258 | ||
| 3260 | static char dump_stack_arch_desc_str[128]; | ||
| 3261 | |||
| 3262 | /** | ||
| 3263 | * dump_stack_set_arch_desc - set arch-specific str to show with task dumps | ||
| 3264 | * @fmt: printf-style format string | ||
| 3265 | * @...: arguments for the format string | ||
| 3266 | * | ||
| 3267 | * The configured string will be printed right after utsname during task | ||
| 3268 | * dumps. Usually used to add arch-specific system identifiers. If an | ||
| 3269 | * arch wants to make use of such an ID string, it should initialize this | ||
| 3270 | * as soon as possible during boot. | ||
| 3271 | */ | ||
| 3272 | void __init dump_stack_set_arch_desc(const char *fmt, ...) | ||
| 3273 | { | ||
| 3274 | va_list args; | ||
| 3275 | |||
| 3276 | va_start(args, fmt); | ||
| 3277 | vsnprintf(dump_stack_arch_desc_str, sizeof(dump_stack_arch_desc_str), | ||
| 3278 | fmt, args); | ||
| 3279 | va_end(args); | ||
| 3280 | } | ||
| 3281 | |||
| 3282 | /** | ||
| 3283 | * dump_stack_print_info - print generic debug info for dump_stack() | ||
| 3284 | * @log_lvl: log level | ||
| 3285 | * | ||
| 3286 | * Arch-specific dump_stack() implementations can use this function to | ||
| 3287 | * print out the same debug information as the generic dump_stack(). | ||
| 3288 | */ | ||
| 3289 | void dump_stack_print_info(const char *log_lvl) | ||
| 3290 | { | ||
| 3291 | printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s\n", | ||
| 3292 | log_lvl, raw_smp_processor_id(), current->pid, current->comm, | ||
| 3293 | print_tainted(), init_utsname()->release, | ||
| 3294 | (int)strcspn(init_utsname()->version, " "), | ||
| 3295 | init_utsname()->version); | ||
| 3296 | |||
| 3297 | if (dump_stack_arch_desc_str[0] != '\0') | ||
| 3298 | printk("%sHardware name: %s\n", | ||
| 3299 | log_lvl, dump_stack_arch_desc_str); | ||
| 3300 | |||
| 3301 | print_worker_info(log_lvl, current); | ||
| 3302 | } | ||
| 3303 | |||
| 3304 | /** | ||
| 3305 | * show_regs_print_info - print generic debug info for show_regs() | ||
| 3306 | * @log_lvl: log level | ||
| 3307 | * | ||
| 3308 | * show_regs() implementations can use this function to print out generic | ||
| 3309 | * debug information. | ||
| 3310 | */ | ||
| 3311 | void show_regs_print_info(const char *log_lvl) | ||
| 3312 | { | ||
| 3313 | dump_stack_print_info(log_lvl); | ||
| 3314 | } | ||
| 3315 | |||
| 3316 | #endif | 3259 | #endif |
