You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Update btrace skill with release builds and sound cues
Use release builds for accurate profiling, add ProGuard keep rules
for btrace and Sentry class names, increase trace duration to 30s,
and play a Ping sound synced to the actual trace start.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/btrace-perfetto/SKILL.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Before starting, verify:
28
28
|----------|---------|-------------|
29
29
| branch1 | current branch | First branch to trace |
30
30
| branch2 |`main`| Second branch to compare against |
31
-
| duration |`20`| Trace duration in seconds |
31
+
| duration |`30`| Trace duration in seconds |
32
32
| sql-query | see below | SQL query to prefill in Perfetto UI |
33
33
34
34
If no arguments are provided, ask the user what they want to trace and which branches to compare. If only one branch is given, capture only that branch (no comparison).
**Important**: The package is `com.bytedance.rheatrace`, not `com.bytedance.btrace`.
75
75
76
+
### 2d: Add ProGuard keep rule for release builds
77
+
78
+
In `sentry-samples/sentry-samples-android/proguard-rules.pro`, add:
79
+
80
+
```
81
+
-keep class com.bytedance.rheatrace.** { *; }
82
+
-keepnames class io.sentry.** { *; }
83
+
```
84
+
85
+
The first rule prevents R8 from stripping btrace's HTTP server classes (fails with `SocketException` otherwise). The second preserves Sentry class and method names so they appear readable in the Perfetto trace instead of obfuscated single-letter names.
86
+
76
87
## Step 3: Build and Install
77
88
89
+
Always use release builds for tracing — debug builds have StrictMode, debuggable overhead, and no R8 optimizations, which skew results.
@@ -95,7 +108,20 @@ adb shell am start -n io.sentry.samples.android/.MainActivity
95
108
96
109
The app must be started AFTER `debug.rhea3.startWhenAppLaunch` is set, otherwise the trace server won't initialize.
97
110
98
-
### 4b: Tell the user to interact with the app, then capture
111
+
### 4b: Play a sound to signal the user, then capture
112
+
113
+
Play a sound when tracing actually starts so the user knows to begin interacting. Pipe btrace output through a loop that triggers the sound on the "start tracing" line:
4. Rebuild and install: `./gradlew :sentry-samples:sentry-samples-android:installDebug`
150
+
4. Rebuild and install: `./gradlew :sentry-samples:sentry-samples-android:installRelease`
124
151
5. Repeat steps 4a and 4b with a different output filename
125
152
6. Switch back to the original branch and restore files
126
153
@@ -172,3 +199,4 @@ After tracing is complete, remind the user that the btrace integration changes t
172
199
|`wait for trace ready timeout` on download | Set `debug.rhea3.startWhenAppLaunch=1` BEFORE launching the app, and use `-waitTraceTimeout 60`|
173
200
| Empty jar file (0 bytes) | Download from Maven Central (`repo1.maven.org`), not `oss.sonatype.org`|
174
201
|`FileNotFoundException` on sampling download | App was already running when properties were set; force-stop and relaunch |
202
+
|`SocketException: Unexpected end of file` in release builds | R8 stripped btrace classes; add `-keep class com.bytedance.rheatrace.** { *; }` to proguard-rules.pro |
0 commit comments