Fix: compute correct prio value on older tracer versions
authorAntoine Busque <abusque@efficios.com>
Mon, 14 Dec 2015 11:22:49 +0000 (06:22 -0500)
committerAntoine Busque <abusque@efficios.com>
Mon, 14 Dec 2015 11:28:03 +0000 (06:28 -0500)
Versions of lttng-modules prior to 2.7.1 did not subtract the
MAX_RT_PRIO (whose value is 100) from the prio fields in
sched_wak{eup, eup_new, ing} events.

Now that we keep the tracer version information in the automaton,
compute the offset if necessary, depending on the version.

Signed-off-by: Antoine Busque <abusque@efficios.com>
lttnganalyses/linuxautomaton/sched.py

index 6d9186ef80ba5c59744e83bd3e055244bce3299d..4e5b076de71130a12047db997dfdac760c5cad83 100644 (file)
 # SOFTWARE.
 
 from . import sp, sv
+from ..common import version_utils
 
 
 class SchedStateProvider(sp.StateProvider):
+    # The priority offset for sched_wak* events was fixed in
+    # lttng-modules 2.7.1 upwards
+    PRIO_OFFSET_FIX_VERSION = version_utils.Version(2,7,1)
+
     def __init__(self, state):
         cbs = {
             'sched_switch': self._process_sched_switch,
@@ -136,6 +141,9 @@ class SchedStateProvider(sp.StateProvider):
         prio = event['prio']
         tid = event['tid']
 
+        if self._state.tracer_version < self.PRIO_OFFSET_FIX_VERSION:
+            prio -= 100
+
         if target_cpu not in self._state.cpus:
             self._state.cpus[target_cpu] = sv.CPU(target_cpu)
 
This page took 0.028673 seconds and 5 git commands to generate.