编译perf
admin
2024-03-13 02:08:46

参考:perf编译和使用_aalace的博客-CSDN博客_perf编译

1. perf工具的源码已经嵌入到linux的tools目录下

2.进入到tools目录下 执行

make ARCH=arm CROSS_COMPILE=/usr/local/gcc-linaro_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- perf LDFLAGS+=--static NO_LIBELF=1 V=1 WERROR=0 NO_SLANG=1 NO_GTK2=1 NO_LIBAUDIT=1 NO_LIBNUMA=1 NO_LIBPERL=1 NO_STRLCPY=1

编译arm64,linux 5.4

改了这个:

-#include
+//#include

换个旧的编译器才编译成功

再改这个:

@@ -129,11 +129,8 @@ DYNAMIC_LIST_FILE := $(OUTPUT)libtraceevent-dynamic-list
 PLUGINS  = plugin_jbd2.so
 PLUGINS += plugin_hrtimer.so
 PLUGINS += plugin_kmem.so
-PLUGINS += plugin_kvm.so
 PLUGINS += plugin_mac80211.so
 PLUGINS += plugin_sched_switch.so
-PLUGINS += plugin_function.so
-PLUGINS += plugin_xen.so
 PLUGINS += plugin_scsi.so
 PLUGINS += plugin_cfg80211.so

才能 LDFLAGS+=--static

cat perf/Makefile.perf | grep Define
# Define V to have a more verbose compile.
# Define VF to have a more verbose feature check output.
# Define O to save output files in a separate directory.
# Define ARCH as name of target architecture if you want cross-builds.
# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
# Define NO_LIBPERL to disable perl script extension.
# Define NO_LIBPYTHON to disable python script extension.
# Define PYTHON to point to the python binary if the default
# Define PYTHON_CONFIG to point to the python-config binary if
# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
# Define LDFLAGS=-static to build a static binary.
# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
# Define EXCLUDE_EXTLIBS=-lmylib to exclude libmylib from the auto-generated
# Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS.
# Define NO_DWARF if you do not want debug-info analysis feature at all.
# Define WERROR=0 to disable treating any warnings as errors.
# Define NO_NEWT if you do not want TUI support. (deprecated)
# Define NO_SLANG if you do not want TUI support.
# Define NO_GTK2 if you do not want GTK+ GUI support.
# Define NO_DEMANGLE if you do not want C++ symbol demangling.
# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
# Define NO_BACKTRACE if you do not want stack backtrace debug feature
# Define NO_LIBNUMA if you do not want numa perf benchmark
# Define NO_LIBAUDIT if you do not want libaudit support
# Define NO_LIBBIONIC if you do not want bionic support
# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support
# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
# Define NO_PERF_READ_VDSO32 if you do not want to build perf-read-vdso32
# Define NO_PERF_READ_VDSOX32 if you do not want to build perf-read-vdsox32
# Define NO_ZLIB if you do not want to support compressed kernel modules
# Define NO_LIBBABELTRACE if you do not want libbabeltrace support
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
# Define NO_AUXTRACE if you do not want AUX area tracing support
# Define NO_LIBBPF if you do not want BPF support
# Define NO_SDT if you do not want to define SDT event in perf tools,
# Define FEATURES_DUMP to provide features detection dump file
# Define NO_JVMTI if you do not want jvmti agent built
# Define LIBCLANGLLVM if you DO want builtin clang and llvm support.
# Define NO_CORESIGHT if you do not want support for CoreSight trace decoding.

相关内容

热门资讯

山水皆有情!丽江两山一江的千年... 去过丽江、走过虎跳峡的人,大概率都听过哈巴雪山和金沙江的传说。很多人站在峡谷之下,望着奔腾不息的金沙...
活力中国调研行丨“殷”你而来 ... 9月12日,游客在殷墟博物馆“甲骨文展厅”内参观。位于河南省安阳市的殷墟博物馆新馆是首个全景式展现商...
浦江之夜赴美好相逢,第37届上... 9月12日晚,黄浦江畔灯火璀璨,第37届上海旅游节大巡游在外滩中山东一路上演。不少观众早早便来到外滩...
美丽中国丨秋韵紫鹊界 梯田入画... 这是9月11日拍摄的紫鹊界梯田(无人机照片)。 金秋九月,湖南省娄底市新化县紫鹊界梯田稻谷渐次成熟。...
中国之巅奏响《共同的节日》,千... 千吨阻尼器,“迎世赛、游上海旅游节”。9月13日,由上海市文化和旅游局指导推出上海旅游·会客│巅峰之...