配置内核支持PERF
make menuconfig
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y这两项不知道在 menuconfig中怎么找,但是可以在make menuconfg保存退出后,vi到.config中查找配置。
General setup->
Kernel Performance Events And Counters --->
[*] Kernel performance events and counters
[ ] Kernel performance counters (old config option)
[ ] Debug: use vmalloc to back perf mmap() buffers
配置此项即为配置.config中如下两项
CONFIG_PERF_EVENTS=yCONFIG_PERF_COUNTERS=y
.config 中相关的配置如下
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y
#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_PERF_COUNTERS is not set
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y