summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-05-09 17:12:28 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-05-09 17:12:28 -0400
commit6b2fd4cfe200f002cb407494c0990d244340078e (patch)
tree0f1410b8a7615b8e97d5b491fb21f8b6d8946fdc
parent4ed64363706efc1de89d309df9cf33fda095a611 (diff)
Print out average execution with TASK_EXIT
-rw-r--r--include/sched_trace.h2
-rw-r--r--src/util.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/include/sched_trace.h b/include/sched_trace.h
index 618214b..64a5754 100644
--- a/include/sched_trace.h
+++ b/include/sched_trace.h
@@ -82,7 +82,7 @@ struct st_sys_release_data {
82}; 82};
83 83
84struct st_task_exit_data { 84struct st_task_exit_data {
85 u64 when; 85 u64 avg_exec_time;
86 u64 max_exec_time; 86 u64 max_exec_time;
87}; 87};
88 88
diff --git a/src/util.c b/src/util.c
index 5d46e08..7e2912d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -52,8 +52,6 @@ u64 event_time(struct st_event_record* rec)
52 case ST_RESUME: 52 case ST_RESUME:
53 case ST_SYS_RELEASE: 53 case ST_SYS_RELEASE:
54 case ST_TASK_EXIT: 54 case ST_TASK_EXIT:
55 when = rec->data.raw[0];
56 break;
57 default: 55 default:
58 /* stuff that doesn't have a time stamp should occur "early" */ 56 /* stuff that doesn't have a time stamp should occur "early" */
59 when = 0; 57 when = 0;
@@ -102,9 +100,9 @@ static void print_time_data2(struct st_event_record* rec)
102 printf("%6.2fms", rec->data.raw[1] / 1000000.0); 100 printf("%6.2fms", rec->data.raw[1] / 1000000.0);
103} 101}
104 102
105static void print_wcet(struct st_event_record* rec) 103static void print_exit(struct st_event_record* rec)
106{ 104{
107 printf("%lu ns", rec->data.raw[1]); 105 printf("Avg: %lu ns, Max: %lu ns", rec->data.raw[0], rec->data.raw[1]);
108} 106}
109 107
110static print_t print_detail[] = { 108static print_t print_detail[] = {
@@ -120,7 +118,7 @@ static print_t print_detail[] = {
120 print_nothing, /* RESUME */ 118 print_nothing, /* RESUME */
121 print_nothing, /* ACTION */ 119 print_nothing, /* ACTION */
122 print_time_data2, /* SYS_RELEASE */ 120 print_time_data2, /* SYS_RELEASE */
123 print_wcet,/* TASK_EXIT */ 121 print_exit,/* TASK_EXIT */
124 print_raw, /* invalid */ 122 print_raw, /* invalid */
125}; 123};
126 124