aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:46 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 06:21:17 -0400
commitfc6ac04ddc314b9cff5bdb92c8330569658076a3 (patch)
treeeda30cc3610074a32d24679c2cf426d31fcd3663 /kernel
parent13a30b8fd8fd4a5f41d0bb82718024e5a3823c2e (diff)
Add TRACE() debug tracing support
This patch adds the infrastructure for the TRACE() debug macro. Conflicts: kernel/printk.c
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/printk.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c099b082cd02..1c7c3dcdc919 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -63,6 +63,13 @@ int console_printk[4] = {
63}; 63};
64 64
65/* 65/*
66 * divert printk() messages when there is a LITMUS^RT debug listener
67 */
68#include <litmus/debug_trace.h>
69int trace_override = 0;
70int trace_recurse = 0;
71
72/*
66 * Low level drivers may need that to know if they can schedule in 73 * Low level drivers may need that to know if they can schedule in
67 * their unblank() callback or not. So let's export it. 74 * their unblank() callback or not. So let's export it.
68 */ 75 */
@@ -1678,6 +1685,10 @@ asmlinkage int vprintk_emit(int facility, int level,
1678 */ 1685 */
1679 text_len = vscnprintf(text, sizeof(textbuf), fmt, args); 1686 text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
1680 1687
1688 /* if LITMUS^RT tracer is active divert printk() msgs */
1689 if (trace_override && !trace_recurse)
1690 TRACE("%s", text);
1691
1681 /* mark and strip a trailing newline */ 1692 /* mark and strip a trailing newline */
1682 if (text_len && text[text_len-1] == '\n') { 1693 if (text_len && text[text_len-1] == '\n') {
1683 text_len--; 1694 text_len--;
@@ -2628,7 +2639,7 @@ static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = {
2628void wake_up_klogd(void) 2639void wake_up_klogd(void)
2629{ 2640{
2630 preempt_disable(); 2641 preempt_disable();
2631 if (waitqueue_active(&log_wait)) { 2642 if (!trace_override && waitqueue_active(&log_wait)) {
2632 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); 2643 this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP);
2633 irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); 2644 irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
2634 } 2645 }