1/* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package perfetto.protos; 20 21import "protos/perfetto/metrics/android/batt_metric.proto"; 22import "protos/perfetto/metrics/android/cpu_metric.proto"; 23import "protos/perfetto/metrics/android/mem_metric.proto"; 24import "protos/perfetto/metrics/android/mem_unagg_metric.proto"; 25import "protos/perfetto/metrics/android/ion_metric.proto"; 26import "protos/perfetto/metrics/android/lmk_metric.proto"; 27import "protos/perfetto/metrics/android/lmk_reason_metric.proto"; 28import "protos/perfetto/metrics/android/powrails_metric.proto"; 29import "protos/perfetto/metrics/android/startup_metric.proto"; 30import "protos/perfetto/metrics/android/heap_profile_callsites.proto"; 31import "protos/perfetto/metrics/android/hwui_metric.proto"; 32import "protos/perfetto/metrics/android/package_list.proto"; 33import "protos/perfetto/metrics/android/unmapped_java_symbols.proto"; 34import "protos/perfetto/metrics/android/unsymbolized_frames.proto"; 35import "protos/perfetto/metrics/android/java_heap_histogram.proto"; 36import "protos/perfetto/metrics/android/java_heap_stats.proto"; 37import "protos/perfetto/metrics/android/display_metrics.proto"; 38import "protos/perfetto/metrics/android/task_names.proto"; 39import "protos/perfetto/metrics/android/thread_time_in_state_metric.proto"; 40 41// Trace processor metadata 42message TraceMetadata { 43 message Entry { 44 optional string name = 1; 45 optional uint32 idx = 2; 46 optional int64 value = 3; 47 } 48 49 repeated Entry error_stats_entry = 1; 50 optional int64 trace_duration_ns = 2; 51 optional string trace_uuid = 3; 52 optional string android_build_fingerprint = 4; 53 optional int64 statsd_triggering_subscription_id = 5; 54 optional int64 trace_size_bytes = 6; 55 repeated string trace_trigger = 7; 56 optional string unique_session_name = 8; 57} 58 59// Root message for all Perfetto-based metrics. 60// 61// Next id: 25 62message TraceMetrics { 63 reserved 4, 10, 13, 14; 64 65 // Battery counters metric on Android. 66 optional AndroidBatteryMetric android_batt = 5; 67 68 // CPU usage per trace, process and thread. 69 optional AndroidCpuMetric android_cpu = 6; 70 71 // Memory metrics on Android (owned by the Android Telemetry team). 72 optional AndroidMemoryMetric android_mem = 1; 73 74 // Memory metrics on Android in unaggregated form. (owned by the Android 75 // Telemetry team). 76 // Note: this generates a lot of data so should not be requested unless it 77 // is clear that this data is necessary. 78 optional AndroidMemoryUnaggregatedMetric android_mem_unagg = 11; 79 80 // Package list. 81 optional AndroidPackageList android_package_list = 12; 82 83 // ion buffer memory metrics. 84 optional AndroidIonMetric android_ion = 9; 85 86 // Statistics about low memory kills. 87 optional AndroidLmkMetric android_lmk = 8; 88 89 // Power Rails metrics on Android. 90 optional AndroidPowerRails android_powrails = 7; 91 92 // Startup metrics on Android (owned by the Android Telemetry team). 93 optional AndroidStartupMetric android_startup = 2; 94 95 // Heap profiler callsite statistics. 96 optional HeapProfileCallsites heap_profile_callsites = 16; 97 98 // Trace metadata (applicable to all traces). 99 optional TraceMetadata trace_metadata = 3; 100 101 // Returns stack frames missing symbols. 102 optional UnsymbolizedFrames unsymbolized_frames = 15; 103 104 // If the trace contains a heap graph, output allocation statistics. 105 optional JavaHeapStats java_heap_stats = 17; 106 107 // If the trace contains a heap graph, output histogram. 108 optional JavaHeapHistogram java_heap_histogram = 21; 109 110 // Metrics used to find potential culprits of low-memory kills. 111 optional AndroidLmkReasonMetric android_lmk_reason = 18; 112 113 // Java type names that have no deobfuscation mappings. 114 optional UnmappedJavaSymbols unmapped_java_symbols = 19; 115 116 optional AndroidHwuiMetric android_hwui_metric = 20; 117 118 optional AndroidDisplayMetrics display_metrics = 22; 119 120 optional AndroidTaskNames android_task_names = 23; 121 122 optional AndroidThreadTimeInStateMetric android_thread_time_in_state = 24; 123 124 // Demo extensions. 125 extensions 450 to 499; 126 127 // Vendor extensions. 128 extensions 500 to 1000; 129} 130