diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2012-09-29 19:41:49 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2012-09-29 19:41:49 -0400 |
commit | efbaa9ecdcc2a82d621bdd6b04319a982653c95c (patch) | |
tree | aa73be91a93efb9ac7c0afdb793831827fc32268 | |
parent | 6dde5b36ab5da446976d529d2038a2451a77e347 (diff) |
Fix division in Jonathan's tracing.
-rw-r--r-- | litmus/sched_task_trace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index 7194d2fe6c6..972b4be6dec 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/percpu.h> | 9 | #include <linux/percpu.h> |
10 | #include <linux/math64.h> | ||
10 | 11 | ||
11 | #include <litmus/ftdev.h> | 12 | #include <litmus/ftdev.h> |
12 | #include <litmus/litmus.h> | 13 | #include <litmus/litmus.h> |
@@ -231,7 +232,8 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
231 | { | 232 | { |
232 | struct task_struct *t = (struct task_struct*) _task; | 233 | struct task_struct *t = (struct task_struct*) _task; |
233 | const lt_t max_exec_time = tsk_rt(t)->max_exec_time; | 234 | const lt_t max_exec_time = tsk_rt(t)->max_exec_time; |
234 | const lt_t avg_exec_time = tsk_rt(t)->tot_exec_time / (get_job_no(t) - 1); | 235 | const lt_t avg_exec_time = div64_u64(tsk_rt(t)->tot_exec_time, |
236 | (get_job_no(t) - 2)); | ||
235 | 237 | ||
236 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); | 238 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); |
237 | if (rec) { | 239 | if (rec) { |