Skip to contentSkip to conversation

perf script: Fix build by removing unused evsel_script()

PATCH Applied James Clark 3 participants 3 messages Nov 14, 2025 – Nov 18, 2025 perf events

lore
Share & tools
lore

James Clark

author reviewer
#0 lore raw

PATCH 1/1 perf script: Fix build by removing unused evsel_script()

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")
---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/builtin-script.c +0 -5
index cf0040bbaba9..581fb101e8be 100644
@@ -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));
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · James Clark

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

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

Quoted 23 lines
---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/builtin-script.c +0 -6
index cf0040bbaba9..581fb101e8be 100644
@@ -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

maintainer Applied
#2 lore raw
In reply to James Clark
Quoted 9 lines · James Clark

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