From c2e229d996f6f7785c14c12d876ae66f029cd49b Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 15 Jul 2022 17:35:45 +0100 Subject: [PATCH 1/2] lisa.trace: Improve FtraceCollector docstring FEATURE Mention that FtraceCollector will attempt to build the kernel module if some events are missing and that it will require proper configuration to succeed. --- lisa/trace.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisa/trace.py b/lisa/trace.py index a239c0f36..e5e4751a4 100644 --- a/lisa/trace.py +++ b/lisa/trace.py @@ -5484,6 +5484,12 @@ class FtraceCollector(CollectorBase, Configurable): """ Thin wrapper around :class:`devlib.collector.ftrace.FtraceCollector`. + .. note:: Events are expected to be provided by the target's kernel, but if + they are not :class:`lisa._kmod.LISAFtraceDynamicKmod` will build a + kernel module to attempt to satisfy the missing events. This will + typically require correct target setup, see + :class:`lisa.target.TargetConf` ``kernel/src`` configurations. + {configurable_params} """ -- GitLab From 2a5eecfcf82ff11b39db80d5d6ea9ca5da361800 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 15 Jul 2022 17:38:00 +0100 Subject: [PATCH 2/2] lisa._kmod: Improve kernel tree preparation exception reporting FEATURE Include the CalledProcessError stderr when reporting the error, to make diagnostic easier since kernel tree prepare will usually fail unless the user provided a proper target configuration. --- lisa/_kmod.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisa/_kmod.py b/lisa/_kmod.py index ce4396046..5b0b7d7a4 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -1226,8 +1226,15 @@ class KernelTree(Loggable, SerializeViaConstructor): logger.debug(f'Loaded kernel tree using loader {loader.__name__}') else: + def format_excep(e): + # We expect stderr to be merged in stdout + if isinstance(e, subprocess.CalledProcessError) and e.stdout: + return f'{e}:\n{e.stdout}' + else: + return str(e) + excep_str = "\n".join( - f"{loader.__name__}: {e.__class__.__name__}: {e}" + f"{loader.__name__}: {e.__class__.__name__}: {format_excep(e)}" for loader, e in exceps ) raise ValueError(f'Could not load kernel trees:\n{excep_str}') -- GitLab