From 7779685f05219ff6e713ee6591644c080f51a8bf Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Mon, 22 Nov 2010 00:39:45 -0500 Subject: 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 : to the existing (/) 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. --- include/litmus/debug_trace.h | 10 ++++++---- 1 file 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); extern atomic_t __log_seq_no; -#define TRACE(fmt, args...) \ - sched_trace_log_message("%d P%d: " fmt, atomic_add_return(1, &__log_seq_no), \ +#define TRACE(fmt, args...) \ + sched_trace_log_message("%d P%d: " fmt, \ + atomic_add_return(1, &__log_seq_no), \ raw_smp_processor_id(), ## args) -#define TRACE_TASK(t, fmt, args...) \ - TRACE("(%s/%d) " fmt, (t)->comm, (t)->pid, ##args) +#define TRACE_TASK(t, fmt, args...) \ + TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ + (t)->rt_param.job_params.job_no, ##args) #define TRACE_CUR(fmt, args...) \ TRACE_TASK(current, fmt, ## args) -- cgit v1.2.2