ARM-software / devlib

Library for interaction with and instrumentation of remote devices.
Apache License 2.0
47 stars 78 forks source link

ftrace: Avoid repeated available events query #625

Closed douglas-raillard-arm closed 1 year ago

douglas-raillard-arm commented 1 year ago

FtraceCollector.available_events is not memoized anymore as the set of events supported by the target can change dynamically (e.g. loading a kernel module).

This means that calling self.available_events is somewhat expensive, so avoid doing it in a loop. Instead, save the events in a variable and reuse it in the function to save a substantial amount of time.