mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 1/2] perf treport: Initialize the subtitle in the constructor
Date: Fri, 23 Oct 2026 14:20:24 +0100	[thread overview]
Message-ID: <20261023-perf_fix_pylint_warning-v1-1-b9da8dae2fe9@arm.com> (raw)
In-Reply-To: <20261023-perf_fix_pylint_warning-v1-0-b9da8dae2fe9@arm.com>

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@arm.com>
---
 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


  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 ` Leo Yan [this message]
2026-10-23 13:20 ` [PATCH 2/2] perf timechart: Initialize Textual attributes in constructors Leo Yan
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-1-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®