From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: linux-perf-users@vger.kernel.org
Cc: Adrian Hunter <adrian.hunter@intel.com>,
Ian Rogers <irogers@google.com>,
James Clark <james.clark@linaro.org>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>
Subject: [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable
Date: Sat, 26 Sep 2026 22:32:27 +0200 [thread overview]
Message-ID: <argr21X4JoSl1O2W@x2> (raw)
It is set once and never read: its only reader went away in
20c457b8587bee46 ("perf timechart: Adjust perf timechart to the new power
events") and nothing used it since, so the assignment was dead code for
13 years.
clang 23 extends -Wunused-but-set-variable to file-scope variables with
internal linkage, under the new -Wunused-but-set-global subgroup, and
with the -Werror that perf uses by default that turns the dead
assignment into a build error:
builtin-timechart.c:355:12: error: variable 'use_old_power_events' set but not used
[-Werror,-Wunused-but-set-global]
as seen building with clang 23.1.1 on Fedora 45 and rawhide, where gcc,
older clang and clang without -Werror all keep building it.
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-timechart.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 3f9153d5ecfb79b0..3d88c90c6573bf88 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -351,10 +351,6 @@ static int process_exit_event(const struct perf_tool *tool,
return 0;
}
-#ifdef SUPPORT_OLD_POWER_EVENTS
-static int use_old_power_events;
-#endif
-
static void c_state_start(int cpu, u64 timestamp, int state)
{
cpus_cstate_start_times[cpu] = timestamp;
@@ -1943,7 +1939,6 @@ static int timechart__record(struct timechart *tchart, int argc, const char **ar
#ifdef SUPPORT_OLD_POWER_EVENTS
if (!is_valid_tracepoint("power:cpu_idle") &&
is_valid_tracepoint("power:power_start")) {
- use_old_power_events = 1;
power_args_nr = 0;
} else {
old_power_args_nr = 0;
--
2.53.0
next reply other threads:[~2026-09-26 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 20:32 Arnaldo Carvalho de Melo [this message]
2026-09-26 20:35 ` [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable sashiko-bot
2026-09-26 22:47 ` Ian Rogers
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=argr21X4JoSl1O2W@x2 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.