From 9bca168c911e2fde313a44e5d035b0fc75a34c03 Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Thu, 19 Nov 2026 11:15:30 -0700 Subject: [PATCH 1/3] Add Android system trace and Java heap dump command definitions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Matt Klein --- .../workflow/v1/workflow_command.proto | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto index 16f5480..c828c68 100644 --- a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto +++ b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto @@ -618,6 +618,48 @@ enum WellKnownCommandType { } ] }]; + SYSTEM_TRACE = 14 [(well_known_command_options) = { + key: "system_trace" + description: "Captures an Android platform-redacted Perfetto system timeline." + availability: { + supported_platforms: [ + { + platform: ANDROID + min_os_version: "15" + min_config_version: 52 + } + ] + } + argument_definitions: [ + { + name: "duration_ms" + type: INT64 + description: "How long to record, in milliseconds. Android clamps the duration to its supported range." + default_value: {sint_data: 5000} + } + ] + }]; + JAVA_HEAP_DUMP = 15 [(well_known_command_options) = { + key: "java_heap_dump" + description: "Captures a Perfetto ART heap retention graph. It can expose app class and reference structure and is not log-redacted." + availability: { + supported_platforms: [ + { + platform: ANDROID + min_os_version: "15" + min_config_version: 52 + } + ] + } + argument_definitions: [ + { + name: "buffer_size_kb" + type: INT64 + description: "Profiler buffer size in KiB, subject to Android's bounds. This is not an output-file limit." + default_value: {sint_data: 65536} + } + ] + }]; } // Selects one locally registered or built-in workflow command. From 1b8d601cd5adbc3284750a3e55659ea850e50335 Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Thu, 19 Nov 2026 12:37:58 -0700 Subject: [PATCH 2/3] Unify Android and iOS memory dump metadata Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workflow/v1/workflow_command.proto | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto index c828c68..a8d1bb4 100644 --- a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto +++ b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto @@ -108,6 +108,9 @@ extend google.protobuf.EnumValueOptions { // Commands implemented by the client without application registration. enum WellKnownCommandType { + reserved 15; + reserved "JAVA_HEAP_DUMP"; + TYPE_UNSPECIFIED = 0; // Requests the device's buffered logs. // @@ -558,11 +561,19 @@ enum WellKnownCommandType { // On Apple platforms the attachment is a `bitdrift_public.protobuf.memory.v1.MemoryDump` with MIME // type `application/vnd.bitdrift.ios-memory-dump`: the kernel's memory counters, the VM map by // tag and image, and, unless disabled, a census of the malloc heap. + // On Android the attachment is a Perfetto ART heap retention graph with MIME type + // `application/vnd.bitdrift.perfetto-trace`. It can expose class and reference structure and is + // not log-redacted. Android uses a 64 MiB profiling buffer, not a limit on the output file. MEMORY_DUMP = 12 [(well_known_command_options) = { key: "memory_dump" - description: "Captures a snapshot of the application's memory." + description: "Captures an iOS memory snapshot or an Android Perfetto ART heap graph. Android heap graphs can expose class and reference structure and are not log-redacted." availability: { supported_platforms: [ + { + platform: ANDROID + min_os_version: "15" + min_config_version: 52 + }, { platform: APPLE min_os_version: "15.0" @@ -574,7 +585,7 @@ enum WellKnownCommandType { { name: "include_heap" type: BOOL - description: "Includes a census of the malloc heap, which briefly locks each malloc zone." + description: "On iOS, includes a malloc heap census, briefly locking each zone. On Android, must be true because the dump is a heap graph." default_value: {bool_data: true} } ] @@ -639,27 +650,6 @@ enum WellKnownCommandType { } ] }]; - JAVA_HEAP_DUMP = 15 [(well_known_command_options) = { - key: "java_heap_dump" - description: "Captures a Perfetto ART heap retention graph. It can expose app class and reference structure and is not log-redacted." - availability: { - supported_platforms: [ - { - platform: ANDROID - min_os_version: "15" - min_config_version: 52 - } - ] - } - argument_definitions: [ - { - name: "buffer_size_kb" - type: INT64 - description: "Profiler buffer size in KiB, subject to Android's bounds. This is not an output-file limit." - default_value: {sint_data: 65536} - } - ] - }]; } // Selects one locally registered or built-in workflow command. From bad9c137891579e5a1dbf36d4cfdbcf6aea05991 Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Thu, 19 Nov 2026 12:52:15 -0700 Subject: [PATCH 3/3] add remaining android profile types Signed-off-by: Matt Klein --- .../protobuf/workflow/v1/workflow_command.proto | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto index a8d1bb4..7b57331 100644 --- a/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto +++ b/src/bitdrift_public/protobuf/workflow/v1/workflow_command.proto @@ -108,9 +108,6 @@ extend google.protobuf.EnumValueOptions { // Commands implemented by the client without application registration. enum WellKnownCommandType { - reserved 15; - reserved "JAVA_HEAP_DUMP"; - TYPE_UNSPECIFIED = 0; // Requests the device's buffered logs. //