diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2010-12-01 16:07:47 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2010-12-01 16:07:47 -0500 |
commit | 7c4bf1537a81a84954dc34caeaf3b874800f7c18 (patch) | |
tree | e8d1bf719eccb3a3c82feeb919207b164ebaa2a9 /include/litmus | |
parent | 1b9caf2f95c97e27c91372bd41f79d3e96a99e62 (diff) | |
parent | f07bb0a4549916107a7619d0bc4cb5dc09d5744a (diff) |
Merge branch 'wip-merge-2.6.36' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010 into wip-merge-2.6.36
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/debug_trace.h | 22 | ||||
-rw-r--r-- | include/litmus/litmus.h | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h index b743aa96de79..48d086d5a44c 100644 --- a/include/litmus/debug_trace.h +++ b/include/litmus/debug_trace.h | |||
@@ -12,12 +12,24 @@ 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 | #define TRACE(fmt, args...) \ | 15 | #ifdef CONFIG_SCHED_DEBUG_TRACE_CALLER |
16 | sched_trace_log_message("%d P%d: " fmt, atomic_add_return(1, &__log_seq_no), \ | 16 | #define TRACE_PREFIX "%d P%d [%s@%s:%d]: " |
17 | raw_smp_processor_id(), ## args) | 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 | |||
26 | #define TRACE(fmt, args...) \ | ||
27 | sched_trace_log_message(TRACE_PREFIX fmt, \ | ||
28 | TRACE_ARGS, ## args) | ||
18 | 29 | ||
19 | #define TRACE_TASK(t, fmt, args...) \ | 30 | #define TRACE_TASK(t, fmt, args...) \ |
20 | TRACE("(%s/%d) " fmt, (t)->comm, (t)->pid, ##args) | 31 | TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ |
32 | (t)->rt_param.job_params.job_no, ##args) | ||
21 | 33 | ||
22 | #define TRACE_CUR(fmt, args...) \ | 34 | #define TRACE_CUR(fmt, args...) \ |
23 | TRACE_TASK(current, fmt, ## args) | 35 | TRACE_TASK(current, fmt, ## args) |
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 30f41869b455..246483783fc0 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -62,7 +62,7 @@ inline static int budget_exhausted(struct task_struct* t) | |||
62 | inline static lt_t budget_remaining(struct task_struct* t) | 62 | inline static lt_t budget_remaining(struct task_struct* t) |
63 | { | 63 | { |
64 | if (!budget_exhausted(t)) | 64 | if (!budget_exhausted(t)) |
65 | return get_exec_time(t) - get_exec_cost(t); | 65 | return get_exec_cost(t) - get_exec_time(t); |
66 | else | 66 | else |
67 | /* avoid overflow */ | 67 | /* avoid overflow */ |
68 | return 0; | 68 | return 0; |