summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-06-02 08:25:09 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-06-03 16:50:15 -0300
commit70b3c4f734bbfd5664cd6e4eb007c108bf2b1c43 (patch)
treeb089b50670672f581cda22ad07e186a473ae233c
parent5d57371b9cd2a40e04df0104b62a4c302555d076 (diff)
perf c2c: Use perf_env e_machine rather than arch
Use the e_machine rather than arch string matching for AARCH64. Add include of dwarf-regs.h in case the EM_AARCH64 isn't defined, sort the headers given this include. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Honglei Wang <jameshongleiwang@126.com> Cc: Jan Polensky <japo@linux.ibm.com> Cc: Sumanth Korikkar <sumanthk@linux.ibm.com> Cc: Thomas Richter <tmricht@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-c2c.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index d3503be9350c..3dd45a550fdb 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -12,41 +12,45 @@
*/
#include <errno.h>
#include <inttypes.h>
+
+#include <asm/bug.h>
#include <linux/compiler.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
#include <linux/zalloc.h>
-#include <asm/bug.h>
#include <sys/param.h>
-#include "debug.h"
-#include "builtin.h"
+
+#include <dwarf-regs.h>
#include <perf/cpumap.h>
#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
-#include "map_symbol.h"
-#include "mem-events.h"
-#include "session.h"
-#include "hist.h"
-#include "sort.h"
-#include "tool.h"
+
+#include "builtin.h"
#include "cacheline.h"
#include "data.h"
+#include "debug.h"
#include "event.h"
#include "evlist.h"
#include "evsel.h"
-#include "ui/browsers/hists.h"
-#include "thread.h"
-#include "mem2node.h"
+#include "hist.h"
+#include "map_symbol.h"
+#include "mem-events.h"
#include "mem-info.h"
-#include "symbol.h"
-#include "ui/ui.h"
-#include "ui/progress.h"
+#include "mem2node.h"
#include "pmus.h"
+#include "session.h"
+#include "sort.h"
#include "string2.h"
-#include "util/util.h"
-#include "util/symbol.h"
+#include "symbol.h"
+#include "thread.h"
+#include "tool.h"
+#include "ui/browsers/hists.h"
+#include "ui/progress.h"
+#include "ui/ui.h"
#include "util/annotate.h"
+#include "util/symbol.h"
+#include "util/util.h"
struct c2c_hists {
struct hists hists;
@@ -3203,7 +3207,7 @@ static int perf_c2c__report(int argc, const char **argv)
* default display type.
*/
if (!display) {
- if (!strcmp(perf_env__arch(env), "arm64"))
+ if (perf_env__e_machine(env, /*e_flags=*/NULL) == EM_AARCH64)
display = "peer";
else
display = "tot";