android - 我如何解释 simpleperf stat 产生的指令计数,同一线程上的记录不相同?
问题描述
我是一名工程师,在 Android 平台上开发一些东西,因此使用 simpleperf 只是评估线程性能的正常方法。然而最近我陷入了两难境地,我想知道我应该使用哪些统计数据,让我们看看下面的例子:
环境:threadID:27473 运行一个while循环,在后台执行同样的事情
i) >>> simpleperf stat -e 指令 -t 27473 --duration 10 --use-devfreq-counters
Performance counter statistics:
# count event_name # count / runtime, runtime / enabled_time
421,117,470 instructions # 1.349 G/sec (61%)
Total test time: 10.001907 seconds.
simpleperf W cmd_stat.cpp:863] Percentages < 100% means some events only run a subset of enabled time,
probably caused by hardware counter multiplexing (less counters than events).
Try --use-devfreq-counters if on a rooted device.
ii) >>># simpleperf 记录 -g -t 27473 -e 指令 --duration 10 -o /sdcard/perf.data -f 4000 -m 8192
Event: instructions (type 0, config 1)
Samples: 1688
Event count: 570506200
Overhead Command Pid Tid
570506200 SomeThread 684 27473
我在这里有两个问题:
- 为什么在相同的持续时间(10 秒)内监视同一个线程最终会得到完全不同的指令计数,即 421M 与 570M ?哪一个是正确的?
- 我注意到第一种方法有61%的百分比,所以我尝试通过这个“NORMALIZE”数据,不知道我是否做得对:421M / 0.61 = 688M,仍然远不符合第二种方法570M,如何我可以校准这两个统计数据吗?
谢谢你救了我
解决方案
推荐阅读
- javascript - How to use drag and drop between panel to panel in extJS
- jenkins - trigger URL jenkins button rebuild from command line
- azure-data-factory - Azure data factory window function last non-null value
- sql - Select on rows with latest date in a table with no groups
- python - Send_keys to a textarea jsname in Python Selenium
- vue.js - Vue. How to pass a variable I have on server (process.env.SERVER) to the browser
- python - 查找数组 B 中与数组 A 中的元素最匹配的元素的索引
- python - pymodbus 如何通过真实的串行端口测试我的串行 RTU 服务器
- opengl - 给定一组点计算网格宽度
- react-native - 使用 expo 的 SecureStore 在 reducer 文件中返回 Promise 而不是 JWT 令牌