aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJeremy Erickson <jerickso@cs.unc.edu>2012-08-30 21:01:47 -0400
committerJeremy Erickson <jerickso@cs.unc.edu>2012-08-30 21:01:47 -0400
commitb1e1fea67bca3796d5f9133a92c300ec4fa93a4f (patch)
tree5cc1336e1fe1d6f93b1067e73e43381dd20db690 /kernel/printk.c
parentf6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff)
Bjoern's Dissertation Code with Priority Donationwip-splitting-omlp-jerickso
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 8fe465ac008a..9dc8ea140426 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 */
@@ -735,6 +742,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
735 /* Emit the output into the temporary buffer */ 742 /* Emit the output into the temporary buffer */
736 printed_len += vscnprintf(printk_buf + printed_len, 743 printed_len += vscnprintf(printk_buf + printed_len,
737 sizeof(printk_buf) - printed_len, fmt, args); 744 sizeof(printk_buf) - printed_len, fmt, args);
745 /* if LITMUS^RT tracer is active divert printk() msgs */
746 if (trace_override && !trace_recurse)
747 TRACE("%s", printk_buf);
738 748
739 749
740 p = printk_buf; 750 p = printk_buf;
@@ -804,7 +814,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
804 * Try to acquire and then immediately release the 814 * Try to acquire and then immediately release the
805 * console semaphore. The release will do all the 815 * console semaphore. The release will do all the
806 * actual magic (print out buffers, wake up klogd, 816 * actual magic (print out buffers, wake up klogd,
807 * etc). 817 * etc).
808 * 818 *
809 * The acquire_console_semaphore_for_printk() function 819 * The acquire_console_semaphore_for_printk() function
810 * will release 'logbuf_lock' regardless of whether it 820 * will release 'logbuf_lock' regardless of whether it
@@ -1067,7 +1077,7 @@ int printk_needs_cpu(int cpu)
1067 1077
1068void wake_up_klogd(void) 1078void wake_up_klogd(void)
1069{ 1079{
1070 if (waitqueue_active(&log_wait)) 1080 if (!trace_override && waitqueue_active(&log_wait))
1071 __raw_get_cpu_var(printk_pending) = 1; 1081 __raw_get_cpu_var(printk_pending) = 1;
1072} 1082}
1073 1083