Systrace on Android 4.3

有些话、适合烂在心里 提交于 2019-12-07 14:37:23

问题


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.

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.

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.

Any help appreciated.


回答1:


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).

There is an example here.



来源:https://stackoverflow.com/questions/18106123/systrace-on-android-4-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!