blob: 36b131b53b6862eeb3b29b5fcb0d873143f63d6f [file] [log] [blame]
/*
* Copyright (C) 2019 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.
*/
syntax = "proto2";
package perfetto.protos;
import "protos/perfetto/metrics/android/batt_metric.proto";
import "protos/perfetto/metrics/android/cpu_metric.proto";
import "protos/perfetto/metrics/android/camera_metric.proto";
import "protos/perfetto/metrics/android/display_metrics.proto";
import "protos/perfetto/metrics/android/dma_heap_metric.proto";
import "protos/perfetto/metrics/android/fastrpc_metric.proto";
import "protos/perfetto/metrics/android/g2d_metric.proto";
import "protos/perfetto/metrics/android/gpu_metric.proto";
import "protos/perfetto/metrics/android/hwcomposer.proto";
import "protos/perfetto/metrics/android/hwui_metric.proto";
import "protos/perfetto/metrics/android/ion_metric.proto";
import "protos/perfetto/metrics/android/jank_metric.proto";
import "protos/perfetto/metrics/android/java_heap_histogram.proto";
import "protos/perfetto/metrics/android/java_heap_stats.proto";
import "protos/perfetto/metrics/android/lmk_metric.proto";
import "protos/perfetto/metrics/android/lmk_reason_metric.proto";
import "protos/perfetto/metrics/android/mem_metric.proto";
import "protos/perfetto/metrics/android/mem_unagg_metric.proto";
import "protos/perfetto/metrics/android/multiuser_metric.proto";
import "protos/perfetto/metrics/android/package_list.proto";
import "protos/perfetto/metrics/android/powrails_metric.proto";
import "protos/perfetto/metrics/android/profiler_smaps.proto";
import "protos/perfetto/metrics/android/simpleperf.proto";
import "protos/perfetto/metrics/android/startup_metric.proto";
import "protos/perfetto/metrics/android/surfaceflinger.proto";
import "protos/perfetto/metrics/android/sysui_cuj_metrics.proto";
import "protos/perfetto/metrics/android/task_names.proto";
import "protos/perfetto/metrics/android/thread_time_in_state_metric.proto";
import "protos/perfetto/metrics/android/trace_quality.proto";
import "protos/perfetto/metrics/android/unsymbolized_frames.proto";
// Trace processor metadata
message TraceMetadata {
reserved 1;
optional int64 trace_duration_ns = 2;
optional string trace_uuid = 3;
optional string android_build_fingerprint = 4;
optional int64 statsd_triggering_subscription_id = 5;
optional int64 trace_size_bytes = 6;
repeated string trace_trigger = 7;
optional string unique_session_name = 8;
optional string trace_config_pbtxt = 9;
optional int64 sched_duration_ns = 10;
}
// Stats counters for the trace.
// Defined in src/trace_processor/storage/stats.h
message TraceAnalysisStats {
enum Severity {
SEVERITY_UNKNOWN = 0;
SEVERITY_INFO = 1;
SEVERITY_DATA_LOSS = 2;
SEVERITY_ERROR = 3;
}
enum Source {
SOURCE_UNKNOWN = 0;
SOURCE_TRACE = 1;
SOURCE_ANALYSIS = 2;
}
message Stat {
optional string name = 1;
optional uint32 idx = 2;
optional Severity severity = 3;
optional Source source = 4;
optional int64 count = 5;
}
repeated Stat stat = 1;
}
// Root message for all Perfetto-based metrics.
//
// Next id: 39
message TraceMetrics {
reserved 4, 10, 13, 14, 16, 19;
// Battery counters metric on Android.
optional AndroidBatteryMetric android_batt = 5;
// CPU usage per trace, process and thread.
optional AndroidCpuMetric android_cpu = 6;
// Memory metrics on Android (owned by the Android Telemetry team).
optional AndroidMemoryMetric android_mem = 1;
// Memory metrics on Android in unaggregated form. (owned by the Android
// Telemetry team).
// Note: this generates a lot of data so should not be requested unless it
// is clear that this data is necessary.
optional AndroidMemoryUnaggregatedMetric android_mem_unagg = 11;
// Package list.
optional AndroidPackageList android_package_list = 12;
// ion buffer memory metrics.
optional AndroidIonMetric android_ion = 9;
// fastrpc subsystem memory metrics.
optional AndroidFastrpcMetric android_fastrpc = 31;
// Statistics about low memory kills.
optional AndroidLmkMetric android_lmk = 8;
// Power Rails metrics on Android.
optional AndroidPowerRails android_powrails = 7;
// Startup metrics on Android (owned by the Android Telemetry team).
optional AndroidStartupMetric android_startup = 2;
// Trace metadata (applicable to all traces).
optional TraceMetadata trace_metadata = 3;
// Trace stats (applicable to all traces).
optional TraceAnalysisStats trace_stats = 33;
// Returns stack frames missing symbols.
optional UnsymbolizedFrames unsymbolized_frames = 15;
// If the trace contains a heap graph, output allocation statistics.
optional JavaHeapStats java_heap_stats = 17;
// If the trace contains a heap graph, output histogram.
optional JavaHeapHistogram java_heap_histogram = 21;
// Metrics used to find potential culprits of low-memory kills.
optional AndroidLmkReasonMetric android_lmk_reason = 18;
optional AndroidHwuiMetric android_hwui_metric = 20;
optional AndroidDisplayMetrics display_metrics = 22;
optional AndroidTaskNames android_task_names = 23;
optional AndroidThreadTimeInStateMetric android_thread_time_in_state = 24;
// Metric associated with surfaceflinger.
optional AndroidSurfaceflingerMetric android_surfaceflinger = 25;
// GPU metrics on Android.
optional AndroidGpuMetric android_gpu = 26;
// Frame timing and jank root causes for system UI interactions.
optional AndroidSysUiCujMetrics android_sysui_cuj = 27;
// Metric associated with hwcomposer.
optional AndroidHwcomposerMetrics android_hwcomposer = 28;
// Detects common bad patterns that might lead to jank.
optional AndroidJankMetrics android_jank = 29;
// G2D metrics.
optional G2dMetrics g2d = 30;
// Dmabuf heap metrics.
optional AndroidDmaHeapMetric android_dma_heap = 32;
// Metric to verify the quality of the trace.
optional AndroidTraceQualityMetric android_trace_quality = 34;
// Profiler smaps
optional ProfilerSmaps profiler_smaps = 35;
// Multiuser - metrics for switching users.
optional AndroidMultiuserMetric android_multiuser = 36;
// Metrics related to simpleperf tool
optional AndroidSimpleperfMetric android_simpleperf = 37;
// Metrics for the Camera team.
optional AndroidCameraMetric android_camera = 38;
// Demo extensions.
extensions 450 to 499;
// Vendor extensions.
extensions 500 to 1000;
// Chrome metrics.
extensions 1001 to 2000;
}