/* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Partial clone of frameworks/proto_logging/stats/atoms.proto. CarTelemetryService only uses // small number of atoms. syntax = "proto2"; package android.car.telemetry.statsd; option java_package = "com.android.car.telemetry"; option java_outer_classname = "AtomsProto"; message Atom { oneof pushed { ActivityForegroundStateChanged activity_foreground_state_changed = 42; AppStartMemoryStateCaptured app_start_memory_state_captured = 55; AppCrashOccurred app_crash_occurred = 78; ANROccurred anr_occurred = 79; WTFOccurred wtf_occurred = 80; } // Pulled events will start at field 10000. oneof pulled { ProcessMemoryState process_memory_state = 10013; ProcessCpuTime process_cpu_time = 10035; } } message AppStartMemoryStateCaptured { // The uid if available. -1 means not available. optional int32 uid = 1; optional string process_name = 2; optional string activity_name = 3; optional int64 page_fault = 4; optional int64 page_major_fault = 5; optional int64 rss_in_bytes = 6; optional int64 cache_in_bytes = 7; optional int64 swap_in_bytes = 8; } message ProcessMemoryState { optional int32 uid = 1; optional string process_name = 2; optional int32 oom_adj_score = 3; optional int64 page_fault = 4; optional int64 page_major_fault = 5; optional int64 rss_in_bytes = 6; optional int64 cache_in_bytes = 7; optional int64 swap_in_bytes = 8; } message ActivityForegroundStateChanged { optional int32 uid = 1; optional string pkg_name = 2; optional string class_name = 3; enum State { BACKGROUND = 0; FOREGROUND = 1; } optional State state = 4; } message ProcessCpuTime { optional int32 uid = 1; optional string process_name = 2; optional int64 user_time_millis = 3; optional int64 system_time_millis = 4; } // Copied from //frameworks/proto_logging/stats/enums/server/enums.proto enum ErrorSource { ERROR_SOURCE_UNKNOWN = 0; DATA_APP = 1; SYSTEM_APP = 2; SYSTEM_SERVER = 3; } message AppCrashOccurred { optional int32 uid = 1; optional string event_type = 2; optional string process_name = 3; optional int32 pid = 4; optional string package_name = 5; enum InstantApp { UNAVAILABLE = 0; FALSE = 1; TRUE = 2; } optional InstantApp is_instant_app = 6; enum ForegroundState { UNKNOWN = 0; BACKGROUND = 1; FOREGROUND = 2; } optional ForegroundState foreground_state = 7; optional ErrorSource error_source = 8; optional bool is_incremental = 9; optional float loading_progress = 10; optional int64 millis_since_oldest_pending_read = 11; optional int32 storage_health_code = 12; optional int32 data_loader_status_code = 13; optional bool read_logs_enabled = 14; optional int64 millis_since_last_data_loader_bind = 15; optional int64 data_loader_bind_delay_millis = 16; optional int32 total_delayed_reads = 17; optional int32 total_failed_reads = 18; optional int32 last_read_error_uid = 19; optional int64 last_read_error_millis_since = 20; optional int32 last_read_error_code = 21; optional int64 total_delayed_reads_duration_millis = 22; } message ANROccurred { optional int32 uid = 1; optional string process_name = 2; optional string short_component_name = 3; optional string reason = 4; enum InstantApp { UNAVAILABLE = 0; FALSE = 1; TRUE = 2; } optional InstantApp is_instant_app = 5; enum ForegroundState { UNKNOWN = 0; BACKGROUND = 1; FOREGROUND = 2; } optional ForegroundState foreground_state = 6; optional ErrorSource error_source = 7; optional string package_name = 8; optional bool is_incremental = 9; optional float loading_progress = 10; optional int64 millis_since_oldest_pending_read = 11; optional int32 storage_health_code = 12; optional int32 data_loader_status_code = 13; optional bool read_logs_enabled = 14; optional int64 millis_since_last_data_loader_bind = 15; optional int64 data_loader_bind_delay_millis = 16; optional int32 total_delayed_reads = 17; optional int32 total_failed_reads = 18; optional int32 last_read_error_uid = 19; optional int64 last_read_error_millis_since = 20; optional int32 last_read_error_code = 21; optional int64 total_delayed_reads_duration_millis = 22; } message WTFOccurred { optional int32 uid = 1; optional string tag = 2; optional string process_name = 3; optional int32 pid = 4; optional ErrorSource error_source = 5; }