无法在perf命令中使用--exclude-perf选项

时间:2017-04-18 16:50:22

标签: performance-testing perf

我正在尝试使用perf对应用程序进行基准测试。该应用程序是基于c ++的,我想评估

L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,cycles,instructions,cache-references,cache-misses,bus-cycles,branch-misses

我想避免在输出中看到perf事件,以使其更易于阅读。尝试运行以下命令来捕获输出:

perf record -g -e "L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,cycles,instructions,cache-references,cache-misses,bus-cycles,branch-misses" --exclude-perf Binary-name

但上面提到的命令失败并出现以下错误:

--exclude-perf option should follow a -e tracepoint option

 Usage: perf record [options] [command]

 or: perf record [options] -- command [options]

 --exclude-perf    don't record events from perf itself

如果我不使用--exclude-perf选项,那么我的命令运行正常,没有任何错误。

让我知道在添加选项--exclude-perf

时我正在犯的错误

1 个答案:

答案 0 :(得分:0)

--exclude-perf不适用于您使用的采样/分析事件(硬件CPU计数器)。它仅适用于跟踪点事件: http://lxr.free-electrons.com/source/tools/perf/Documentation/perf-record.txt

151 --exclude-perf::
152         Don't record events issued by perf itself. This option should follow
153         a event selector (-e) which selects tracepoint event(s). It adds a
154         filter expression 'common_pid != $PERFPID' to filters. If other
155         '--filter' exists, the new filter expression will be combined with
156         them by '&&'.

它使用过滤器和过滤器附加到跟踪点事件。