From 44b2be2bd7b1985345bf855bc74dfc303c7c79cb Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 20 Jan 2013 18:25:51 +0100 Subject: TRACE_TASK(): accept NULL pointers Allow tracing of NULL tasks. Makes debugging a bit easier. --- include/litmus/debug_trace.h | 7 +++++-- 1 file 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; TRACE_ARGS, ## args) #define TRACE_TASK(t, fmt, args...) \ - TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ - (t)->rt_param.job_params.job_no, ##args) + TRACE("(%s/%d:%d) " fmt, \ + t ? (t)->comm : "null", \ + t ? (t)->pid : 0, \ + t ? (t)->rt_param.job_params.job_no : 0, \ + ##args) #define TRACE_CUR(fmt, args...) \ TRACE_TASK(current, fmt, ## args) -- cgit v1.2.2