Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf annotate: Use capstone_init and remove open_capstone_handle from disasm.c

capstone_init is made availbale for all archs to use and updated to
enable support for CS_ARCH_PPC as well. Patch removes
open_capstone_handle and uses capstone_init in all the places.

Committer notes:

Avoid including capstone/capstone.h from print_insn.h to not break the
build in builtin-script.c due to the namespace clash with libbpf:

/usr/include/capstone/bpf.h:94:14: error: 'bpf_insn' defined as wrong kind of tag

Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Akanksha J N <akanksha@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Link: https://lore.kernel.org/lkml/20240718084358.72242-14-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Athira Rajeev and committed by
Arnaldo Carvalho de Melo
f1e9347c 1fe86bc2

+4 -5
+2
tools/perf/util/disasm.c
··· 1512 1512 #ifdef HAVE_LIBCAPSTONE_SUPPORT 1513 1513 #include <capstone/capstone.h> 1514 1514 1515 + int capstone_init(struct machine *machine, csh *cs_handle, bool is64, bool disassembler_style); 1516 + 1515 1517 static int open_capstone_handle(struct annotate_args *args, bool is_64bit, 1516 1518 csh *handle) 1517 1519 {
+2
tools/perf/util/print_insn.c
··· 32 32 #ifdef HAVE_LIBCAPSTONE_SUPPORT 33 33 #include <capstone/capstone.h> 34 34 35 + int capstone_init(struct machine *machine, csh *cs_handle, bool is64, bool disassembler_style); 36 + 35 37 int capstone_init(struct machine *machine, csh *cs_handle, bool is64, bool disassembler_style) 36 38 { 37 39 cs_arch arch;
-5
tools/perf/util/print_insn.h
··· 19 19 bool is64bit, const uint8_t *code, size_t code_size, 20 20 uint64_t ip, int *lenp, int print_opts, FILE *fp); 21 21 22 - #ifdef HAVE_LIBCAPSTONE_SUPPORT 23 - #include <capstone/capstone.h> 24 - int capstone_init(struct machine *machine, csh *cs_handle, bool is64, bool disassembler_style); 25 - #endif 26 - 27 22 #endif /* PERF_PRINT_INSN_H */