linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/5] Support dynamic opening of capstone and libLLVM
@ 2025-01-20 17:32 Ian Rogers
  2025-01-20 17:32 ` [PATCH v1 1/5] perf capstone: Move capstone functionality into its own file Ian Rogers
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ian Rogers @ 2025-01-20 17:32 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Kan Liang, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt,
	Steinar H. Gunderson, Charlie Jenkins, Changbin Du,
	Masami Hiramatsu (Google), James Clark, Kajol Jain, Athira Rajeev,
	Li Huafei, Dmitry Vyukov, Andi Kleen, linux-kernel,
	linux-perf-users, llvm

Linking against libcapstone and libLLVM can be a significant increase
in dependencies and size of memory footprint. For something like `perf
record` the disassembler and addr2line functionality won't be
used. Support dynamically loading these libraries using dlopen and
then calling the appropriate functions found using dlsym.

The patch series:
1) moves the capstone and LLVM code to their own C files,
2) simplifies a little the capstone code,
3) adds perf_ variants of the functions that will either directly call
   the function or use dlsym to discover it.

The addr2line LLVM functionality is written in C++. To avoid linking
against libLLVM for this, a new LIBLLVM_DYNAMIC option is added where
the C++ code with the libLLVM dependency will be built into a
libperf-llvm.so and that dlsym-ed and called against.

Ian Rogers (5):
  perf capstone: Move capstone functionality into its own file
  perf llvm: Move llvm functionality into its own file
  perf capstone: Remove open_capstone_handle
  perf capstone: Support for dlopen-ing libcapstone.so
  perf llvm: Support for dlopen-ing libLLVM.so

 tools/perf/Makefile.config         |  13 +
 tools/perf/Makefile.perf           |  23 +-
 tools/perf/builtin-script.c        |   2 -
 tools/perf/tests/make              |   2 +
 tools/perf/util/Build              |   4 +-
 tools/perf/util/capstone.c         | 723 +++++++++++++++++++++++++++++
 tools/perf/util/capstone.h         |  24 +
 tools/perf/util/disasm.c           | 612 +-----------------------
 tools/perf/util/disasm.h           |   2 +
 tools/perf/util/llvm-c-helpers.cpp | 113 ++++-
 tools/perf/util/llvm.c             | 537 +++++++++++++++++++++
 tools/perf/util/llvm.h             |  24 +
 tools/perf/util/print_insn.c       | 117 +----
 tools/perf/util/srcline.c          |  65 +--
 tools/perf/util/srcline.h          |   6 +
 15 files changed, 1481 insertions(+), 786 deletions(-)
 create mode 100644 tools/perf/util/capstone.c
 create mode 100644 tools/perf/util/capstone.h
 create mode 100644 tools/perf/util/llvm.c
 create mode 100644 tools/perf/util/llvm.h

-- 
2.48.0.rc2.279.g1de40edade-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-24 21:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 17:32 [PATCH v1 0/5] Support dynamic opening of capstone and libLLVM Ian Rogers
2025-01-20 17:32 ` [PATCH v1 1/5] perf capstone: Move capstone functionality into its own file Ian Rogers
2025-01-20 17:32 ` [PATCH v1 2/5] perf llvm: Move llvm " Ian Rogers
2025-01-20 17:32 ` [PATCH v1 3/5] perf capstone: Remove open_capstone_handle Ian Rogers
2025-01-20 17:32 ` [PATCH v1 4/5] perf capstone: Support for dlopen-ing libcapstone.so Ian Rogers
2025-01-22 22:27   ` Namhyung Kim
2025-01-22 22:42     ` Ian Rogers
2025-01-23 16:07       ` Ian Rogers
2025-01-23 21:37         ` Ian Rogers
2025-01-24 21:31           ` Namhyung Kim
2025-01-20 17:32 ` [PATCH v1 5/5] perf llvm: Support for dlopen-ing libLLVM.so Ian Rogers
2025-01-20 18:01 ` [PATCH v1 0/5] Support dynamic opening of capstone and libLLVM Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).