Fix: handle missing vec and empty softirq list on exit
authorAntoine Busque <abusque@efficios.com>
Tue, 16 Feb 2016 16:17:35 +0000 (11:17 -0500)
committerAntoine Busque <abusque@efficios.com>
Wed, 24 Feb 2016 23:24:03 +0000 (18:24 -0500)
Signed-off-by: Antoine Busque <abusque@efficios.com>
lttnganalyses/linuxautomaton/irq.py

index c10249d6a3e08605f6346d3510a7e5334f99d819..a1def6c704afd2f65b3a12897eeac34293dd5afa 100644 (file)
@@ -100,11 +100,16 @@ class IrqStateProvider(sp.StateProvider):
     def _process_softirq_exit(self, event):
         cpu = self._get_cpu(event['cpu_id'])
         vec = event['vec']
+        # List of enqueued softirqs for the current cpu/vec
+        # combination. None if vec is not found in the dictionary.
+        current_softirqs = cpu.current_softirqs.get(vec)
 
-        if vec not in cpu.current_softirqs:
+        # Ignore the exit if either vec was not in the cpu's dict or
+        # if its irq list was empty (i.e. no matching raise).
+        if not current_softirqs:
             return
 
-        cpu.current_softirqs[vec][0].end_ts = event.timestamp
+        current_softirqs[0].end_ts = event.timestamp
         self._state.send_notification_cb('softirq_exit',
-                                         softirq=cpu.current_softirqs[vec][0])
-        del cpu.current_softirqs[vec][0]
+                                         softirq=current_softirqs[0])
+        del current_softirqs[0]
This page took 0.025208 seconds and 5 git commands to generate.