diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-11 18:28:09 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-11 18:28:09 -0400 |
commit | 1b0b2b02697583bbe3aa6060e3f28d0a75c66ab6 (patch) | |
tree | 381eef92a9331e10ecff9d6c97a33719f2309221 /kernel | |
parent | d6c62a40cd5378f816a81ef62b34357614c5d21e (diff) |
TRACE(): facilitate debugging
- don't deadlock on a runqueue lock in case of a bug inside
the scheduler
- write printk() messages to TRACE()
- tell user of TRACE() buffer
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 89011bf8c1..9eb2dc5e27 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -54,6 +54,12 @@ int console_printk[4] = { | |||
54 | DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ | 54 | DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ |
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* divert printk() messages when we have a LITMUS^RT | ||
58 | * debug listener | ||
59 | */ | ||
60 | #include <litmus/litmus.h> | ||
61 | int trace_override = 0; | ||
62 | |||
57 | /* | 63 | /* |
58 | * Low level drivers may need that to know if they can schedule in | 64 | * Low level drivers may need that to know if they can schedule in |
59 | * their unblank() callback or not. So let's export it. | 65 | * their unblank() callback or not. So let's export it. |
@@ -652,6 +658,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
652 | 658 | ||
653 | /* Emit the output into the temporary buffer */ | 659 | /* Emit the output into the temporary buffer */ |
654 | printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args); | 660 | printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args); |
661 | if (trace_override) | ||
662 | TRACE("%s", printk_buf); | ||
655 | 663 | ||
656 | /* | 664 | /* |
657 | * Copy the output into log_buf. If the caller didn't provide | 665 | * Copy the output into log_buf. If the caller didn't provide |
@@ -932,7 +940,7 @@ int is_console_locked(void) | |||
932 | 940 | ||
933 | void wake_up_klogd(void) | 941 | void wake_up_klogd(void) |
934 | { | 942 | { |
935 | if (!oops_in_progress && waitqueue_active(&log_wait)) | 943 | if (!trace_override && !oops_in_progress && waitqueue_active(&log_wait)) |
936 | wake_up_interruptible(&log_wait); | 944 | wake_up_interruptible(&log_wait); |
937 | } | 945 | } |
938 | 946 | ||