summaryrefslogtreecommitdiffstats
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index ca65327a6de8..4c3d18d2587e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -68,6 +68,13 @@ int console_printk[4] = {
68}; 68};
69EXPORT_SYMBOL_GPL(console_printk); 69EXPORT_SYMBOL_GPL(console_printk);
70 70
71/*
72 * Divert printk() messages when there is a LITMUS^RT debug listener.
73 */
74#include <litmus/debug_trace.h>
75int trace_override = 0;
76int trace_recurse = 0;
77
71atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0); 78atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
72EXPORT_SYMBOL(ignore_console_lock_warning); 79EXPORT_SYMBOL(ignore_console_lock_warning);
73 80
@@ -1916,6 +1923,11 @@ int vprintk_store(int facility, int level,
1916 */ 1923 */
1917 text_len = vscnprintf(text, sizeof(textbuf), fmt, args); 1924 text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
1918 1925
1926 /* If the LITMUS^RT tracer is active then divert printk messages. */
1927 if (trace_override && !trace_recurse) {
1928 TRACE("%s", text);
1929 }
1930
1919 /* mark and strip a trailing newline */ 1931 /* mark and strip a trailing newline */
1920 if (text_len && text[text_len-1] == '\n') { 1932 if (text_len && text[text_len-1] == '\n') {
1921 text_len--; 1933 text_len--;
@@ -2967,7 +2979,7 @@ static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = {
2967void wake_up_klogd(void) 2979void wake_up_klogd(void)
2968{ 2980{
2969 preempt_disable(); 2981 preempt_disable();
2970 if (waitqueue_active(&log_wait)) { 2982 if (!trace_override && waitqueue_active(&log_wait)) {
2971 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); 2983 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP);
2972 irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); 2984 irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
2973 } 2985 }