mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 21:12:43 +00:00
Capstone disassembly support was split between disasm.c and print_insn.c. Move support out of these files into capstone.[ch] and remove include capstone/capstone.h from those files. As disassembly routines can fail, make failure the only option without HAVE_LIBCAPSTONE_SUPPORT. For simplicity's sake, duplicate the read_symbol utility function. The intent with moving capstone support into a single file is that dynamic support, using dlopen for libcapstone, can be added in later patches. This can potentially always succeed or fail, so relying on ifdefs isn't sufficient. Using dlopen is a useful option to minimize the perf tools dependencies and potentially size. Signed-off-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexandre Ghiti <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Bill Wendling <[email protected]> Cc: Charlie Jenkins <[email protected]> Cc: Collin Funk <[email protected]> Cc: Dmitriy Vyukov <[email protected]> Cc: Dr. David Alan Gilbert <[email protected]> Cc: Eric Biggers <[email protected]> Cc: Haibo Xu <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Justin Stitt <[email protected]> Cc: Li Huafei <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Stephen Brennan <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
25 lines
739 B
C
25 lines
739 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __PERF_CAPSTONE_H
|
|
#define __PERF_CAPSTONE_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <linux/types.h>
|
|
|
|
struct annotate_args;
|
|
struct machine;
|
|
struct symbol;
|
|
struct thread;
|
|
|
|
ssize_t capstone__fprintf_insn_asm(struct machine *machine, struct thread *thread, u8 cpumode,
|
|
bool is64bit, const uint8_t *code, size_t code_size,
|
|
uint64_t ip, int *lenp, int print_opts, FILE *fp);
|
|
int symbol__disassemble_capstone(const char *filename, struct symbol *sym,
|
|
struct annotate_args *args);
|
|
int symbol__disassemble_capstone_powerpc(const char *filename, struct symbol *sym,
|
|
struct annotate_args *args);
|
|
|
|
#endif /* __PERF_CAPSTONE_H */
|