简体   繁体   English

Systrace 自定义事件未显示在应用程序的发布版本中

[英]Systrace custom events not showing in release build of app

I am using systrace/perfetto to capture traces.我正在使用 systrace/perfetto 来捕获跟踪。 I am following below way to add custom events from my code - https://developer.android.com/topic/performance/tracing/custom-events我按照以下方式从我的代码中添加自定义事件 - https://developer.android.com/topic/performance/tracing/custom-events

I can see custom events in debug build but cant see in release build.我可以在调试版本中看到自定义事件,但在发布版本中看不到。

Is there anyway by which i can see custom events in release build of my app无论如何我可以在我的应用程序的发布版本中看到自定义事件

Starting in Android API 29 (Q), there's a new profileable flag in the manifest that enables some profiling data (eg systrace custom events) for non-debuggable builds.从 Android API 29 (Q) 开始,清单中有一个新的profileable标志,可以为不可调试的构建启用一些分析数据(例如 systrace 自定义事件)。

I think making your release build debuggable will do the trick.我认为让你的发布版本可调试就可以了。 add following in your app module build.gradle file在您的应用模块 build.gradle 文件中添加以下内容

  buildTypes {
    release {
        debuggable true
    }
}

Have you added the package name of your app, when you are capturing the trace.在捕获跟踪时,您是否添加了应用程序的 package 名称。 You can specify it by -a tag.您可以通过 -a 标记指定它。 Adding a package name is mandatory to see custom events in a release build.要在发布版本中查看自定义事件,必须添加 package 名称。

for eg:例如:

python systrace.py -o trace_file.html -a package_name sched freq idle am wm gfx view binder_driver hal dalvik camera input res

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM