1. 静态编译kernel perf tool:
cd tools/perf
make CROSS_COMPILE=xxxx LDFLAGS=-static ARCH=arm64
2. 打开perf trace的方法:
a.打开perf.c
b. 检查 “commands[]” 结构体,有些命令被宏开关控制。 例如打开trace功能,
make CROSS_COMPILE=xxxx LDFLAGS=-static HAVE_LIBAUDIT_SUPPORT=1 HAVE_SYSCALL_TABLE_SUPPORT=1 ARCH=arm64
结果是:
```bash
/data # ./perf_4.19_static.static help | grep trace
ftrace simple wrapper for kernel's ftrace functionality
kmem Tool to trace/measure kernel memory properties
kvm Tool to trace/measure kvm guest os
sched Tool to trace/measure scheduler properties (latencies)
script Read perf.data (created by perf record) and display trace output
trace strace inspired tool