Lines Matching full:self
41 def __repr__(self): argument
49 def __init__(self, sleeper): argument
50 self.sleeper = sleeper
52 def __repr__(self): argument
53 return "%s gone to sleep" % thread_name(self.sleeper)
60 def __init__(self, wakee): argument
61 self.wakee = wakee
63 def __repr__(self): argument
64 return "%s woke up" % thread_name(self.wakee)
71 def __init__(self, child): argument
72 self.child = child
74 def __repr__(self): argument
75 return "new forked task %s" % thread_name(self.child)
82 def __init__(self, new): argument
83 self.new = new
85 def __repr__(self): argument
86 return "task migrated in %s" % thread_name(self.new)
93 def __init__(self, old): argument
94 self.old = old
96 def __repr__(self): argument
97 return "task migrated out %s" % thread_name(self.old)
100 def __init__(self, tasks = [0], event = RunqueueEventUnknown()): argument
101 self.tasks = tuple(tasks)
102 self.event = event
104 def sched_switch(self, prev, prev_state, next): argument
107 if taskState(prev_state) == "R" and next in self.tasks \
108 and prev in self.tasks:
109 return self
114 next_tasks = list(self.tasks[:])
115 if prev in self.tasks:
126 def migrate_out(self, old): argument
127 if old not in self.tasks:
128 return self
129 next_tasks = [task for task in self.tasks if task != old]
133 def __migrate_in(self, new, event): argument
134 if new in self.tasks:
135 self.event = event
136 return self
137 next_tasks = self.tasks[:] + tuple([new])
141 def migrate_in(self, new): argument
142 return self.__migrate_in(new, RunqueueMigrateIn(new))
144 def wake_up(self, new): argument
145 return self.__migrate_in(new, RunqueueEventWakeup(new))
147 def wake_up_new(self, new): argument
148 return self.__migrate_in(new, RunqueueEventFork(new))
150 def load(self): argument
153 return len(self.tasks) - 1
155 def __repr__(self): argument
156 ret = self.tasks.__repr__()
157 ret += self.origin_tostring()
162 def __init__(self, start, prev): argument
163 self.start = start
164 self.prev = prev
165 self.end = start
167 self.event_cpus = []
169 self.total_load = prev.total_load
170 self.rqs = prev.rqs.copy()
172 self.rqs = defaultdict(RunqueueSnapshot)
173 self.total_load = 0
175 def __update_total_load(self, old_rq, new_rq): argument
177 self.total_load += diff
179 def sched_switch(self, ts_list, prev, prev_state, next, cpu): argument
180 old_rq = self.prev.rqs[cpu]
186 self.rqs[cpu] = new_rq
187 self.__update_total_load(old_rq, new_rq)
188 ts_list.append(self)
189 self.event_cpus = [cpu]
191 def migrate(self, ts_list, new, old_cpu, new_cpu): argument
194 old_rq = self.prev.rqs[old_cpu]
196 self.rqs[old_cpu] = out_rq
197 self.__update_total_load(old_rq, out_rq)
199 new_rq = self.prev.rqs[new_cpu]
201 self.rqs[new_cpu] = in_rq
202 self.__update_total_load(new_rq, in_rq)
204 ts_list.append(self)
207 self.event_cpus.append(old_cpu)
208 self.event_cpus.append(new_cpu)
210 def wake_up(self, ts_list, pid, cpu, fork): argument
211 old_rq = self.prev.rqs[cpu]
219 self.rqs[cpu] = new_rq
220 self.__update_total_load(old_rq, new_rq)
221 ts_list.append(self)
222 self.event_cpus = [cpu]
224 def next(self, t): argument
225 self.end = t
226 return TimeSlice(t, self)
229 def __init__(self, arg = []): argument
230 self.data = arg
232 def get_time_slice(self, ts): argument
233 if len(self.data) == 0:
236 slice = self.data[-1].next(ts)
239 def find_time_slice(self, ts): argument
241 end = len(self.data)
249 if self.data[i].start <= ts and self.data[i].end >= ts:
254 if self.data[i].end < ts:
257 elif self.data[i].start > ts:
262 def set_root_win(self, win): argument
263 self.root_win = win
265 def mouse_down(self, cpu, t): argument
266 idx = self.find_time_slice(t)
270 ts = self[idx]
280 self.root_win.update_summary(raw)
282 def update_rectangle_cpu(self, slice, cpu): argument
298 self.root_win.paint_rectangle_zone(cpu, color, top_color, slice.start, slice.end)
300 def fill_zone(self, start, end): argument
301 i = self.find_time_slice(start)
305 for i in range(i, len(self.data)):
306 timeslice = self.data[i]
311 self.update_rectangle_cpu(timeslice, cpu)
313 def interval(self): argument
314 if len(self.data) == 0:
317 return (self.data[0].start, self.data[-1].end)
319 def nr_rectangles(self): argument
320 last_ts = self.data[-1]
329 def __init__(self): argument
330 self.current_tsk = defaultdict(lambda : -1)
331 self.timeslices = TimeSliceList()
333 def sched_switch(self, headers, prev_comm, prev_pid, prev_prio, prev_state, argument
338 on_cpu_task = self.current_tsk[headers.cpu]
346 self.current_tsk[headers.cpu] = next_pid
348 ts = self.timeslices.get_time_slice(headers.ts())
349 ts.sched_switch(self.timeslices, prev_pid, prev_state, next_pid, headers.cpu)
351 def migrate(self, headers, pid, prio, orig_cpu, dest_cpu): argument
352 ts = self.timeslices.get_time_slice(headers.ts())
353 ts.migrate(self.timeslices, pid, orig_cpu, dest_cpu)
355 def wake_up(self, headers, comm, pid, success, target_cpu, fork): argument
358 ts = self.timeslices.get_time_slice(headers.ts())
359 ts.wake_up(self.timeslices, pid, target_cpu, fork)