- For preemption and yield events, we want to skip the next two state events
as they are the setrunqueue() and sched_add() calls. Since they happen immediately before the thread is placed on a run queue they would normally dwarf the more informative preemption or yield event and it is implicitly understood that a thread is back on the run queue as part of these events.
This commit is contained in:
parent
8d13141666
commit
7b0ff93d2d
@ -394,13 +394,14 @@ def draw(self, canvas, xpos, ypos):
|
||||
next = self.nextstate()
|
||||
if (self.skipself == 1 or next == None):
|
||||
return (xpos)
|
||||
if (self.skipnext):
|
||||
while (self.skipnext):
|
||||
skipped = next
|
||||
next.skipself = 1
|
||||
next.real = 0
|
||||
next = next.nextstate()
|
||||
if (next == None):
|
||||
next = skipped
|
||||
self.skipnext -= 1
|
||||
self.duration = next.timestamp - self.timestamp
|
||||
delta = self.duration / canvas.ratio
|
||||
l = canvas.create_rectangle(xpos, ypos,
|
||||
@ -487,7 +488,7 @@ class Yielding(StateEvent):
|
||||
enabled = 1
|
||||
def __init__(self, thread, cpu, timestamp, prio):
|
||||
StateEvent.__init__(self, thread, cpu, timestamp)
|
||||
self.skipnext = 1
|
||||
self.skipnext = 2
|
||||
self.prio = prio
|
||||
self.textadd(("prio:", self.prio, 0))
|
||||
|
||||
@ -532,7 +533,7 @@ class Preempted(StateEvent):
|
||||
enabled = 1
|
||||
def __init__(self, thread, cpu, timestamp, prio, bythread):
|
||||
StateEvent.__init__(self, thread, cpu, timestamp)
|
||||
self.skipnext = 1
|
||||
self.skipnext = 2
|
||||
self.prio = prio
|
||||
self.linked = bythread
|
||||
self.textadd(("prio:", self.prio, 0))
|
||||
|
Loading…
Reference in New Issue
Block a user