diff options
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 75077ad0b537..ee54355cfdf1 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -71,6 +71,13 @@ int console_printk[4] = { | |||
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | /* | 73 | /* |
| 74 | * divert printk() messages when there is a LITMUS^RT debug listener | ||
| 75 | */ | ||
| 76 | #include <litmus/litmus.h> | ||
| 77 | int trace_override = 0; | ||
| 78 | int trace_recurse = 0; | ||
| 79 | |||
| 80 | /* | ||
| 74 | * Low level drivers may need that to know if they can schedule in | 81 | * Low level drivers may need that to know if they can schedule in |
| 75 | * their unblank() callback or not. So let's export it. | 82 | * their unblank() callback or not. So let's export it. |
| 76 | */ | 83 | */ |
| @@ -708,6 +715,9 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 708 | /* Emit the output into the temporary buffer */ | 715 | /* Emit the output into the temporary buffer */ |
| 709 | printed_len += vscnprintf(printk_buf + printed_len, | 716 | printed_len += vscnprintf(printk_buf + printed_len, |
| 710 | sizeof(printk_buf) - printed_len, fmt, args); | 717 | sizeof(printk_buf) - printed_len, fmt, args); |
| 718 | /* if LITMUS^RT tracer is active divert printk() msgs */ | ||
| 719 | if (trace_override && !trace_recurse) | ||
| 720 | TRACE("%s", printk_buf); | ||
| 711 | 721 | ||
| 712 | 722 | ||
| 713 | p = printk_buf; | 723 | p = printk_buf; |
| @@ -777,7 +787,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 777 | * Try to acquire and then immediately release the | 787 | * Try to acquire and then immediately release the |
| 778 | * console semaphore. The release will do all the | 788 | * console semaphore. The release will do all the |
| 779 | * actual magic (print out buffers, wake up klogd, | 789 | * actual magic (print out buffers, wake up klogd, |
| 780 | * etc). | 790 | * etc). |
| 781 | * | 791 | * |
| 782 | * The acquire_console_semaphore_for_printk() function | 792 | * The acquire_console_semaphore_for_printk() function |
| 783 | * will release 'logbuf_lock' regardless of whether it | 793 | * will release 'logbuf_lock' regardless of whether it |
| @@ -1014,7 +1024,7 @@ int printk_needs_cpu(int cpu) | |||
| 1014 | 1024 | ||
| 1015 | void wake_up_klogd(void) | 1025 | void wake_up_klogd(void) |
| 1016 | { | 1026 | { |
| 1017 | if (waitqueue_active(&log_wait)) | 1027 | if (!trace_override && waitqueue_active(&log_wait)) |
| 1018 | __raw_get_cpu_var(printk_pending) = 1; | 1028 | __raw_get_cpu_var(printk_pending) = 1; |
| 1019 | } | 1029 | } |
| 1020 | 1030 | ||
