diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 59f38c7693f8648b7ce494edc864f09a0f6b09d5..4c23779e271a31ce66d0deeb527a658e0ae90ae7 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -166,7 +166,7 @@ const char *perf_env__arch(struct perf_env *env)
 	struct utsname uts;
 	char *arch_name;
 
-	if (!env) { /* Assume local operation */
+	if (!env || !env->arch) { /* Assume local operation */
 		if (uname(&uts) < 0)
 			return NULL;
 		arch_name = uts.machine;