Fix: process the sched_switch for the swapper
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 13 Mar 2015 20:05:40 +0000 (16:05 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Fri, 13 Mar 2015 20:10:44 +0000 (16:10 -0400)
Removes the unknown process from the final results. The swapper is a
special case because we have one per CPU, with a different name but the
same PID (0).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
linuxautomaton/linuxautomaton/sched.py

index 68c997e8a9a78e4b7c078785276387e660dfd4d2..a483337fe02f215fa7d01a2cb2b5e04a0b8edfd4 100644 (file)
@@ -64,12 +64,12 @@ class SchedStateProvider(sp.StateProvider):
             cpu.current_tid = next_tid
 
     def _sched_switch_per_tid(self, next_tid, next_comm, prev_tid):
-        # exclude swapper process
-        if next_tid == 0:
-            return
-
         if next_tid not in self.state.tids:
-            self.state.tids[next_tid] = sv.Process(tid=next_tid)
+            if next_tid == 0:
+                # special case for the swapper
+                self.state.tids[next_tid] = sv.Process(tid=next_tid, pid=0)
+            else:
+                self.state.tids[next_tid] = sv.Process(tid=next_tid)
 
         next_proc = self.state.tids[next_tid]
         next_proc.comm = next_comm
This page took 0.026114 seconds and 5 git commands to generate.