【问题标题】:Simpleperf not recording any sampleSimpleperf 不记录任何样本
【发布时间】:2017-04-05 09:07:11
【问题描述】:

我正在尝试使用 Google 提供的 Simpleperf 工具在 Android 上分析本机代码。

我已经完成了他们示例中列出的每一步,将 security.perf_harden 设置为 0,检查我正在使用的设备(Nexus 9 平板电脑)的架构,最后在设备的 shell 中使用以下命令启动 Simpleperf :

./simpleperf record -p 10910 --duration 5

但结果,我得到了

simpleperf I 04-05 10:53:27 11773 11773 cmd_record.cpp:341] Samples recorded: 0. Samples lost: 0.

而且我似乎无法让 Simpleperf 记录任何样本。我使用-g 标志在调试中编译了我的本机库,我的Android 应用程序被标记为android:debuggable=true(尽管显然我可以省略它并仅在调试中构建)。在这一点上,我无法确定 Simpleperf 记录样本可能缺少什么。

如果我尝试一个简单的:

./simpleperf report

然后,这就是我最终的结果:

Cmdline: /data/data/com.my.app_package/simpleperf record -p 10910 --duration 5
Arch: arm64
Event: cpu-cycles (type 0, config 0)
Samples: 0
Event count: 0

Overhead  Command  Pid  Tid  Shared Object  Symbol

我在这里做错了什么或遗漏了什么?

【问题讨论】:

    标签: android android-ndk profiling


    【解决方案1】:

    您是否在分析时使用该应用程序。如果该进程与 cpu 无关,并且处于睡眠模式,则可能您没有得到任何样本。 https://android.googlesource.com/platform/system/extras/+show/master/simpleperf/README.md#457

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-01
      • 2017-05-13
      • 2013-11-24
      • 2012-09-15
      相关资源
      最近更新 更多