diff --git a/external/bart/bart/sched/functions.py b/external/bart/bart/sched/functions.py index 9185f2ff121be31130e9d0e6dfee4cde19524eb1..ac7c0b2662c3b1222422cc29cd65421d844efbde 100644 --- a/external/bart/bart/sched/functions.py +++ b/external/bart/bart/sched/functions.py @@ -139,6 +139,25 @@ def sanitize_asymmetry(series, window=None): if window: series.index.values[-1] = window[1] + # Remove repeated entries - which could happen if a task switch in + # then immediately switches out; ie: time stamp is exactly the same + n = 0 + next = n + 1 + while next < len(series): + if not series.values[n]: + n = next + next = next + 1 + continue + + while not series.values[next]: + next = next + 1 + + if series.values[n] == series.values[next]: + series = series.drop(series.index[next]) + else: + n = next + next = next + 1 + # No point if the series just has one value and # one event. We do not have sufficient data points # for any calculation. We should Ideally never reach diff --git a/lisa/tests/scheduler/eas_behaviour.py b/lisa/tests/scheduler/eas_behaviour.py index abf0c18da73aa5742e82aa2e159227d4d642f2ee..aea76096b4c74a84dd512812b82515f1b293ecf2 100644 --- a/lisa/tests/scheduler/eas_behaviour.py +++ b/lisa/tests/scheduler/eas_behaviour.py @@ -139,6 +139,7 @@ class EASBehaviour(RTATestBundle): df = self.trace.ftrace.sched_switch.data_frame[['next_comm', '__cpu']] df = df[df['next_comm'].isin(tasks)] + df = df[~df.index.duplicated()] df = df.pivot(index=df.index, columns='next_comm').fillna(method='ffill') cpu_df = df['__cpu'] # Drop consecutive duplicates