All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable
@ 2026-09-26 20:32 Arnaldo Carvalho de Melo
  2026-09-26 20:35 ` sashiko-bot
  2026-09-26 22:47 ` Ian Rogers
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-09-26 20:32 UTC (permalink / raw)
  To: linux-perf-users
  Cc: Adrian Hunter, Ian Rogers, James Clark, Jiri Olsa, Namhyung Kim

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable
  2026-09-26 20:32 [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable Arnaldo Carvalho de Melo
@ 2026-09-26 20:35 ` sashiko-bot
  2026-09-26 22:47 ` Ian Rogers
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-26 20:35 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users

> 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>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/argr21X4JoSl1O2W@x2?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable
  2026-09-26 20:32 [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable Arnaldo Carvalho de Melo
  2026-09-26 20:35 ` sashiko-bot
@ 2026-09-26 22:47 ` Ian Rogers
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2026-09-26 22:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-perf-users, Adrian Hunter, James Clark, Jiri Olsa,
	Namhyung Kim

On Sat, Sep 26, 2026 at 1:32 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> 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>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-26 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26 20:32 [PATCH 1/1] perf timechart: Remove the unused use_old_power_events variable Arnaldo Carvalho de Melo
2026-09-26 20:35 ` sashiko-bot
2026-09-26 22:47 ` Ian Rogers

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.