aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/litmus/debug_trace.h16
-rw-r--r--litmus/Kconfig15
2 files changed, 28 insertions, 3 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h
index 2e946f147ca7..48d086d5a44c 100644
--- a/include/litmus/debug_trace.h
+++ b/include/litmus/debug_trace.h
@@ -12,10 +12,20 @@ void dump_trace_buffer(int max);
12 12
13extern atomic_t __log_seq_no; 13extern atomic_t __log_seq_no;
14 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
15#define TRACE(fmt, args...) \ 26#define TRACE(fmt, args...) \
16 sched_trace_log_message("%d P%d: " fmt, \ 27 sched_trace_log_message(TRACE_PREFIX fmt, \
17 atomic_add_return(1, &__log_seq_no), \ 28 TRACE_ARGS, ## args)
18 raw_smp_processor_id(), ## args)
19 29
20#define TRACE_TASK(t, fmt, args...) \ 30#define TRACE_TASK(t, fmt, args...) \
21 TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ 31 TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \
diff --git a/litmus/Kconfig b/litmus/Kconfig
index d62c417f261e..a2f267870f29 100644
--- a/litmus/Kconfig
+++ b/litmus/Kconfig
@@ -174,6 +174,21 @@ config SCHED_DEBUG_TRACE_SHIFT
174 character device node should be created at /dev/litmus/log. The buffer 174 character device node should be created at /dev/litmus/log. The buffer
175 can be flushed using cat, e.g., 'cat /dev/litmus/log > my_log_file.txt'. 175 can be flushed using cat, e.g., 'cat /dev/litmus/log > my_log_file.txt'.
176 176
177config SCHED_DEBUG_TRACE_CALLER
178 bool "Include [function@file:line] tag in TRACE() log"
179 depends on SCHED_DEBUG_TRACE
180 default n
181 help
182 With this option enabled, TRACE() prepends
183
184 "[<function name>@<filename>:<line number>]"
185
186 to each message in the debug log. Enable this to aid in figuring out
187 what was called in which order. The downside is that it adds a lot of
188 clutter.
189
190 If unsure, say No.
191
177endmenu 192endmenu
178 193
179endmenu 194endmenu