Systrace在Android 4.3 [英] Systrace on Android 4.3

查看:158
本文介绍了Systrace在Android 4.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用新的在JB 4.3引入了跟踪API 。我们的想法是类似于使用traceview方法分析,即可以使用测量特定code节 Trace.beginSection Trace.endSection

I'm trying to measure performance attributes of my app through systrace by using the new Trace API introduced in JB 4.3. The idea is similar to the use of traceview method profiling, i.e. you can measure a specific code section using Trace.beginSection and Trace.endSection.

然而,当我通过Android的工具提供的python脚本运行systrace,我没有看到有关上述调用指定的部分东西。

However, when I run systrace through the python script provided in Android tools, I don't see anything relating to the sections specified by the above calls.

我缺少的东西吗?这是访问systrace输出的正确方法?我的文档中看到跟踪调用它写道:跟踪事件到系统中跟踪缓冲器,但我不知道如何访问跟踪缓冲区。

Am I missing something? Is this the correct way of accessing the systrace output? I see in the documentation for the Trace calls that it "Writes trace events to the system trace buffer", but I have no idea how to access the trace buffer.

任何帮助AP preciated。

Any help appreciated.

推荐答案

您必须提供一个额外的参数给systrace命令: -app = PKGNAME (或 -a PKGNAME )其中, PKGNAME 是您的应用程序清单包名称。这也是您​​在 PS 输出所看到的名称(这可能是更重要,因为这就是它的匹配反对)。

You have to provide an additional argument to the systrace command: -app=pkgname (or -a pkgname) where, pkgname is the package name from your app manifest. It's also the name you see in the ps output (which is possibly more relevant, since that's what it's matching against).

有一个例如这里

这篇关于Systrace在Android 4.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆