1/*
2 * Copyright (C) 2022 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 android.os.statsd.kernel;
20
21import "frameworks/proto_logging/stats/atom_field_options.proto";
22import "frameworks/proto_logging/stats/enums/app/app_enums.proto";
23
24option java_package = "com.android.os.kernel";
25option java_multiple_files = true;
26
27/**
28 * Logs each kernel wakeup reason that caused a kernel wakeup with more detailed
29 * high level attribution information.
30 *
31 * Logged from:
32 *   frameworks/base/services/core/java/com/android/server/power/stats/CpuWakeupStats.java
33 */
34message KernelWakeupAttributed {
35    enum Type {
36        TYPE_UNKNOWN = 0;
37        TYPE_IRQ = 1;
38        TYPE_ABNORMAL = 2;
39    }
40
41    // The type of kernel wakeup.
42    optional Type type = 1;
43
44    enum Reason {
45        UNKNOWN = 0;
46        ALARM = 1;
47        WIFI = 2;
48        SOUND_TRIGGER = 3;
49        SENSOR = 4;
50        CELLULAR_DATA = 5;
51    }
52
53    optional Reason reason = 2;
54    repeated int32 uids = 3 [(is_uid) = true];
55    optional int64 elapsed_millis = 4;
56    // The process states for each of the uids in the field above.
57    repeated android.app.ProcessStateEnum process_states = 5;
58}
59