1.perf工具的源码已经嵌入到linux的tools目录下,我使用的是linux-4.4.39-cgel
(1)进入到tools目录下 执行:
make ARCH=arm64 CROSS_COMPILE=/aarch64_eabi_gcc6.2.0_glibc2.24.0_fp/bin/aarch64-unknown-linux-gnueabi- 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
CROSS_COMPILE=/aarch64_eabi_gcc6.2.0_glibc2.24.0_fp/bin/aarch64-unknown-linux-gnueabi- 指定交叉编译器
perf 进入perf目录编译
LDFLAGS+=–static 静态编译
(2) 环境会出现 flex is missing cant find on the system 错误
通过 yum /apt-get install flex 安装即可
(3)make clean后再次使用上述命令 编译 可成功
[root@localhost tools]# find ./ -name perf
./perf
./perf/perf
./build/tools/perf
[root@localhost tools]#