diff options
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r-- | kernel/printk/printk.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 9c5b231684d0..41f840cea1a4 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
@@ -64,6 +64,13 @@ int console_printk[4] = { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * divert printk() messages when there is a LITMUS^RT debug listener | ||
68 | */ | ||
69 | #include <litmus/debug_trace.h> | ||
70 | int trace_override = 0; | ||
71 | int trace_recurse = 0; | ||
72 | |||
73 | /* | ||
67 | * Low level drivers may need that to know if they can schedule in | 74 | * Low level drivers may need that to know if they can schedule in |
68 | * their unblank() callback or not. So let's export it. | 75 | * their unblank() callback or not. So let's export it. |
69 | */ | 76 | */ |
@@ -1842,6 +1849,10 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1842 | */ | 1849 | */ |
1843 | text_len = vscnprintf(text, sizeof(textbuf), fmt, args); | 1850 | text_len = vscnprintf(text, sizeof(textbuf), fmt, args); |
1844 | 1851 | ||
1852 | /* if LITMUS^RT tracer is active divert printk() msgs */ | ||
1853 | if (trace_override && !trace_recurse) | ||
1854 | TRACE("%s", text); | ||
1855 | |||
1845 | /* mark and strip a trailing newline */ | 1856 | /* mark and strip a trailing newline */ |
1846 | if (text_len && text[text_len-1] == '\n') { | 1857 | if (text_len && text[text_len-1] == '\n') { |
1847 | text_len--; | 1858 | text_len--; |
@@ -2874,7 +2885,7 @@ static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = { | |||
2874 | void wake_up_klogd(void) | 2885 | void wake_up_klogd(void) |
2875 | { | 2886 | { |
2876 | preempt_disable(); | 2887 | preempt_disable(); |
2877 | if (waitqueue_active(&log_wait)) { | 2888 | if (!trace_override && waitqueue_active(&log_wait)) { |
2878 | this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); | 2889 | this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); |
2879 | irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); | 2890 | irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); |
2880 | } | 2891 | } |