aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-01-20 12:25:51 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-02-04 09:24:57 -0500
commit44b2be2bd7b1985345bf855bc74dfc303c7c79cb (patch)
tree0a119fcc8d6b1c1b7447e8547063a7364767da04
parenta9a4887bc8dc24b0cf9665f59dc363c126628b25 (diff)
TRACE_TASK(): accept NULL pointers
Allow tracing of NULL tasks. Makes debugging a bit easier.
-rw-r--r--include/litmus/debug_trace.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h
index 48d086d5a44c..1266ac6a760c 100644
--- a/include/litmus/debug_trace.h
+++ b/include/litmus/debug_trace.h
@@ -28,8 +28,11 @@ extern atomic_t __log_seq_no;
28 TRACE_ARGS, ## args) 28 TRACE_ARGS, ## args)
29 29
30#define TRACE_TASK(t, fmt, args...) \ 30#define TRACE_TASK(t, fmt, args...) \
31 TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ 31 TRACE("(%s/%d:%d) " fmt, \
32 (t)->rt_param.job_params.job_no, ##args) 32 t ? (t)->comm : "null", \
33 t ? (t)->pid : 0, \
34 t ? (t)->rt_param.job_params.job_no : 0, \
35 ##args)
33 36
34#define TRACE_CUR(fmt, args...) \ 37#define TRACE_CUR(fmt, args...) \
35 TRACE_TASK(current, fmt, ## args) 38 TRACE_TASK(current, fmt, ## args)