• 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
21// AppWakelockInfo describes the time-independent properties of a wakelock, such
22// as the owning package or wakelock tag. This is interned to reduce trace size.
23// Event bundles refer to interned wakelock info by the iid.
24message AppWakelockInfo {
25  // The interned id of this wakelock.
26  optional int32 iid = 1;
27
28  // The app-provided tag of the wakelock.
29  optional string tag = 2;
30
31  // The wakelock flags (such as partial vs full).
32  optional int32 flags = 3;
33
34  // The pid that created the wakelock.
35  optional int32 owner_pid = 4;
36
37  // The uid that created the wakelock.
38  optional int32 owner_uid = 5;
39
40  // The uid of the work source root (if present).
41  optional int32 work_uid = 6;
42}
43
44// AppWakelockBundle describes one or more wakelock events. Events are written
45// in two paired array, such that the details for event i are in intern_id[i]
46// and encoded_ts[i].
47message AppWakelockBundle {
48  // The interned id for the WakelockInfo of the event.
49  repeated uint32 intern_id = 1 [packed = true];
50
51  // The timestamp and event type, encoded as:
52  //   (event_time - packet_time) << 1 | (acquired ? 1 : 0)
53  repeated uint64 encoded_ts = 2 [packed = true];
54}
55