aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Brandenburg <bbb@mpi-sws.org>2016-03-24 07:16:01 -0400
committerBjörn Brandenburg <bbb@mpi-sws.org>2016-03-24 07:16:01 -0400
commitd014384385a3e20421a2503df09f7911abb6fc44 (patch)
tree1fd867799acf9b5db777205707edbb44c21c00b3
parent462be64e1eecf61ba0c63e75e1cb535ceb8767c9 (diff)
st-draw: fix typo and draw labels as part of grid
-rw-r--r--sched_trace/draw.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/sched_trace/draw.py b/sched_trace/draw.py
index 8c32cc1..273e17b 100644
--- a/sched_trace/draw.py
+++ b/sched_trace/draw.py
@@ -138,7 +138,7 @@ def render(opts, trace):
138# c.scale(xscale, yscale) 138# c.scale(xscale, yscale)
139 139
140 if opts.verbose: 140 if opts.verbose:
141 print '[II] Dawing grid...', 141 print '[II] Drawing grid...',
142 sys.stdout.flush() 142 sys.stdout.flush()
143 143
144 # draw minor tick lines 144 # draw minor tick lines
@@ -173,9 +173,21 @@ def render(opts, trace):
173 center_text(c, x, y, "%dms" % ((time - opts.start) / 1E6)) 173 center_text(c, x, y, "%dms" % ((time - opts.start) / 1E6))
174 time += opts.major_ticks * 1E6 174 time += opts.major_ticks * 1E6
175 175
176 # draw task labels
177 c.set_font_size(TASK_LABEL_FONT_SIZE)
178 c.set_source_rgb(*TASK_LABEL_COLOR)
179 for pid in tasks:
180 x = -24
181 y = ypos(task_idx[pid] + 0.25)
182 vcenter_right_align_text(c, x, y, "%s/%d" % (trace.task_names[pid], pid))
183 y = ypos(task_idx[pid] + 0.75)
184 vcenter_right_align_text(c, x, y,
185 "(%.2fms, %.2fms)" % (trace.task_wcets[pid] / 1E6,
186 trace.task_periods[pid] / 1E6))
187
176 if opts.verbose: 188 if opts.verbose:
177 print 'done.' 189 print 'done.'
178 print '[II] Dawing CPU allocations...', 190 print '[II] Drawing CPU allocations...',
179 sys.stdout.flush() 191 sys.stdout.flush()
180 192
181 193
@@ -209,7 +221,7 @@ def render(opts, trace):
209 221
210 if opts.verbose: 222 if opts.verbose:
211 print 'done.' 223 print 'done.'
212 print '[II] Dawing releases and deadlines...', 224 print '[II] Drawing releases and deadlines...',
213 sys.stdout.flush() 225 sys.stdout.flush()
214 226
215 # draw releases and deadlines 227 # draw releases and deadlines
@@ -243,7 +255,7 @@ def render(opts, trace):
243 255
244 if opts.verbose: 256 if opts.verbose:
245 print 'done.' 257 print 'done.'
246 print '[II] Dawing job completions...', 258 print '[II] Drawing job completions...',
247 sys.stdout.flush() 259 sys.stdout.flush()
248 260
249 # draw job completions 261 # draw job completions
@@ -260,7 +272,7 @@ def render(opts, trace):
260 272
261 if opts.verbose: 273 if opts.verbose:
262 print 'done.' 274 print 'done.'
263 print '[II] Dawing job suspensions...', 275 print '[II] Drawing job suspensions...',
264 sys.stdout.flush() 276 sys.stdout.flush()
265 277
266 # draw job suspensions 278 # draw job suspensions
@@ -282,7 +294,7 @@ def render(opts, trace):
282 294
283 if opts.verbose: 295 if opts.verbose:
284 print 'done.' 296 print 'done.'
285 print '[II] Dawing job wake-ups...', 297 print '[II] Drawing job wake-ups...',
286 sys.stdout.flush() 298 sys.stdout.flush()
287 299
288 # draw job suspensions 300 # draw job suspensions
@@ -303,32 +315,20 @@ def render(opts, trace):
303 315
304 if opts.verbose: 316 if opts.verbose:
305 print 'done.' 317 print 'done.'
306
307
308 # draw task labels
309 c.set_font_size(TASK_LABEL_FONT_SIZE)
310 c.set_source_rgb(*TASK_LABEL_COLOR)
311 for pid in tasks:
312 x = -24
313 y = ypos(task_idx[pid] + 0.25)
314 vcenter_right_align_text(c, x, y, "%s/%d" % (trace.task_names[pid], pid))
315 y = ypos(task_idx[pid] + 0.75)
316 vcenter_right_align_text(c, x, y,
317 "(%.2fms, %.2fms)" % (trace.task_wcets[pid] / 1E6,
318 trace.task_periods[pid] / 1E6))
319
320
321 if opts.verbose:
322 print '[II] Finishing PDF...', 318 print '[II] Finishing PDF...',
323 sys.stdout.flush() 319 sys.stdout.flush()
320
324 pdf.finish() 321 pdf.finish()
322
325 if opts.verbose: 323 if opts.verbose:
326 print 'done.' 324 print 'done.'
327 325
328 if opts.verbose: 326 if opts.verbose:
329 print '[II] Flushing PDF...', 327 print '[II] Flushing PDF...',
330 sys.stdout.flush() 328 sys.stdout.flush()
329
331 pdf.flush() 330 pdf.flush()
331
332 if opts.verbose: 332 if opts.verbose:
333 print 'done.' 333 print 'done.'
334 334