抓取应用启动过程中trace信息,在stop stracing的时候控制台出现错误提示,如下
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 335
- PR merge metrics
- No merged PRs in 30d
Description
Android 12的机型
C:\Users\admin>java -jar D:\application\platform_tools\platform-tools\btrace\btrace.jar -a com.rzm.huace.testbtrace -t 10 -o D:\application\platform_tools\platform-tools\btrace\output.pb -r rhea.all sched -fullClassName
07-15 17:00:39.401 I RheaTrace : workspace clear: D:\application\platform_tools\platform-tools\btrace\rheatrace.workspace
07-15 17:00:40.336 I RheaTrace : os version is 31. default capture is PerfettoCapture
07-15 17:00:41.196 RheaTrace : start tracing...
07-15 17:00:51.651 RheaTrace : stop tracing...
07-15 17:00:58.033 RheaTrace : MaxAppTraceBufferSize usage 53808/500000000 (0%)
07-15 17:00:58.879 I RheaTrace : reuse cached mapping:C:\Users\admin\.rheatrace_mapping\e5ea9d32-0cc0-454a-9358-7533ecb0089b
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 5
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at com.bytedance.rheatrace.processor.core.AppTraceProcessor.processDraft(AppTraceProcessor.java:116)
at com.bytedance.rheatrace.processor.core.AppTraceProcessor.getATrace(AppTraceProcessor.java:98)
at com.bytedance.rheatrace.processor.core.AbstractTraceGenerator.generate(AbstractTraceGenerator.java:33)
at com.bytedance.rheatrace.processor.perfetto.PerfettoCapture.process(PerfettoCapture.java:95)
at com.bytedance.rheatrace.processor.Main.main(Main.java:108)
Contributor guide
Research direction
Reproduce the Android 12 command and follow the stack trace into AppTraceProcessor.java:116, called from getATrace and PerfettoCapture.process. Inspect the input that reaches processDraft after tracing stops and identify why its string lacks the expected delimiter. Done means the command completes without StringIndexOutOfBoundsException and produces the requested output.pb.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100