aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2009-12-17 21:26:50 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-29 17:12:27 -0400
commit96979188007a0671d3f067d7edf144742d7433ee (patch)
tree8b93dacea74499926cc4fcaa0879dbfe3ace9d7f /kernel/printk.c
parentcf3f4bd8db320f3f487d66bdec924e926f004787 (diff)
[ported from 2008.3] Add tracing support and hook up Litmus KConfig for x86
- fix requesting more than 2^11 pages (MAX_ORDER) to system allocator Still to be merged: - feather-trace generic implementation
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 f38b07f78a4e..6712a252b306 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -70,6 +70,13 @@ int console_printk[4] = {
70static int saved_console_loglevel = -1; 70static int saved_console_loglevel = -1;
71 71
72/* 72/*
73 * divert printk() messages when there is a LITMUS^RT debug listener
74 */
75#include <litmus/litmus.h>
76int trace_override = 0;
77int trace_recurse = 0;
78
79/*
73 * Low level drivers may need that to know if they can schedule in 80 * Low level drivers may need that to know if they can schedule in
74 * their unblank() callback or not. So let's export it. 81 * their unblank() callback or not. So let's export it.
75 */ 82 */
@@ -713,6 +720,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
713 /* Emit the output into the temporary buffer */ 720 /* Emit the output into the temporary buffer */
714 printed_len += vscnprintf(printk_buf + printed_len, 721 printed_len += vscnprintf(printk_buf + printed_len,
715 sizeof(printk_buf) - printed_len, fmt, args); 722 sizeof(printk_buf) - printed_len, fmt, args);
723 /* if LITMUS^RT tracer is active divert printk() msgs */
724 if (trace_override && !trace_recurse)
725 TRACE("%s", printk_buf);
716 726
717 727
718 p = printk_buf; 728 p = printk_buf;
@@ -782,7 +792,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
782 * Try to acquire and then immediately release the 792 * Try to acquire and then immediately release the
783 * console semaphore. The release will do all the 793 * console semaphore. The release will do all the
784 * actual magic (print out buffers, wake up klogd, 794 * actual magic (print out buffers, wake up klogd,
785 * etc). 795 * etc).
786 * 796 *
787 * The acquire_console_semaphore_for_printk() function 797 * The acquire_console_semaphore_for_printk() function
788 * will release 'logbuf_lock' regardless of whether it 798 * will release 'logbuf_lock' regardless of whether it
@@ -1019,7 +1029,7 @@ int printk_needs_cpu(int cpu)
1019 1029
1020void wake_up_klogd(void) 1030void wake_up_klogd(void)
1021{ 1031{
1022 if (waitqueue_active(&log_wait)) 1032 if (!trace_override && waitqueue_active(&log_wait))
1023 __raw_get_cpu_var(printk_pending) = 1; 1033 __raw_get_cpu_var(printk_pending) = 1;
1024} 1034}
1025 1035