From: Leo Yan <leo.yan@arm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Alice Rogers <alice.mei.rogers@gmail.com>,
Aishwarya TCV <aishwarya.tcv@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Leo Yan <leo.yan@arm.com>
Subject: [PATCH 2/2] perf timechart: Initialize Textual attributes in constructors
Date: Fri, 23 Oct 2026 14:20:25 +0100 [thread overview]
Message-ID: <20261023-perf_fix_pylint_warning-v1-2-b9da8dae2fe9@arm.com> (raw)
In-Reply-To: <20261023-perf_fix_pylint_warning-v1-0-b9da8dae2fe9@arm.com>
When Textual is unavailable, pylint cannot resolve the inherited
virtual_size and sub_title attributes, which triggers pylint warnings
and caused arm64 cross build failure:
************* Module ttimechart
python/ttimechart.py:1086:8: W0201: Attribute 'virtual_size' defined outside __init__ (attribute-defined-outside-init)
python/ttimechart.py:1422:12: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/ttimechart.py:1496:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/ttimechart.py:1510:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
Initialize both attributes in their respective constructors. Use
Textual's default empty virtual size, with the actual geometry
computed when the timeline mounts or resizes.
Fixes: e7a72d691980 ("perf timechart: Add an interactive --tui mode")
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/perf/python/ttimechart.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/python/ttimechart.py b/tools/perf/python/ttimechart.py
index 34ecf84e68c1db7f542070dde608ac09d662a1b2..16d2bbbdd98b23d64ab42643db42686cad98f0f0 100755
--- a/tools/perf/python/ttimechart.py
+++ b/tools/perf/python/ttimechart.py
@@ -1065,6 +1065,7 @@ class TimelineView(ScrollView):
self.can_focus = True
self.data = data
self.rows = rows
+ self.virtual_size = Size(0, 0)
self.cache: Dict[int, List[Cell]] = {}
self.cache_key: Tuple[float, float, int, Optional[ThemeColors]] = (0.0, 0.0, 0, None)
self.label_style = Style()
@@ -1332,6 +1333,7 @@ class TimechartApp(App):
"""
super().__init__()
self.input_name = input_name
+ self.sub_title = input_name
self.power_only = power_only
self.tasks_only = tasks_only
self.filters = filters
--
2.34.1
next prev parent reply other threads:[~2026-10-23 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 13:20 [PATCH 0/2] perf python: Fix pylint warnings without Textual Leo Yan
2026-10-23 13:20 ` [PATCH 1/2] perf treport: Initialize the subtitle in the constructor Leo Yan
2026-10-23 13:20 ` Leo Yan [this message]
2026-11-04 21:16 ` [PATCH 0/2] perf python: Fix pylint warnings without Textual Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261023-perf_fix_pylint_warning-v1-2-b9da8dae2fe9@arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=aishwarya.tcv@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alice.mei.rogers@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®