perf annotate: Use libcapstone to disassemble
authorNamhyung Kim <namhyung@kernel.org>
Fri, 29 Mar 2024 21:58:11 +0000 (14:58 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Apr 2024 14:48:57 +0000 (11:48 -0300)
commit6d17edc113de1e21fc66afa76be475a4f7c91826
tree2eeb2e8b94fafde549e35c0a13c220292150611d
parent98f69a573c668a18cfda41b3976118e04521a196
perf annotate: Use libcapstone to disassemble

Now it can use the capstone library to disassemble the instructions.
Let's use that (if available) for perf annotate to speed up.  Currently
it only supports x86 architecture.  With this change I can see ~3x speed
up in data type profiling.

But note that capstone cannot give the source file and line number info.
For now, users should use the external objdump for that by specifying
the --objdump option explicitly.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240329215812.537846-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/disasm.c