diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2012-08-30 21:01:47 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2012-08-30 21:01:47 -0400 |
commit | b1e1fea67bca3796d5f9133a92c300ec4fa93a4f (patch) | |
tree | 5cc1336e1fe1d6f93b1067e73e43381dd20db690 /kernel/printk.c | |
parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) |
Bjoern's Dissertation Code with Priority Donationwip-splitting-omlp-jerickso
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 14 |
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> | ||
80 | int trace_override = 0; | ||
81 | int 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 | ||
1068 | void wake_up_klogd(void) | 1078 | void 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 | ||