我想跟踪系统范围的跟踪点。Perf 列表告诉我以下跟踪点可用:
block:block_io_start [Tracepoint event]
block:block_plug [Tracepoint event]
block:block_rq_complete [Tracepoint event]
block:block_rq_error [Tracepoint event]
block:block_rq_insert [Tracepoint event]
...
power:cpu_frequency [Tracepoint event]
power:cpu_frequency_limits [Tracepoint event]
power:cpu_idle [Tracepoint event]
power:cpu_idle_miss [Tracepoint event]
我知道我应该用
perf record -e TRACEPOINT -a
用于系统范围的跟踪。但是,我被告知跟踪点是unsupported tracepoint
:
perf record -e block:block_io_start -a
event syntax error: 'block:block_io_start'
\___ unsupported tracepoint
libtraceevent is necessary for tracepoint support
Run 'perf list' for a list of valid events
我安装了所有libtraceevent*
软件包。我的内核是:
6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
您可能需要重建 perf 以支持 libtraceevent。根据您的系统,该过程可能包括安装 linux-source 包和可能的 build-essential,当然还有 libtraceevent-dev。然后
cd /usr/src/linux-source-…/tools/perf && make
很难追踪为什么 perf 构建时没有使用 libtraceevent,但 bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2019247有一些提示,https ://bugs.launchpad.net/ubuntu/+source/linux/+bug/2076190也有提示。
我热切地等待将 libtraceevent 重新引入 Ubuntu Noble 中的 perf,参考最后一个错误。