1/*
2 * Copyright (C) 2020 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// Describes a Chrome thread's attributes. Emitted as part of a TrackDescriptor,
22// usually by the thread's trace writer. Must be paired with a ThreadDescriptor
23// in the same TrackDescriptor.
24//
25// Next id: 3.
26message ChromeThreadDescriptor {
27  enum ThreadType {
28    THREAD_UNSPECIFIED = 0;
29
30    THREAD_MAIN = 1;
31    THREAD_IO = 2;
32
33    THREAD_POOL_BG_WORKER = 3;
34    THREAD_POOL_FG_WORKER = 4;
35    THREAD_POOL_FG_BLOCKING = 5;
36    THREAD_POOL_BG_BLOCKING = 6;
37    THREAD_POOL_SERVICE = 7;
38
39    THREAD_COMPOSITOR = 8;
40    THREAD_VIZ_COMPOSITOR = 9;
41    THREAD_COMPOSITOR_WORKER = 10;
42
43    THREAD_SERVICE_WORKER = 11;
44    THREAD_NETWORK_SERVICE = 12;
45
46    THREAD_CHILD_IO = 13;
47    THREAD_BROWSER_IO = 14;
48
49    THREAD_BROWSER_MAIN = 15;
50    THREAD_RENDERER_MAIN = 16;
51    THREAD_UTILITY_MAIN = 17;
52    THREAD_GPU_MAIN = 18;
53
54    THREAD_CACHE_BLOCKFILE = 19;
55    THREAD_MEDIA = 20;
56    THREAD_AUDIO_OUTPUTDEVICE = 21;
57    THREAD_AUDIO_INPUTDEVICE = 22;
58    THREAD_GPU_MEMORY = 23;
59    THREAD_GPU_VSYNC = 24;
60    THREAD_DXA_VIDEODECODER = 25;
61    THREAD_BROWSER_WATCHDOG = 26;
62    THREAD_WEBRTC_NETWORK = 27;
63    THREAD_WINDOW_OWNER = 28;
64    THREAD_WEBRTC_SIGNALING = 29;
65    THREAD_WEBRTC_WORKER = 30;
66    THREAD_PPAPI_MAIN = 31;
67    THREAD_GPU_WATCHDOG = 32;
68    THREAD_SWAPPER = 33;
69    THREAD_GAMEPAD_POLLING = 34;
70    THREAD_WEBCRYPTO = 35;
71    THREAD_DATABASE = 36;
72    THREAD_PROXYRESOLVER = 37;
73    THREAD_DEVTOOLSADB = 38;
74    THREAD_NETWORKCONFIGWATCHER = 39;
75    THREAD_WASAPI_RENDER = 40;
76
77    THREAD_MEMORY_INFRA = 50;
78    THREAD_SAMPLING_PROFILER = 51;
79  };
80
81  optional ThreadType thread_type = 1;
82
83  // To support old UI. New UI should determine default sorting by thread_type.
84  optional int32 legacy_sort_index = 2;
85}
86