diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-22 01:25:19 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-22 15:12:40 -0500 |
commit | 2aad06b056054442964f46752bdb098030cdb866 (patch) | |
tree | 2cea1a29913cfcfa026ab351e7be0e072d3ffd4f /include/litmus | |
parent | 7779685f05219ff6e713ee6591644c080f51a8bf (diff) |
add optional [function@file:line] tag to TRACE() log
Add information to each trace message that makes it easier to locate
where it came from. It is disabled by default since this adds a lot of
clutter. Example:
81281 P1 [gsnedf_schedule@litmus/sched_gsn_edf.c:406]: (rtspin/1483:1) blocks:0 out_of_time:0 np:0 sleep:1 preempt:0 state:0 sig:0
81282 P1 [job_completion@litmus/sched_gsn_edf.c:303]: (rtspin/1483:1) job_completion().
81283 P1 [__add_release@litmus/rt_domain.c:344]: (rtspin/1483:2) add_release(), rel=41941764351
81284 P1 [gsnedf_schedule@litmus/sched_gsn_edf.c:453]: (rtspin/1483:2) scheduled_on = NO_CPU
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/debug_trace.h | 16 |
1 files changed, 13 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 | ||
13 | extern atomic_t __log_seq_no; | 13 | extern 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, \ |