xref: /aosp_15_r20/external/perfetto/protos/perfetto/metrics/android/cpu_metric.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
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/process_metadata.proto";
22
23message AndroidCpuMetric {
24  // Next id: 6
25  message Metrics {
26    // CPU megacycles (i.e. cycles divided by 1e6).
27    optional int64 mcycles = 1;
28
29    // Total time the thread was running for this breakdown in
30    // nanoseconds.
31    optional int64 runtime_ns = 2;
32
33    // Min/max/average CPU frequency weighted by the time the CPU was
34    // running at each frequency in this breakdown.
35    optional int64 min_freq_khz = 3;
36    optional int64 max_freq_khz = 4;
37    optional int64 avg_freq_khz = 5;
38  }
39
40  // Next id: 7
41  message CoreData {
42    optional uint32 id = 1;
43    optional Metrics metrics = 6;
44
45    reserved 2 to 5;
46  }
47
48  // Next id: 3
49  message CoreTypeData {
50    optional string type = 1;
51    optional Metrics metrics = 2;
52  }
53
54  // Next id: 7
55  message Thread {
56    optional string name = 1;
57    optional Metrics metrics = 4;
58
59    // Breakdowns of above metrics.
60    repeated CoreData core = 2;
61    repeated CoreTypeData core_type = 5;
62
63    reserved 3;
64  }
65
66  // Next id: 8
67  message Process {
68    optional string name = 1;
69    optional AndroidProcessMetadata process = 8;
70    optional Metrics metrics = 4;
71
72    // Breakdowns of above metrics.
73    repeated Thread threads = 6;
74    repeated CoreData core = 7;
75    repeated CoreTypeData core_type = 5;
76
77    reserved 3;
78  }
79
80  repeated Process process_info = 1;
81}
82