Skip to content

fix(profiling): Accept Android 17 method trace headers - #6523

Open
antonis wants to merge 2 commits into
masterfrom
antonis/fix-android-17-trace-headers
Open

antonis wants to merge 2 commits into
masterfrom
antonis/fix-android-17-trace-headers

Conversation

@antonis

@antonis antonis commented Oct 16, 2026 •

Copy link
Copy Markdown

Description

Android method traces recorded on Android 17 (API 37) are currently dropped with profiling_invalid_sampled_profile. Android 17's ART writes five new keys in the *version header of every method trace (is_streaming, is_precise_trace, end_time, end_tsc, compilation-filter, see TraceWriter::CreateSummary in runtime/trace.cc on android17-release). android_trace_log 0.3.0 rejects any header key it does not know, so the whole profile fails to parse.

This PR removes exactly these five header lines before handing the trace to android_trace_log, for both transaction profiles (legacy.rs) and Android trace chunks (chunk.rs).

  • Only the *version section is touched. The binary data section is copied as is, and its data_offset is relative to the SLOW magic, so shortening the text header does not move it.
  • Traces without these keys are passed through unchanged, without copying.
  • Any other unknown key, and malformed values of known keys, are still rejected as before.

Alternative considered: skip all unknown header keys

Instead of listing the five Android 17 keys, we could skip every header key that android_trace_log does not know. That would keep future Android versions from breaking. We went with the explicit list to stay conservative and keep the change minimal.

Context

Fixes #6517

Testing

antonis and others added 2 commits October 16, 2026 13:33
Android 17's ART writes five new keys in the `*version` header of method
traces (`is_streaming`, `is_precise_trace`, `end_time`, `end_tsc`,
`compilation-filter`). `android_trace_log` rejects unknown header keys, so
these profiles were dropped as `profiling_invalid_sampled_profile`.

Remove exactly these header lines before parsing, for both legacy
transaction profiles and Android trace chunks. Other unknown keys are
still rejected.

Fixes #6517

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5b162ac. Configure here.

This branch has not been deployed

No deployments
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.

Android 17 method traces rejected as profiling_invalid_sampled_profile: new ART header keys unsupported by android_trace_log

1 participant