diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-16 16:40:37 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-16 16:40:37 -0400 |
commit | cc295d3e4924efd31c268a57f01b1412c6513301 (patch) | |
tree | 60a4f1e70a5dc0607330b18d24336f8b2fea5462 /rt-graph.h | |
parent | 1ceec23c6817d0d3cba77ea0e17b95a9fc506d42 (diff) |
containers: added record parsing
Diffstat (limited to 'rt-graph.h')
-rw-r--r-- | rt-graph.h | 140 |
1 files changed, 117 insertions, 23 deletions
@@ -9,23 +9,23 @@ | |||
9 | 9 | ||
10 | #define LLABEL 30 | 10 | #define LLABEL 30 |
11 | #define SEARCH_PERIODS 3 | 11 | #define SEARCH_PERIODS 3 |
12 | |||
13 | #define NO_CPU -1 | 12 | #define NO_CPU -1 |
14 | |||
15 | #define RT_TS_FIELD "__rt_ts" | 13 | #define RT_TS_FIELD "__rt_ts" |
14 | |||
16 | #define TS_HASH_SIZE 12 | 15 | #define TS_HASH_SIZE 12 |
17 | struct ts_list; | 16 | #define CONT_HASH_SIZE 12 |
18 | 17 | ||
19 | struct rt_task_params { | 18 | struct ts_list; |
20 | unsigned long long wcet; | 19 | struct vcpu_list; |
21 | unsigned long long period; | ||
22 | }; | ||
23 | 20 | ||
24 | struct rt_graph_info { | 21 | struct rt_graph_info { |
25 | 22 | ||
26 | /* List of all real-time tasks */ | 23 | /* List of all real-time tasks */ |
27 | struct task_list *tasks[TASK_HASH_SIZE]; | 24 | struct task_list *tasks[TASK_HASH_SIZE]; |
28 | 25 | ||
26 | /* List of all real-time containers */ | ||
27 | struct cont_list *containers[CONT_HASH_SIZE]; | ||
28 | |||
29 | /* Cache of event fields so that they don't need to be located | 29 | /* Cache of event fields so that they don't need to be located |
30 | * during each access. | 30 | * during each access. |
31 | */ | 31 | */ |
@@ -37,12 +37,10 @@ struct rt_graph_info { | |||
37 | gint switch_to_id; | 37 | gint switch_to_id; |
38 | struct format_field *switch_to_pid_field; | 38 | struct format_field *switch_to_pid_field; |
39 | struct format_field *switch_to_job_field; | 39 | struct format_field *switch_to_job_field; |
40 | struct format_field *switch_to_ts_field; | ||
41 | 40 | ||
42 | gint switch_away_id; | 41 | gint switch_away_id; |
43 | struct format_field *switch_away_pid_field; | 42 | struct format_field *switch_away_pid_field; |
44 | struct format_field *switch_away_job_field; | 43 | struct format_field *switch_away_job_field; |
45 | struct format_field *switch_away_ts_field; | ||
46 | 44 | ||
47 | gint task_release_id; | 45 | gint task_release_id; |
48 | struct format_field *release_pid_field; | 46 | struct format_field *release_pid_field; |
@@ -53,55 +51,146 @@ struct rt_graph_info { | |||
53 | gint task_completion_id; | 51 | gint task_completion_id; |
54 | struct format_field *completion_pid_field; | 52 | struct format_field *completion_pid_field; |
55 | struct format_field *completion_job_field; | 53 | struct format_field *completion_job_field; |
56 | struct format_field *completion_ts_field; | ||
57 | 54 | ||
58 | gint task_block_id; | 55 | gint task_block_id; |
59 | struct format_field *block_pid_field; | 56 | struct format_field *block_pid_field; |
60 | struct format_field *block_ts_field; | ||
61 | 57 | ||
62 | gint task_resume_id; | 58 | gint task_resume_id; |
63 | struct format_field *resume_pid_field; | 59 | struct format_field *resume_pid_field; |
64 | struct format_field *resume_ts_field; | 60 | |
61 | gint container_param_id; | ||
62 | struct format_field *cparam_cid_field; | ||
63 | struct format_field *cparam_name_field; | ||
64 | |||
65 | gint server_param_id; | ||
66 | struct format_field *sparam_sid_field; | ||
67 | struct format_field *sparam_cid_field; | ||
68 | struct format_field *sparam_wcet_field; | ||
69 | struct format_field *sparam_period_field; | ||
70 | |||
71 | gint server_switch_to_id; | ||
72 | struct format_field *sswitch_to_sid_field; | ||
73 | struct format_field *sswitch_to_job_field; | ||
74 | struct format_field *sswitch_to_tid_field; | ||
75 | |||
76 | gint server_switch_away_id; | ||
77 | struct format_field *sswitch_away_sid_field; | ||
78 | struct format_field *sswitch_away_job_field; | ||
79 | struct format_field *sswitch_away_tid_field; | ||
80 | |||
81 | gint server_release_id; | ||
82 | struct format_field *srelease_sid_field; | ||
83 | struct format_field *srelease_job_field; | ||
84 | struct format_field *srelease_release_field; | ||
85 | struct format_field *srelease_deadline_field; | ||
86 | |||
87 | gint server_completion_id; | ||
88 | struct format_field *scompletion_sid_field; | ||
89 | struct format_field *scompletion_job_field; | ||
90 | |||
91 | gint server_block_id; | ||
92 | struct format_field *sblock_sid_field; | ||
93 | |||
94 | gint server_resume_id; | ||
95 | struct format_field *sresume_sid_field; | ||
96 | |||
65 | 97 | ||
66 | /* Cache of ts fields for non-litmus events */ | 98 | /* Cache of ts fields for non-litmus events */ |
67 | struct ts_list *events[TS_HASH_SIZE]; | 99 | struct ts_list *events[TS_HASH_SIZE]; |
68 | 100 | ||
101 | /* Used to calculate maximum search times */ | ||
69 | unsigned long long max_period; | 102 | unsigned long long max_period; |
70 | }; | 103 | }; |
71 | 104 | ||
105 | /* | ||
106 | * A list of cached time-stamp fields | ||
107 | */ | ||
72 | struct ts_list { | 108 | struct ts_list { |
73 | struct ts_list *next; | 109 | struct ts_list *next; |
74 | gint eid; | 110 | gint eid; |
75 | struct format_field *ts_field; | 111 | struct format_field *ts_field; |
76 | }; | 112 | }; |
77 | 113 | ||
114 | /* | ||
115 | * Per-task real-time data | ||
116 | */ | ||
117 | struct rt_task_params { | ||
118 | unsigned long long wcet; | ||
119 | unsigned long long period; | ||
120 | }; | ||
121 | |||
122 | /* | ||
123 | * A list of servers | ||
124 | */ | ||
125 | struct vcpu_list { | ||
126 | struct vcpu_list *next; | ||
127 | gint sid; | ||
128 | struct rt_task_params params; | ||
129 | }; | ||
130 | |||
131 | /* | ||
132 | * A list of containers | ||
133 | */ | ||
134 | struct cont_list { | ||
135 | struct cont_list *next; | ||
136 | gint cid; | ||
137 | const char* name; | ||
138 | struct vcpu_list *vcpus; | ||
139 | }; | ||
140 | |||
78 | /* Event parsers */ | 141 | /* Event parsers */ |
79 | int rt_graph_check_any(struct rt_graph_info *rtinfo, | 142 | int rt_graph_check_any(struct graph_info *ginfo, struct record *record, |
80 | struct pevent *pevent, struct record *record, | ||
81 | gint *pid, gint *eid, unsigned long long *ts); | 143 | gint *pid, gint *eid, unsigned long long *ts); |
82 | int rt_graph_check_task_param(struct rt_graph_info *rtinfo, struct pevent *pevent, | 144 | int rt_graph_check_task_param(struct graph_info *ginfo, |
83 | struct record *record, gint *pid, | 145 | struct record *record, gint *pid, |
84 | unsigned long long *wcet, | 146 | unsigned long long *wcet, |
85 | unsigned long long *period); | 147 | unsigned long long *period); |
86 | int rt_graph_check_switch_to(struct rt_graph_info *rtinfo, struct pevent *pevent, | 148 | int rt_graph_check_switch_to(struct graph_info *ginfo, |
87 | struct record *record, gint *pid, gint *job, | 149 | struct record *record, gint *pid, gint *job, |
88 | unsigned long long *when); | 150 | unsigned long long *when); |
89 | int rt_graph_check_switch_away(struct rt_graph_info *rtinfo, struct pevent *pevent, | 151 | int rt_graph_check_switch_away(struct graph_info *ginfo, |
90 | struct record *record, gint *pid, gint *job, | 152 | struct record *record, gint *pid, gint *job, |
91 | unsigned long long *when); | 153 | unsigned long long *when); |
92 | int rt_graph_check_task_release(struct rt_graph_info *rtinfo, struct pevent *pevent, | 154 | int rt_graph_check_task_release(struct graph_info *ginfo, |
93 | struct record *record, gint *pid, gint *job, | 155 | struct record *record, gint *pid, gint *job, |
94 | unsigned long long *release, | 156 | unsigned long long *release, |
95 | unsigned long long *deadline); | 157 | unsigned long long *deadline); |
96 | int rt_graph_check_task_completion(struct rt_graph_info *rtinfo, struct pevent *pevent, | 158 | int rt_graph_check_task_completion(struct graph_info *ginfo, |
97 | struct record *record, gint *pid, gint *job, | 159 | struct record *record, gint *pid, gint *job, |
98 | unsigned long long *when); | 160 | unsigned long long *when); |
99 | int rt_graph_check_task_block(struct rt_graph_info *rtinfo, struct pevent *pevent, | 161 | int rt_graph_check_task_block(struct graph_info *ginfo, |
100 | struct record *record, gint *pid, | 162 | struct record *record, gint *pid, |
101 | unsigned long long *when); | 163 | unsigned long long *when); |
102 | int rt_graph_check_task_resume(struct rt_graph_info *rtinfo, struct pevent *pevent, | 164 | int rt_graph_check_task_resume(struct graph_info *ginfo, struct record *record, |
103 | struct record *record, gint *pid, | 165 | gint *pid, unsigned long long *when); |
104 | unsigned long long *when); | 166 | int rt_graph_check_container_param(struct graph_info *ginfo, |
167 | struct record *record, | ||
168 | gint *cid, char **name); | ||
169 | int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, | ||
170 | gint *sid, gint *cid, | ||
171 | unsigned long long *wcet, | ||
172 | unsigned long long *period); | ||
173 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, | ||
174 | struct record *record, | ||
175 | gint *sid, gint *job, gint *tid, | ||
176 | unsigned long long *when); | ||
177 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, | ||
178 | struct record *record, | ||
179 | gint *sid, gint *job, gint *tid, | ||
180 | unsigned long long *when); | ||
181 | int rt_graph_check_server_release(struct graph_info *ginfo, | ||
182 | struct record *record, | ||
183 | gint *sid, gint *job, | ||
184 | unsigned long long *release, | ||
185 | unsigned long long *deadline); | ||
186 | int rt_graph_check_server_completion(struct graph_info *ginfo, | ||
187 | struct record *record, | ||
188 | gint *sid, gint *job); | ||
189 | int rt_graph_check_server_block(struct graph_info *ginfo, | ||
190 | struct record *record, gint *pid, | ||
191 | unsigned long long *when); | ||
192 | int rt_graph_check_server_resume(struct graph_info *ginfo, struct record *record, | ||
193 | gint *pid, unsigned long long *when); | ||
105 | void init_rt_event_cache(struct rt_graph_info *rtinfo); | 194 | void init_rt_event_cache(struct rt_graph_info *rtinfo); |
106 | 195 | ||
107 | /* Methods for dealing with RT timestamps */ | 196 | /* Methods for dealing with RT timestamps */ |
@@ -122,4 +211,9 @@ static inline void nano_to_milli(unsigned long long time, | |||
122 | *nsec = time % 1000000ULL; | 211 | *nsec = time % 1000000ULL; |
123 | } | 212 | } |
124 | 213 | ||
214 | static inline float nano_as_milli(unsigned long long time) | ||
215 | { | ||
216 | return (float)time / 1000000ULL; | ||
217 | } | ||
218 | |||
125 | #endif | 219 | #endif |