[PATCH 1/2] perf treport: Initialize the subtitle in the constructor

From: Leo Yan

Date: Fri Oct 23 2026 - 09:20:46 EST


For Arm64 cross build without Textual, assignments outside __init__()
trigger pylint warning:

************* Module treport
python/treport.py:625:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/treport.py:629:12: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/treport.py:668:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/treport.py:675:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)

------------------------------------------------------------------
Your code has been rated at 9.91/10 (previous run: 9.91/10, +0.00)

Move the initial subtitle assignment from on_mount() to
ReportApp.__init__() so pylint can see the attribute initialization
without resolving the Textual base class.

Fixes: b379b70b7b7b ("perf treport: Show the profile while it loads")
Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
---
tools/perf/python/treport.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/python/treport.py b/tools/perf/python/treport.py
index e021214753707780343e79dfc6964b9c69698197..f8c95ac1c6e067e8291eed59530f31c77886df68 100755
--- a/tools/perf/python/treport.py
+++ b/tools/perf/python/treport.py
@@ -602,6 +602,7 @@ class ReportApp(App):
"""
super().__init__()
self.input_file = input_file
+ self.sub_title = input_file
self.root = root if root else ProfileNode("root", parent=None)
self.loaded = root is not None
# Held when reading or changing the profile, which is built in a
@@ -622,7 +623,6 @@ class ReportApp(App):

def on_mount(self) -> None:
"""Start loading the profile unless it was given."""
- self.sub_title = self.input_file
if self.loaded:
self.update_views()
else:

--
2.34.1