From: Ian Rogers Date: Tue, 2 Jun 2026 15:25:12 +0000 (-0700) Subject: perf env: Remove unused perf_env__raw_arch X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=da976dd4842981fa9fe8bf736ec3d440fa9ce029;p=thirdparty%2Fkernel%2Flinux.git perf env: Remove unused perf_env__raw_arch The switch to using e_machine has made the perf_env__raw_arch function unused so remove it. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Gordeev Cc: Heiko Carstens Cc: Honglei Wang Cc: Jan Polensky Cc: Sumanth Korikkar Cc: Thomas Richter Cc: Vasily Gorbik Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index b41562fb06c63..28c54c58193e4 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -470,19 +470,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) @@ -601,11 +588,6 @@ error: 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 5a917271ca0d8..83e74328798f1 100644 --- a/tools/perf/util/env.h +++ b/tools/perf/util/env.h @@ -190,7 +190,6 @@ uint16_t perf_env__e_machine(struct perf_env *env, uint32_t *e_flags); const char *perf_env__arch(struct perf_env *env); const char *perf_env__arch_strerrno(uint16_t e_machine, int err); 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);