- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想在不同的研究限制下介绍一些程序。我使用 perf 工具来测量一些计数器。此分析将持续很长时间(数小时),并且 perf 工具会生成太多我不需要的数据。例如:
$ perf record -e cycles,instructions,cache-misses,cpu-clock,context-switches,cpu-migrations ./stress-ng --cpu 4 --cpu-ops 10000
stress-ng: info: [6642] defaulting to a 86400 second run per stressor
stress-ng: info: [6642] dispatching hogs: 4 cpu
stress-ng: info: [6642] successful run completed in 15.57s
[ perf record: Woken up 117 times to write data ]
[ perf record: Captured and wrote 29.971 MB perf.data (~1309444 samples) ]
大约是每秒 1.92 MB。 24 小时后,将达到 165 GB。当我使用 perf 报告工具时,我看到它还保留了我不需要的函数调用。如何让 perf-record 工作起来更轻量级,只记录我需要的数据?我只需要随着时间的推移分析以下数据,看看它们如何随着我对系统所做的一些更改而变化。考虑到它记录了很多数据,我将在24核机器上使用它使得数据非常大。迄今为止最好的选择是定期记录并分析 perf.data 以获得我想要的整数并将其删除,但我相信应该有更好的选择,因为我可能会错过该窗口中的一些分析数据。
Performance counter stats for './stress-ng --cpu 4 --cpu-ops 10000':
128.290.294.651 cycles
201.217.788.817 instructions # 1,57 insns per cycle
3.048.096 cache-misses
40340,258757 cpu-clock (msec)
123 context-switches
25 cpu-migrations
10,205760993 seconds time elapsed
最佳答案
简单的 perf stat
输出对你有好处吗?例如
$ perf stat -e cycles,instructions,cache-misses,cpu-clock,context-switches,cpu-migrations date
Sun Jan 24 18:46:10 EST 2016
Performance counter stats for 'date':
1,269,265 cycles
660,875 instructions # 0.52 insns per cycle
2,265 cache-misses
0.644391 cpu-clock (msec)
2 context-switches
1 cpu-migrations
0.001031207 seconds time elapsed
关于Linux Perf Counting Instructions, Cycles, Cache misses more lightweight over long time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34981955/
使用以下方法记录了一些统计数据: perf record -a -F 20 -o perf.data -e major-faults sleep 1800 并获得 perf.data ~ 1GiB,样
我在 ARM 板上的旧版本内核上运行 perf record。内核版本为3.18.21-rt19 板子上的perf版本同样是perf version 3.18.21。 虽然我可以在此性能上记录和使用报
与 perf (the Linux profiler) , (v4.15.18),我可以运行 perf stat $COMMAND 来获取命令的一些简单统计信息。如果我运行 perf record,它
尝试使用性能分析器。我已经安装了 linux 通用工具,但没有成功。这是我收到的消息: r@r-K55A:~$ perf WARNING: perf not found for kernel 3.16
perf stat -e 许多不同的事件通常会返回这样的输出 127.352.815.472 r53003c
假设我有一个线束二进制文件,它可以根据命令行选项产生不同的基准。我对采样这些基准非常感兴趣。 我有3个选择: 更改线束二进制文件以生成一个“性能记录”子进程,该子进程运行基准测试并进行采样 只需执行“
当我想使用 Linux 工具套件中的 perf-stat 和 perf-report 生成性能报告时 perf ,我跑: $ perf record -o my.perf.data myCmd $ p
我试图解释 perf-stat 在程序上运行的结果。我知道它是用 -r 30 和 -x 运行的。来自 https://perf.wiki.kernel.org/index.php/Tutorial是说
我使用 perf sched record 来记录一些东西。 我从 perf sched script 得到了一些context switch 事件 filebench 2646 [000] 211
当我从谷歌下载android源码4.3时,发现$AOSP/extenal/linux-tools-perf中已经存在perf源码。但是在我为模拟器编译项目之后,我没有在 system/bin 中找到'
我正在研究使用 Protractor 进行工具性能测试。我遇到了 browser-perf 和 protractor-perf。 protractor-perf 基于 browser-perf。 据我
我正在运行 kernel-5.0.9-200.fc29.x86_64(以及具有相同版本号的 perf 包)。 在下面的命令中,报告的 msec task-clock 远远大于 seconds user
我正在尝试使用 TraceCompass 以进一步调查我的系统跟踪。为此,您需要 CTF 格式,并且有两种可能的方法在 Linux 中获取它,afaik: 使用 LTTng 进行跟踪并使用 CTF 格
我正在使用 perf 分析一个玩具程序(选择排序),我想知道 perf 报告输出中的迭代对应什么。它显示的地址对应于内部循环和 if 语句。我希望有人能提供帮助。另外,当我将“-b --branch-
我遵循了现有 Stackoverflow 问题/答案提供的说明 Building Perf with Babeltrace (for Perf to CTF Conversion) 使用 Babelt
我正在浏览 linux 内核源代码中的 perf 源代码,以了解如何实现用户空间探测。我在很多地方都遇到过这种情况: zalloc(sizeof(struct __event_package) * n
我很清楚 perf 总是记录一个或多个事件,并且采样可以是基于计数器或基于时间的。但是当 -e 和 -F 开关没有给出时,perf record 的默认行为是什么? perf-record 的手册页没
运行时perf它找到了我的程序的内核符号和符号,但没有找到外部模块符号。我编写了一个内核模块,我使用 insmod 加载它我怎么知道perf也找到它的符号? 我正在运行 2.6.37.6 内核(无法升
我正在尝试学习如何在运行一些用 C 编写的基于 JNI 的共享库的 java 应用程序上使用 perf 动态跟踪。该库通过路径 /opt/myapp/lib/libmyapp.so 安装,然后使用选项
我用perf脚本命令查看perf.data文件的结果,但我不是很明白每一列的含义。例如,如果我有以下结果: perf 3198 [000] 13156.201238: bus-cycles: ff
我是一名优秀的程序员,十分优秀!