• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2025 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/perfetto_sql/structured_query.proto";
22import "protos/perfetto/trace_summary/v2_metric.proto";
23
24// Wrapper proto containing a bunch of specifications for computing summaries
25// of traces.
26//
27// This proto is largely a single wrapper around a bunch of different
28// concepts to make it easy to have self-contained config files for summarising
29// the contents of traces. See the comments on individual fields for usage of
30// this proto.
31//
32// NOTE FOR MODIFIERS: all fields of this proto *must* be non-packed, repeated
33// fields. There is an expectation that instances of this proto can be
34// concatenated together trivially without any loss of information.
35message TraceSummarySpec {
36  // The specification of a v2 trace metric.
37  //
38  // See documentation for TraceMetricV2Spec for usage of this field.
39  repeated TraceMetricV2Spec metric_spec = 1;
40
41  // Instances of structured queries whose ids can be referenced by:
42  // 1) `inner_query_id` field of any `metric_spec.query` which is useful for
43  //    sharing a single query across many different metrics.
44  // 2) computation of trace-wide metadata.
45  repeated PerfettoSqlStructuredQuery query = 2;
46}
47
48// Wrapper proto containing a bunch of outputs protos produced when computing
49// summaries of traces.
50//
51// See comments on `TraceSummarySpec` and on individual fields for usage of this
52// proto.
53message TraceSummary {
54  // The result of computing a v2 trace metric.
55  //
56  // See documentation for TraceMetric for usage of this field.
57  repeated TraceMetricV2 metric = 1;
58
59  // Metadata about the whole trace file as key value pairs. This is intended
60  // to put metadata about the trace (e.g. the device trace was collected on,
61  // the OS version) which gives context to other parts of the summary (e.g. the
62  // metrics).
63  message Metadata {
64    optional string key = 1;
65    optional string value = 2;
66  }
67  repeated Metadata metadata = 2;
68}
69