]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf annotate: Specify llvm features="+all" for aarch64
authorPeter Collingbourne <pcc@google.com>
Tue, 3 Mar 2026 23:00:54 +0000 (15:00 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 5 Mar 2026 02:05:18 +0000 (18:05 -0800)
This is consistent with what llvm-objdump does (see [1]) and allows
the LLVM disassembler to disassemble instructions not in the base
instruction set.

[1] https://reviews.llvm.org/D127741

Link: https://linux-review.googlesource.com/id/I52e4fef18d2e12b45f875231fa9d3efff2538fd4
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/llvm.c

index 0d126d233c0193252d0f38ad6ad1ba34fa59456d..a0deb742a73317f8fa9d60ee4ae174d740e1e437 100644 (file)
@@ -153,11 +153,17 @@ int symbol__disassemble_llvm(const char *filename, struct symbol *sym,
                                          /*get_op_info=*/NULL, symbol_lookup_callback);
        } else {
                char triplet[64];
+               const char *features = NULL;
 
                scnprintf(triplet, sizeof(triplet), "%s-linux-gnu",
                          args->arch->name);
-               disasm = LLVMCreateDisasm(triplet, &storage, /*tag_type=*/0,
-                                         /*get_op_info=*/NULL, symbol_lookup_callback);
+               if (args->arch->id.e_machine == EM_AARCH64)
+                       features = "+all";
+               disasm = LLVMCreateDisasmCPUFeatures(triplet, /*cpu=*/"",
+                                                    features, &storage,
+                                                    /*tag_type=*/0,
+                                                    /*get_op_info=*/NULL,
+                                                    symbol_lookup_callback);
        }
 
        if (disasm == NULL)