Skip to content

Accept Android 17 trace header keys - #3

Open
antonis wants to merge 1 commit into
chayleaf:masterfrom
antonis:accept-android-17-header-keys
Open

antonis wants to merge 1 commit into
chayleaf:masterfrom
antonis:accept-android-17-header-keys

Conversation

@antonis

@antonis antonis commented Oct 19, 2026

Copy link
Copy Markdown

Description

Starting with Android 17 (API 37), ART writes five additional keys in the *version section of every method trace, right after pid=: is_streaming, is_precise_traceend_time, end_tsc and compilation-filter

They come from TraceWriter::CreateSummary in runtime/trace.cc on android17-release. The same function on
android16-release stops at pid=. They're written unconditionally, so parse() currently fails on every method trace recorded on Android 17.

Changes

  • parse_header_line now recognizes the five keys and validates their values: booleans for is_streaming and is_precise_trace, numbers for end_time and end_tsc, and any text up to the newline for compilation-filter. The values aren't stored, so AndroidTraceLog and the public API stay the same.
  • Other unknown keys, and malformed values for known keys, are still rejected as before.
  • Tests: unit tests for each new key, including rejected values, plus a full parse of a trace with the Android 17 header.

The rest of the format is unchanged in Android 17. Threads, methods, the SLOW header and the event records all parse as before once these lines are accepted.

Context

This came up in getsentry/relay#6517 and has been tested with getsentry/sentry-react-native#6892

Thanks for maintaining this crate 🙇

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.

1 participant