aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 24146142bc0..ec7b0bad58a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -74,6 +74,13 @@ int console_printk[4] = {
74}; 74};
75 75
76/* 76/*
77 * divert printk() messages when there is a LITMUS^RT debug listener
78 */
79#include <litmus/litmus.h>
80int trace_override = 0;
81int trace_recurse = 0;
82
83/*
77 * Low level drivers may need that to know if they can schedule in 84 * Low level drivers may need that to know if they can schedule in
78 * their unblank() callback or not. So let's export it. 85 * their unblank() callback or not. So let's export it.
79 */ 86 */
@@ -924,6 +931,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
924 /* Emit the output into the temporary buffer */ 931 /* Emit the output into the temporary buffer */
925 printed_len += vscnprintf(printk_buf + printed_len, 932 printed_len += vscnprintf(printk_buf + printed_len,
926 sizeof(printk_buf) - printed_len, fmt, args); 933 sizeof(printk_buf) - printed_len, fmt, args);
934 /* if LITMUS^RT tracer is active divert printk() msgs */
935 if (trace_override && !trace_recurse)
936 TRACE("%s", printk_buf);
927 937
928#ifdef CONFIG_DEBUG_LL 938#ifdef CONFIG_DEBUG_LL
929 printascii(printk_buf); 939 printascii(printk_buf);
@@ -1004,7 +1014,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
1004 * Try to acquire and then immediately release the 1014 * Try to acquire and then immediately release the
1005 * console semaphore. The release will do all the 1015 * console semaphore. The release will do all the
1006 * actual magic (print out buffers, wake up klogd, 1016 * actual magic (print out buffers, wake up klogd,
1007 * etc). 1017 * etc).
1008 * 1018 *
1009 * The console_trylock_for_printk() function 1019 * The console_trylock_for_printk() function
1010 * will release 'logbuf_lock' regardless of whether it 1020 * will release 'logbuf_lock' regardless of whether it
@@ -1276,7 +1286,7 @@ int printk_needs_cpu(int cpu)
1276 1286
1277void wake_up_klogd(void) 1287void wake_up_klogd(void)
1278{ 1288{
1279 if (waitqueue_active(&log_wait)) 1289 if (!trace_override && waitqueue_active(&log_wait))
1280 this_cpu_write(printk_pending, 1); 1290 this_cpu_write(printk_pending, 1);
1281} 1291}
1282 1292