编译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.

相关内容

热门资讯

摸鱼、钓虾、吃瓜、赏荷…初夏时... 这个周末,一场场充满野趣的“田园嘉年华”在沪郊金山多个农场上演,吸引众多市民带着孩子下乡来,赛跑、吃...
原创 戚... 5月28日,北京环球影城迎来了一对温暖的家庭画面:戚薇和李承铉携三岁半的儿子Seven现身游玩。现场...
滹沱河畔 遇见“诗和远方” 图为市民在滹沱河畔休闲娱乐。 初夏五月,惠风和畅。徜徉在石家庄滹沱河生态区(城区段),澄澈河水蜿蜒...
在迪士尼排队两小时,我才看清V... 文丨沈理 在网上看到一则新闻: 上海迪士尼,创极速光轮排队区。一个父亲牵着七八岁的儿子,已经在烈日...
重庆文旅喊你去吃火锅、观山水、... 本网讯(草原云·正北方网记者 马丽侠)火锅、机车、文创、演艺……5月28日下午,重庆市文化和旅游发展...