aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2010-11-22 00:39:45 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-11-22 15:12:06 -0500
commit7779685f05219ff6e713ee6591644c080f51a8bf (patch)
tree9f7a372ba75a282de5bec0878cd2e650a257c1e8
parentd40413efabc0ab388f6ed83f48b28dc253d47238 (diff)
log job number in TRACE_TASK() and TRACE_CUR()
For some problems it can be helpful to know which job of a task generated a log message. This patch changes TRACE_TASK to add :<jobno> to the existing (<comm>/<pid>) tag. The result is a trace such as the following, in which the third job of rtspin/1511 completes and the fourth job is added to the release queue. 137615 P0: (rtspin/1511:3) job_completion(). 137616 P0: (rtspin/1511:4) add_release(), rel=262013223089 137617 P0: (rtspin/1511:4) scheduled_on = NO_CPU The job number for non-real-time tasks is always zero.
-rw-r--r--include/litmus/debug_trace.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h
index b743aa96de79..2e946f147ca7 100644
--- a/include/litmus/debug_trace.h
+++ b/include/litmus/debug_trace.h
@@ -12,12 +12,14 @@ void dump_trace_buffer(int max);
12 12
13extern atomic_t __log_seq_no; 13extern atomic_t __log_seq_no;
14 14
15#define TRACE(fmt, args...) \ 15#define TRACE(fmt, args...) \
16 sched_trace_log_message("%d P%d: " fmt, atomic_add_return(1, &__log_seq_no), \ 16 sched_trace_log_message("%d P%d: " fmt, \
17 atomic_add_return(1, &__log_seq_no), \
17 raw_smp_processor_id(), ## args) 18 raw_smp_processor_id(), ## args)
18 19
19#define TRACE_TASK(t, fmt, args...) \ 20#define TRACE_TASK(t, fmt, args...) \
20 TRACE("(%s/%d) " fmt, (t)->comm, (t)->pid, ##args) 21 TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \
22 (t)->rt_param.job_params.job_no, ##args)
21 23
22#define TRACE_CUR(fmt, args...) \ 24#define TRACE_CUR(fmt, args...) \
23 TRACE_TASK(current, fmt, ## args) 25 TRACE_TASK(current, fmt, ## args)