aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-06-23 10:29:07 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-08-07 03:46:42 -0400
commit49fa66f74b78c9b08d2ba038db409b5bbde11fab (patch)
treec77f254cb3143baae03f4d6b8c67e7c47b4ba64a /kernel
parent05ad941dfa83599208ee11b67c49ad54c4f3b78a (diff)
Add TRACE() debug tracing support
This patch adds the infrastructure for the TRACE() debug macro.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index d37d45c90ae6..5616e59096a5 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -66,6 +66,13 @@ int console_printk[4] = {
66}; 66};
67 67
68/* 68/*
69 * divert printk() messages when there is a LITMUS^RT debug listener
70 */
71#include <litmus/debug_trace.h>
72int trace_override = 0;
73int trace_recurse = 0;
74
75/*
69 * Low level drivers may need that to know if they can schedule in 76 * Low level drivers may need that to know if they can schedule in
70 * their unblank() callback or not. So let's export it. 77 * their unblank() callback or not. So let's export it.
71 */ 78 */
@@ -1552,6 +1559,10 @@ asmlinkage int vprintk_emit(int facility, int level,
1552 */ 1559 */
1553 text_len = vscnprintf(text, sizeof(textbuf), fmt, args); 1560 text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
1554 1561
1562 /* if LITMUS^RT tracer is active divert printk() msgs */
1563 if (trace_override && !trace_recurse)
1564 TRACE("%s", text);
1565
1555 /* mark and strip a trailing newline */ 1566 /* mark and strip a trailing newline */
1556 if (text_len && text[text_len-1] == '\n') { 1567 if (text_len && text[text_len-1] == '\n') {
1557 text_len--; 1568 text_len--;
@@ -2478,7 +2489,7 @@ static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = {
2478void wake_up_klogd(void) 2489void wake_up_klogd(void)
2479{ 2490{
2480 preempt_disable(); 2491 preempt_disable();
2481 if (waitqueue_active(&log_wait)) { 2492 if (!trace_override && waitqueue_active(&log_wait)) {
2482 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); 2493 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP);
2483 irq_work_queue(&__get_cpu_var(wake_up_klogd_work)); 2494 irq_work_queue(&__get_cpu_var(wake_up_klogd_work));
2484 } 2495 }