From 4fe12887b3d51ad1ab1dbed5b1cddeaa0547aa96 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Tue, 18 Mar 2025 11:27:34 +0000 Subject: [PATCH] lisa.analysis.base: Fix TraceAnalysisBase.cache() FIX Cache based on the class of the instance the methods end up being bound to, so that the methods are allowed to depend on constant class attributes in their internals Without that fix, a decorated method like PixelAnalysis.df_power_meter() that relies on the EMETER_CHAN_NAMES class attribute and no parameter end up caching the result for the first call, and subsequent calls will not take into account the fact they are called on a Pixel6Analysis object or a Pixel9Analysis. --- lisa/analysis/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisa/analysis/base.py b/lisa/analysis/base.py index a6e2c87d7..4edd5f8c9 100644 --- a/lisa/analysis/base.py +++ b/lisa/analysis/base.py @@ -1271,6 +1271,10 @@ class TraceAnalysisBase(AnalysisHelpers): trace = self.trace spec = dict( + bound_class=( + self.__class__.__module__, + self.__class__.__qualname__, + ), module=f.__module__, func=f.__qualname__, # Include the trace window in the spec since that influences -- GitLab