bytedance / btrace

🔥🔥 btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Perfetto, it support to define custom events automatically during building apk and using bhook to provider more native events like Render/Binder/IO etc.
Other
1.9k stars 267 forks source link

红米k40手机,MUI系统,Android SDK 33版本,也是提示不支持不支持perfetto,让增加-mode simple后抓取trace可以查看 #119

Open livelitoday opened 8 months ago

livelitoday commented 8 months ago

Android设备情况:Android SDK33 系统: MIUI: 14.0.8 红米K40

使用的命令:

java -jar rhea-trace-shell.jar -a rhea.sample.android -t 5 -o output.pb -r rhea.all sched -fullClassName

输出结果:

02-02 13:43:06.512 I RheaTrace : os version is 33. default capture is PerfettoCapture
02-02 13:43:08.525   RheaTrace : start tracing...
02-02 13:43:13.815   RheaTrace : stop tracing...
02-02 13:43:13.998   RheaTrace : MaxAppTraceBufferSize usage 820096/500000000 (0%)
02-02 13:43:14.137 E RheaTrace : Error: systrace file not found: rheatrace.workspace\systemTrace.trace
02-02 13:43:14.137 E RheaTrace :  Tips: your device may not support perfetto. please retry with `-mode simple`.

另外!!!使用perfetto命令行,能获取到trace文件并从Perfetto网站打开查看!!使用的命令如下:

adb shell perfetto --out /data/misc/perfetto-traces/traces-wm wm am input gfx view res pm dalvik ss

用户权限:可获取到root权限的设备。

版本:

rhea_gradle_plugin_vesion=2.0.1 implementation 'com.bytedance.btrace:rhea-core:2.0.0' apk是release版本,是通过反射调用android.os.Trace#setTracingEnabled(true)拿到自定义tag。

WangFeng-AHU commented 8 months ago

麻烦加上 -debug 参数再试一下,提供更详细的 debug 日志我们更好排查一点。

jll0628 commented 6 months ago

03-14 10:08:07.158 RheaTrace : MaxAppTraceBufferSize usage 7583248/500000000 (1%) 03-14 10:08:07.760 E RheaTrace : Error: systrace file not found: rheatrace.workspace\systemTrace.trace 03-14 10:08:07.760 E RheaTrace : Tips: your device may not support perfetto. please retry with -mode simple. com.bytedance.rheatrace.processor.core.TraceError: systrace file not found: rheatrace.workspace\systemTrace.trace at com.bytedance.rheatrace.processor.perfetto.TraceProcessor.(TraceProcessor.java:43) at com.bytedance.rheatrace.processor.perfetto.PerfettoCapture.process(PerfettoCapture.java:95) at com.bytedance.rheatrace.processor.Main.main(Main.java:108) 03-14 10:08:07.918 D RheaTrace : Run adb shell setprop debug.rhea.startWhenAppLaunch 0 03-14 10:08:08.185 D RheaTrace : Run adb shell setprop debug.rhea.mainThreadOnly 0 03-14 10:08:08.469 D RheaTrace : Run adb shell setprop debug.rhea.methodDurThreshold 0 03-14 10:08:08.755 D RheaTrace : Run adb shell setprop debug.rhea.category.all 0