[PATCH v9 15/18] perf env: Remove unused perf_env__raw_arch

Ian Rogers
2026-05-03T00:23:23Z

The switch to using e_machine has made the perf_env__raw_arch function
unused so remove it.

Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/env.c | 18 ------------------
tools/perf/util/env.h | 1 -
2 files changed, 19 deletions(-)

diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 8ac7aff0b27c..29d5fe37528b 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -463,19 +463,6 @@ int perf_env__read_cpuid(struct perf_env *env)
return 0;
}

-static int perf_env__read_arch(struct perf_env *env)
-{
- struct utsname uts;
-
- if (env->arch)
- return 0;
-
- if (!uname(&uts))
- env->arch = strdup(uts.machine);
-
- return env->arch ? 0 : -ENOMEM;
-}
-
static int perf_env__read_nr_cpus_avail(struct perf_env *env)
{
if (env->nr_cpus_avail == 0)
@@ -594,11 +581,6 @@ int perf_env__read_core_pmu_caps(struct perf_env *env)
return ret;
}

-const char *perf_env__raw_arch(struct perf_env *env)
-{
- return env && !perf_env__read_arch(env) ? env->arch : "unknown";
-}
-
int perf_env__nr_cpus_avail(struct perf_env *env)
{
return env && !perf_env__read_nr_cpus_avail(env) ? env->nr_cpus_avail : 0;
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index ba51b871c401..bc4801d8399b 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -192,7 +192,6 @@ const char *perf_env__arch(struct perf_env *env);
const char *perf_env__arch_strerrno(uint16_t e_machine, int err);
#endif
const char *perf_env__cpuid(struct perf_env *env);
-const char *perf_env__raw_arch(struct perf_env *env);
int perf_env__nr_cpus_avail(struct perf_env *env);

void perf_env__init(struct perf_env *env);
--
2.54.0.545.g6539524ca2-goog