Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205355
b: refs/heads/master
c: 0cddf56
h: refs/heads/master
i:
  205353: 0780e03
  205351: 89bf8de
v: v3
  • Loading branch information
Nikhil Rao authored and Frederic Weisbecker committed Aug 1, 2010
1 parent d78747e commit 8d41ec5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be6d947691376218e788418e2656fc9a3e43b9bc
refs/heads/master: 0cddf56aa841713b37c10c5ab673d6164fce9833
23 changes: 14 additions & 9 deletions trunk/tools/perf/scripts/python/sched-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
from Core import *

class RootFrame(wx.Frame):
Y_OFFSET = 100
CPU_HEIGHT = 100
CPU_SPACE = 50
EVENT_MARKING_WIDTH = 5

def __init__(self, timeslices, parent = None, id = -1, title = "Migration"):
wx.Frame.__init__(self, parent, id, title)

Expand Down Expand Up @@ -97,8 +102,8 @@ def update_rectangle_cpu(self, dc, slice, cpu, offset_time):
if width_px == 0:
return

offset_py = 100 + (cpu * 150)
width_py = 100
offset_py = RootFrame.Y_OFFSET + (cpu * (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE))
width_py = RootFrame.CPU_HEIGHT

if cpu in slice.event_cpus:
rgb = rq.event.color()
Expand All @@ -107,9 +112,9 @@ def update_rectangle_cpu(self, dc, slice, cpu, offset_time):
color = wx.Colour(r, g, b)
brush = wx.Brush(color, wx.SOLID)
dc.SetBrush(brush)
dc.DrawRectangle(offset_px, offset_py, width_px, 5)
width_py -= 5
offset_py += 5
dc.DrawRectangle(offset_px, offset_py, width_px, RootFrame.EVENT_MARKING_WIDTH)
width_py -= RootFrame.EVENT_MARKING_WIDTH
offset_py += RootFrame.EVENT_MARKING_WIDTH

red_power = int(0xff - (0xff * load_rate))
color = wx.Colour(0xff, red_power, red_power)
Expand Down Expand Up @@ -154,11 +159,11 @@ def on_paint(self, event):
self.update_rectangles(dc, start, end)

def cpu_from_ypixel(self, y):
y -= 100
cpu = y / 150
height = y % 150
y -= RootFrame.Y_OFFSET
cpu = y / (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE)
height = y % (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE)

if cpu < 0 or cpu > self.max_cpu or height > 100:
if cpu < 0 or cpu > self.max_cpu or height > RootFrame.CPU_HEIGHT:
return -1

return cpu
Expand Down

0 comments on commit 8d41ec5

Please sign in to comment.