@@ -64,6 +64,7 @@ int panic_on_warn __read_mostly;
64
64
unsigned long panic_on_taint ;
65
65
bool panic_on_taint_nousertaint = false;
66
66
static unsigned int warn_limit __read_mostly ;
67
+ static bool panic_console_replay ;
67
68
68
69
bool panic_triggering_all_cpu_backtrace ;
69
70
@@ -77,6 +78,13 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
77
78
EXPORT_SYMBOL (panic_notifier_list );
78
79
79
80
#ifdef CONFIG_SYSCTL
81
+ static int sysctl_panic_print_handler (const struct ctl_table * table , int write ,
82
+ void * buffer , size_t * lenp , loff_t * ppos )
83
+ {
84
+ pr_info_once ("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n" );
85
+ return proc_doulongvec_minmax (table , write , buffer , lenp , ppos );
86
+ }
87
+
80
88
static const struct ctl_table kern_panic_table [] = {
81
89
#ifdef CONFIG_SMP
82
90
{
@@ -108,7 +116,7 @@ static const struct ctl_table kern_panic_table[] = {
108
116
.data = & panic_print ,
109
117
.maxlen = sizeof (unsigned long ),
110
118
.mode = 0644 ,
111
- .proc_handler = proc_doulongvec_minmax ,
119
+ .proc_handler = sysctl_panic_print_handler ,
112
120
},
113
121
{
114
122
.procname = "panic_on_warn" ,
@@ -247,12 +255,6 @@ void nmi_panic(struct pt_regs *regs, const char *msg)
247
255
}
248
256
EXPORT_SYMBOL (nmi_panic );
249
257
250
- static void panic_console_replay (void )
251
- {
252
- if (panic_print & SYS_INFO_PANIC_CONSOLE_REPLAY )
253
- console_flush_on_panic (CONSOLE_REPLAY_ALL );
254
- }
255
-
256
258
void check_panic_on_warn (const char * origin )
257
259
{
258
260
unsigned int limit ;
@@ -427,7 +429,9 @@ void panic(const char *fmt, ...)
427
429
debug_locks_off ();
428
430
console_flush_on_panic (CONSOLE_FLUSH_PENDING );
429
431
430
- panic_console_replay ();
432
+ if ((panic_print & SYS_INFO_PANIC_CONSOLE_REPLAY ) ||
433
+ panic_console_replay )
434
+ console_flush_on_panic (CONSOLE_REPLAY_ALL );
431
435
432
436
if (!panic_blink )
433
437
panic_blink = no_blink ;
@@ -869,6 +873,7 @@ core_param(panic_print, panic_print, ulong, 0644);
869
873
core_param (pause_on_oops , pause_on_oops , int , 0644 );
870
874
core_param (panic_on_warn , panic_on_warn , int , 0644 );
871
875
core_param (crash_kexec_post_notifiers , crash_kexec_post_notifiers , bool , 0644 );
876
+ core_param (panic_console_replay , panic_console_replay , bool , 0644 );
872
877
873
878
static int __init oops_setup (char * s )
874
879
{
0 commit comments