diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-24 17:45:12 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-24 17:45:12 -0400 |
commit | b53dd6d749e0a164010f2cf1fedab2b10b8bb305 (patch) | |
tree | c241366acea35e0ab58509ef7b441c5299a1c0b8 /rt-graph.h | |
parent | cc295d3e4924efd31c268a57f01b1412c6513301 (diff) |
containers: abstracted out common task-type code
Diffstat (limited to 'rt-graph.h')
-rw-r--r-- | rt-graph.h | 27 |
1 files changed, 18 insertions, 9 deletions
@@ -4,8 +4,10 @@ | |||
4 | #include <gtk/gtk.h> | 4 | #include <gtk/gtk.h> |
5 | #include "task-list.h" | 5 | #include "task-list.h" |
6 | #include "trace-cmd.h" | 6 | #include "trace-cmd.h" |
7 | #include "rt-plot.h" | ||
7 | #include "rt-plot-task.h" | 8 | #include "rt-plot-task.h" |
8 | #include "rt-plot-cpu.h" | 9 | #include "rt-plot-cpu.h" |
10 | #include "rt-plot-container.h" | ||
9 | 11 | ||
10 | #define LLABEL 30 | 12 | #define LLABEL 30 |
11 | #define SEARCH_PERIODS 3 | 13 | #define SEARCH_PERIODS 3 |
@@ -102,6 +104,7 @@ struct rt_graph_info { | |||
102 | unsigned long long max_period; | 104 | unsigned long long max_period; |
103 | }; | 105 | }; |
104 | 106 | ||
107 | |||
105 | /* | 108 | /* |
106 | * A list of cached time-stamp fields | 109 | * A list of cached time-stamp fields |
107 | */ | 110 | */ |
@@ -134,6 +137,7 @@ struct vcpu_list { | |||
134 | struct cont_list { | 137 | struct cont_list { |
135 | struct cont_list *next; | 138 | struct cont_list *next; |
136 | gint cid; | 139 | gint cid; |
140 | gboolean plotted; | ||
137 | const char* name; | 141 | const char* name; |
138 | struct vcpu_list *vcpus; | 142 | struct vcpu_list *vcpus; |
139 | }; | 143 | }; |
@@ -173,7 +177,7 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, | |||
173 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, | 177 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, |
174 | struct record *record, | 178 | struct record *record, |
175 | gint *sid, gint *job, gint *tid, | 179 | gint *sid, gint *job, gint *tid, |
176 | unsigned long long *when); | 180 | unsigned long long *when); |
177 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, | 181 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, |
178 | struct record *record, | 182 | struct record *record, |
179 | gint *sid, gint *job, gint *tid, | 183 | gint *sid, gint *job, gint *tid, |
@@ -185,7 +189,8 @@ int rt_graph_check_server_release(struct graph_info *ginfo, | |||
185 | unsigned long long *deadline); | 189 | unsigned long long *deadline); |
186 | int rt_graph_check_server_completion(struct graph_info *ginfo, | 190 | int rt_graph_check_server_completion(struct graph_info *ginfo, |
187 | struct record *record, | 191 | struct record *record, |
188 | gint *sid, gint *job); | 192 | gint *sid, gint *job, |
193 | unsigned long long *when); | ||
189 | int rt_graph_check_server_block(struct graph_info *ginfo, | 194 | int rt_graph_check_server_block(struct graph_info *ginfo, |
190 | struct record *record, gint *pid, | 195 | struct record *record, gint *pid, |
191 | unsigned long long *when); | 196 | unsigned long long *when); |
@@ -193,15 +198,12 @@ int rt_graph_check_server_resume(struct graph_info *ginfo, struct record *record | |||
193 | gint *pid, unsigned long long *when); | 198 | gint *pid, unsigned long long *when); |
194 | void init_rt_event_cache(struct rt_graph_info *rtinfo); | 199 | void init_rt_event_cache(struct rt_graph_info *rtinfo); |
195 | 200 | ||
196 | /* Methods for dealing with RT timestamps */ | ||
197 | unsigned long long get_rts(struct graph_info *ginfo, | 201 | unsigned long long get_rts(struct graph_info *ginfo, |
198 | struct record *record); | 202 | struct record *record); |
199 | unsigned long long next_rts(struct graph_info *ginfo, int cpu, | 203 | |
200 | unsigned long long ft_target); | 204 | |
201 | void set_cpu_to_rts(struct graph_info *ginfo, | 205 | /* Other */ |
202 | unsigned long long rt_target, int cpu); | 206 | struct cont_list* find_container(struct cont_list **conts, gint cid, gint key); |
203 | void set_cpus_to_rts(struct graph_info *ginfo, | ||
204 | unsigned long long rt_target); | ||
205 | 207 | ||
206 | static inline void nano_to_milli(unsigned long long time, | 208 | static inline void nano_to_milli(unsigned long long time, |
207 | unsigned long long *msec, | 209 | unsigned long long *msec, |
@@ -216,4 +218,11 @@ static inline float nano_as_milli(unsigned long long time) | |||
216 | return (float)time / 1000000ULL; | 218 | return (float)time / 1000000ULL; |
217 | } | 219 | } |
218 | 220 | ||
221 | static inline int get_container_key(gint cid) | ||
222 | { | ||
223 | return trace_hash(cid) % CONT_HASH_SIZE; | ||
224 | } | ||
225 | |||
226 | #define max_rt_search(ginfo) (SEARCH_PERIODS*ginfo->rtg_info.max_period) | ||
227 | |||
219 | #endif | 228 | #endif |