[PATCH] perf script: Fix build by removing unused evsel_script()

James Clark posted 1 patch 2 months, 3 weeks ago
tools/perf/builtin-script.c | 5 -----
1 file changed, 5 deletions(-)
[PATCH] perf script: Fix build by removing unused evsel_script()
Posted by James Clark 2 months, 3 weeks ago
The evsel_script() function is unused since the linked commit. Fix the
build by removing it.

Fixes the following compilation error:

  builtin-script.c:347:36: error: unused function 'evsel_script' [-Werror,-Wunused-function]
  static inline struct evsel_script *evsel_script(struct evsel *evsel)
                                     ^
Fixes: 3622990efaab ("perf script: Change metric format to use json metrics")
Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index cf0040bbaba9..581fb101e8be 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -344,11 +344,6 @@ struct evsel_script {
        u64  samples;
 };
 
-static inline struct evsel_script *evsel_script(struct evsel *evsel)
-{
-	return (struct evsel_script *)evsel->priv;
-}
-
 static struct evsel_script *evsel_script__new(struct evsel *evsel, struct perf_data *data)
 {
 	struct evsel_script *es = zalloc(sizeof(*es));
-- 
2.34.1
Re: [PATCH] perf script: Fix build by removing unused evsel_script()
Posted by Namhyung Kim 2 months, 3 weeks ago
On Fri, 14 Nov 2025 14:06:18 +0000, James Clark wrote:
> The evsel_script() function is unused since the linked commit. Fix the
> build by removing it.
> 
> Fixes the following compilation error:
> 
>   static inline struct evsel_script *evsel_script(struct evsel *evsel)
>                                      ^
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung
Re: [PATCH] perf script: Fix build by removing unused evsel_script()
Posted by Ian Rogers 2 months, 3 weeks ago
On Fri, Nov 14, 2025 at 6:08 AM James Clark <james.clark@linaro.org> wrote:
>
> The evsel_script() function is unused since the linked commit. Fix the
> build by removing it.
>
> Fixes the following compilation error:
>
>   builtin-script.c:347:36: error: unused function 'evsel_script' [-Werror,-Wunused-function]
>   static inline struct evsel_script *evsel_script(struct evsel *evsel)
>                                      ^
> Fixes: 3622990efaab ("perf script: Change metric format to use json metrics")
> Signed-off-by: James Clark <james.clark@linaro.org>

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

I saw this on clang builds, but didn't get time to dig in. I'm
wondering why GCC wasn't complaining. Anyway.

Thanks,
Ian

> ---
>  tools/perf/builtin-script.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index cf0040bbaba9..581fb101e8be 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -344,11 +344,6 @@ struct evsel_script {
>         u64  samples;
>  };
>
> -static inline struct evsel_script *evsel_script(struct evsel *evsel)
> -{
> -       return (struct evsel_script *)evsel->priv;
> -}
> -
>  static struct evsel_script *evsel_script__new(struct evsel *evsel, struct perf_data *data)
>  {
>         struct evsel_script *es = zalloc(sizeof(*es));
> --
> 2.34.1
>