aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
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 /include/litmus
parent13a30b8fd8fd4a5f41d0bb82718024e5a3823c2e (diff)
Add TRACE() debug tracing support
This patch adds the infrastructure for the TRACE() debug macro. Conflicts: kernel/printk.c
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/debug_trace.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h
new file mode 100644
index 000000000000..1266ac6a760c
--- /dev/null
+++ b/include/litmus/debug_trace.h
@@ -0,0 +1,40 @@
1#ifndef LITMUS_DEBUG_TRACE_H
2#define LITMUS_DEBUG_TRACE_H
3
4#ifdef CONFIG_SCHED_DEBUG_TRACE
5void sched_trace_log_message(const char* fmt, ...);
6void dump_trace_buffer(int max);
7#else
8
9#define sched_trace_log_message(fmt, ...)
10
11#endif
12
13extern atomic_t __log_seq_no;
14
15#ifdef CONFIG_SCHED_DEBUG_TRACE_CALLER
16#define TRACE_PREFIX "%d P%d [%s@%s:%d]: "
17#define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \
18 raw_smp_processor_id(), \
19 __FUNCTION__, __FILE__, __LINE__
20#else
21#define TRACE_PREFIX "%d P%d: "
22#define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \
23 raw_smp_processor_id()
24#endif
25
26#define TRACE(fmt, args...) \
27 sched_trace_log_message(TRACE_PREFIX fmt, \
28 TRACE_ARGS, ## args)
29
30#define TRACE_TASK(t, fmt, args...) \
31 TRACE("(%s/%d:%d) " fmt, \
32 t ? (t)->comm : "null", \
33 t ? (t)->pid : 0, \
34 t ? (t)->rt_param.job_params.job_no : 0, \
35 ##args)
36
37#define TRACE_CUR(fmt, args...) \
38 TRACE_TASK(current, fmt, ## args)
39
40#endif