Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: systrace file not found: rheatrace.workspace\systemTrace.trace #111

Open
bianmajiang opened this issue Oct 11, 2023 · 5 comments
Open

Comments

@bianmajiang
Copy link

bianmajiang commented Oct 11, 2023

1.PC环境:Window10,JDK版本:Java 11
2.手机环境:VIVO手机,Android版本13
3.APK文件:64位,assets 目录是否包含 methodMapping.txt 文件:包含
4.编译环境:Android Studio Chipmunk|2021.2.1 Patch 1,AGP版本:com.android.tools.build:gradle:4.2.2,gradle版本:6.9.2 btrace版本:2.0.3-rc02,Java版本:Java 11,已开启R8

执行命令:java -jar rhea-trace-shell.jar -s 1ee449c3 -a com.xxx.xxx -t 10 -o output.pb -r rhea.all sched -fullClassName

报错如下:
10-11 10:36:06.946 I RheaTrace : workspace clear: C:\Users\xxx\AppData\Local\Android\Sdk\platform-tools\systrace\rheatrace.workspace
10-11 10:36:08.062 I RheaTrace : os version is 33. default capture is PerfettoCapture
10-11 10:36:10.065 RheaTrace : start tracing...
10-11 10:36:20.703 RheaTrace : stop tracing...
10-11 10:36:21.037 RheaTrace : MaxAppTraceBufferSize usage 3107072/500000000 (0%)
10-11 10:36:21.802 E RheaTrace : Error: systrace file not found: rheatrace.workspace\systemTrace.trace
10-11 10:36:21.803 E RheaTrace : Tips: your device may not support perfetto. please retry with -mode simple.

使用-mode simple采集模式可以采集成功,但是没有ftrace信息。

@mzule
Copy link
Collaborator

mzule commented Oct 11, 2023

检查下是不是没有安装python3环境?如果已经有了,可以再确认下直接使用官方的方式采集Perfetto的trace会不会遇到问题,https://perfetto.dev/docs/quickstart/android-tracing

curl -O https://raw.githubusercontent.com/google/perfetto/master/tools/record_android_trace
python3 record_android_trace -o trace_file.perfetto-trace -t 10s -b 32mb \
sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory

@bianmajiang
Copy link
Author

bianmajiang commented Oct 11, 2023

D:\Python\Python38>curl -O https://raw.githubusercontent.com/google/perfetto/master/tools/record_android_trace
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 25286 100 25286 0 0 25286 0 0:00:01 0:00:01 --:--:-- 19739

D:\Python\Python38>python record_android_trace -o trace_file.perfetto-trace -t 10s -b 320mb sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory
Running perfetto --background --txt -o /data/misc/perfetto-traces/2023-10-11_16-22-164246.pftrace -t 10s -b 320mb sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory
�[30m�[44mTrace started. Press CTRL+C to stop�[0m
--------- beginning of main
E/perfetto( 1364): ernel_symbolizer.cc:106 kallsyms addresses are still masked after setting security.lower_kptr_restrict
E/perfetto( 1364): ernel_symbol_map.cc:371 Failed to parse kallsyms. Kernel functions will not be symbolized. On Linux this requires either running traced_probes as root or manually lowering /proc/sys/kernel/kptr_restrict
I/perfetto(15063): ng_service_impl.cc:1890 FlushAndDisableTracing(2) done, success=1
I/perfetto( 1364): probes_producer.cc:396 Producer stop (id=5)
I/perfetto( 1364): ftrace_procfs.cc:342 disabled ftrace in /sys/kernel/tracing/
I/perfetto( 1364): probes_producer.cc:396 Producer stop (id=6)
I/perfetto(16402): perfetto_cmd.cc:1127 Wrote 41593579 bytes into /data/misc/perfetto-traces/2023-10-11_16-22-164246.pftrace
I/perfetto(15063): ng_service_impl.cc:2426 Tracing session 2 ended, total sessions:0

Pulling into ./trace_file.perfetto-trace
/data/misc/perfetto-traces/2023-10-11_16-22-164246.pftrace...le pulled, 0 skipped. 39.7 MB/s (41593579 bytes in 0.999s)

Opening the trace (./trace_file.perfetto-trace) in the browser
127.0.0.1 - - [11/Oct/2023 16:22:20] code 404, message File not found
127.0.0.1 - - [11/Oct/2023 16:22:20] "POST /status HTTP/1.1" 404 -
127.0.0.1 - - [11/Oct/2023 16:22:20] "GET /trace_file.perfetto-trace HTTP/1.1" 200 -

@mzule
Copy link
Collaborator

mzule commented Oct 11, 2023

@bianmajiang 脚本里面写死的python3,你看看创建一个python3的别名呢,后面我们都兼容下。

@mzule mzule reopened this Oct 11, 2023
@bianmajiang
Copy link
Author

可以了。

@dlgit88839
Copy link

请问除了python的问题还有什么会导致这个问题吗,我本地已经有python3且可以正常运行,但是依然存在Error: systrace file not found: rheatrace.workspace\systemTrace.trace问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants