Skip to content

feat(runtime-tracing): support Android and release 0.1.0-ALPHA02 - #171

Merged
santimattius merged 1 commit into
mainfrom
feat/runtime-tracing-android-170
Nov 2, 2026
Merged

santimattius merged 1 commit into
mainfrom
feat/runtime-tracing-android-170

Conversation

@santimattius

Copy link
Copy Markdown
Owner

Summary

Implements #170: PerfettoTraceSink now works on Android, adding slice arguments (queue_delay_ns, span_name, span_id, ...) and span flows that AndroidTraceSink (android.os.Trace) cannot express. Also bumps the runtime family to 0.1.0-ALPHA02.

  • :runtime-tracing-jvm becomes :runtime-tracing, a KMP module (JVM + Android), published as structured-coroutines-runtime-tracing. The package and public JVM API are unchanged (API dump identical).
  • PerfettoTraceSink lives in jvmAndAndroidMain: it only needs an androidx.tracing.Tracer. PerfettoTraceSession stays JVM-only.
  • New instrumented test (connectedAndroidDeviceTest) that records with the Android TraceDriver and decodes the file: slices, args and flows.
  • Docs: module README (Android setup + caveats), family README, runtime README, KDoc, CHANGELOG with migration note. RUNTIME_VERSION=0.1.0-ALPHA02, install snippets updated.

Things to know

  • Breaking rename of the artifact published in 0.1.0-ALPHA01 (...-tracing-jvm -> ...-tracing). Acceptable on the 0.x line; documented in the CHANGELOG.
  • It records into androidx.tracing's in-process buffer, not the system trace buffer. With the default isCategoryEnabled the Android driver records only while a system trace is active; use { true } to always record (found on the emulator, documented).
  • The CI does not run the instrumented test (needs an emulator); it was run locally.
  • Overlaps textually with feat(runtime): export span and queue delay through AndroidTraceSink #169 (README/KDoc of AndroidTraceSink) and docs: use runtime 0.1.0-ALPHA01 in install snippets #166 (install snippets, superseded here by 0.1.0-ALPHA02). Whichever merges second needs a trivial rebase.

Test plan

./gradlew :runtime-tracing:jvmTest :runtime-tracing:apiCheck :runtime-tracing:compileAndroidMain :runtime:jvmTest :runtime:apiCheck
./gradlew :runtime-tracing:connectedAndroidDeviceTest   # Pixel 9 AVD, Android 15: passed

Not validated: the publish workflow for the renamed artifact, and opening the Android file in the Perfetto UI.

Fixes #170

Turn :runtime-tracing-jvm into the Kotlin Multiplatform module
:runtime-tracing (JVM + Android), published as
structured-coroutines-runtime-tracing. PerfettoTraceSink now works on
Android with an androidx.tracing Tracer, adding slice arguments and span
flows that AndroidTraceSink cannot express. PerfettoTraceSession stays
JVM-only.

Add an instrumented test verified on an Android 15 emulator, document
the Android setup and its caveats, and bump RUNTIME_VERSION to
0.1.0-ALPHA02.

Relates to #170
@santimattius
santimattius force-pushed the feat/runtime-tracing-android-170 branch from b68057d to 670cbad Compare November 2, 2026 22:01
@santimattius
santimattius merged commit 522151f into main Nov 2, 2026
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

feat(runtime): androidx.tracing sink for Android with slice args and span flows

1 participant