xref: /aosp_15_r20/external/perfetto/protos/perfetto/metrics/android/multiuser_metric.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1/*
2 * Copyright (C) 2021 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
21// Metrics for Multiuser events, such as switching users.
22message AndroidMultiuserMetric {
23
24  // Holds the data for a Multiuser event.
25  message EventData {
26    // Duration of the event (in milliseconds).
27    optional int32 duration_ms = 1;
28
29    // CPU usage of each process during the event.
30    message CpuUsage {
31      // The userId of the process (e.g. 0 or 10).
32      optional int32 user_id = 1;
33      // The name of the process.
34      optional string process_name = 2;
35      // The number of CPU cycles (in megacycles) spent by that process during the event.
36      optional int32 cpu_mcycles = 3;
37      // The ratio of this process's cycles to the total for all processes, expressed as a percentage.
38      optional float cpu_percentage = 4;
39      // General identifier for this usage source: determined from the process name, user, etc.
40      // Should be stable across multiple runs (i.e. does not print the user_id directly).
41      optional string identifier = 5;
42    }
43    repeated CpuUsage cpu_usage = 2;
44  }
45
46  // Metrics for a user switch.
47  optional EventData user_switch = 1;
48}