https://blog.csdn.net/weixin_38570262/article/details/78479064
https://developer.android.google.cn/studio/profile/systrace/command-line?hl=zh_cn
release 版本
把这段代码放在Application的attachBaseContext
中
try {
Class<?> trace = Class.forName("android.os.Trace");
Method setAppTracingAllowed =
trace.getDeclaredMethod("setAppTracingAllowed", boolean.class);
setAppTracingAllowed.invoke(null, true);
}catch (Exception e){}
Trace.beginSection("CloneUtil.clone");
//code.....
Trace.endSection();