首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在perf命令中使用--exclude-perf选项

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

Stack Overflow用户
提问于 2017-04-19 00:50:22
回答 1查看 711关注 0票数 1

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

代码语言:javascript
复制
L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,cycles,instructions,cache-references,cache-misses,bus-cycles,branch-misses

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

代码语言:javascript
复制
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

但是上面提到的命令失败了,错误如下:

代码语言:javascript
复制
--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

EN

回答 1

Stack Overflow用户

发布于 2017-04-30 10:27:31

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

代码语言:javascript
复制
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 '&&'.

它使用过滤器,过滤器将被附加到跟踪点事件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43477926

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档