aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 70b4b94a0eca..73a96def4804 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -2851,6 +2851,28 @@ void kmsg_dump_rewind(struct kmsg_dumper *dumper)
2851} 2851}
2852EXPORT_SYMBOL_GPL(kmsg_dump_rewind); 2852EXPORT_SYMBOL_GPL(kmsg_dump_rewind);
2853 2853
2854static char dump_stack_arch_desc_str[128];
2855
2856/**
2857 * dump_stack_set_arch_desc - set arch-specific str to show with task dumps
2858 * @fmt: printf-style format string
2859 * @...: arguments for the format string
2860 *
2861 * The configured string will be printed right after utsname during task
2862 * dumps. Usually used to add arch-specific system identifiers. If an
2863 * arch wants to make use of such an ID string, it should initialize this
2864 * as soon as possible during boot.
2865 */
2866void __init dump_stack_set_arch_desc(const char *fmt, ...)
2867{
2868 va_list args;
2869
2870 va_start(args, fmt);
2871 vsnprintf(dump_stack_arch_desc_str, sizeof(dump_stack_arch_desc_str),
2872 fmt, args);
2873 va_end(args);
2874}
2875
2854/** 2876/**
2855 * dump_stack_print_info - print generic debug info for dump_stack() 2877 * dump_stack_print_info - print generic debug info for dump_stack()
2856 * @log_lvl: log level 2878 * @log_lvl: log level
@@ -2865,6 +2887,10 @@ void dump_stack_print_info(const char *log_lvl)
2865 print_tainted(), init_utsname()->release, 2887 print_tainted(), init_utsname()->release,
2866 (int)strcspn(init_utsname()->version, " "), 2888 (int)strcspn(init_utsname()->version, " "),
2867 init_utsname()->version); 2889 init_utsname()->version);
2890
2891 if (dump_stack_arch_desc_str[0] != '\0')
2892 printk("%sHardware name: %s\n",
2893 log_lvl, dump_stack_arch_desc_str);
2868} 2894}
2869 2895
2870#endif 2896#endif