Skip to content

ftrace: fix windowing KeyErrors

Darryl Green requested to merge github/fork/derkling/fix_windowing_slicing into master

Created by: derkling

For some traces and events (e.g. SchedSwitch) we get a KeyError in case the first event index is bigger then window[0]. For example:

trace_class: <trappy.sched.SchedSwitch object at 0x7f3afe425f10> window: [11793.005501, None] __comm __cpu __line __pid next_comm next_pid [...] Time 11793.005507 <...> 0 2 6803 shell svc 6799 6800 [...] 11793.005565 <...> 0 4 6800 adbd 2648 [...] 11793.005701 adbd 0 7 2648 ->transport 2650 [...] 11793.005782 ->transport 0 11 2650 trace-cmd 6803 [...] 11793.005831 <...> 0 17 6803 kworker/u17:0 367 [...]

[...]

KeyError: 11793.005501

Where the min window value [11793.005501] is defined by the first valid event in the trace. Oddly this does not always happens, expecially it seems to not happen with trappy.dynamic events.

However, since in these cases the dataframe should not be sliced at all, let's add some boundary checks to ensure we always provide "valid" slicing index values. This has been verified to fix the above slicing issue in some test traces.

Signed-off-by: Patrick Bellasi patrick.bellasi@arm.com

Merge request reports