1// Copyright 2016 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8option java_package = "org.chromium.components.metrics"; 9 10option java_outer_classname = "ExecutionContextProtos"; 11 12package metrics; 13 14// Enums corresponding to the Chrome execution context in which data was 15// collected. 16 17// Chrome process type. Derived from content/public/common/process_type.h. 18enum Process { 19 UNKNOWN_PROCESS = 0; 20 BROWSER_PROCESS = 1; 21 RENDERER_PROCESS = 2; 22 GPU_PROCESS = 3; 23 UTILITY_PROCESS = 4; 24 ZYGOTE_PROCESS = 5; 25 SANDBOX_HELPER_PROCESS = 6; 26 PPAPI_PLUGIN_PROCESS = 7; 27 PPAPI_BROKER_PROCESS = 8; 28 NETWORK_SERVICE_PROCESS = 10; 29 30 // A Chrome process not identified by any other enum. Defined for the benefit 31 // of Chrome OS. Do not use for the Chrome sampling profiler; define a new 32 // enum instead. 33 OTHER_PROCESS = 9; 34} 35 36// Chrome thread. This list is not exhaustive. 37enum Thread { 38 UNKNOWN_THREAD = 0; 39 40 // The 'main thread' in various processes. In browser process, this is 41 // sometimes also called the 'ui thread'. 42 MAIN_THREAD = 1; 43 44 FILE_THREAD = 2; // Deprecated. 45 FILE_USER_BLOCKING_THREAD = 3; // Deprecated. 46 PROCESS_LAUNCHER_THREAD = 4; // Deprecated. 47 CACHE_THREAD = 5; // Deprecated. 48 49 IO_THREAD = 6; 50 51 DB_THREAD = 7; // Deprecated. 52 GPU_MAIN_THREAD = 8; // Deprecated. 53 RENDER_THREAD = 9; // Deprecated. 54 UTILITY_THREAD = 10; // Deprecated. 55 56 // Compositor thread (can be in both renderer and gpu processes). 57 COMPOSITOR_THREAD = 11; 58 59 // Task scheduler thread. 60 SCHEDULER_WORKER_THREAD = 13; 61 62 COMPOSITOR_TILE_WORKER_THREAD = 14; 63 64 SERVICE_WORKER_THREAD = 15; 65 66 // DedicatedWorker thread in the renderer process. 67 DEDICATED_WORKER_THREAD = 18; 68 69 // Thread pool thread (can be in different Chrome processes). 70 THREAD_POOL_THREAD = 16; 71 72 // GPU memory thread (in renderer process). 73 GPU_MEMORY_THREAD = 17; 74 75 // The thread for Chrome memory tracing (can be in different processes). 76 MEMORY_INFRA_THREAD = 19; 77 78 // Media thread (in renderer process). 79 MEDIA_THREAD = 20; 80 81 // WebRTC threads, e.g. WebRTC_Signaling,WebRTC_Network (in renderer process). 82 WEBRTC_THREAD = 21; 83 84 // DRM threads (in GPU process). 85 DRM_THREAD = 22; 86 87 // Audio device threads (in renderer process), a worker thread type used to 88 // transfer data between the browser and the renderer process. 89 AUDIO_DEVICE_THREAD = 23; 90 91 // Audio threads that are not in the renderer processes. 92 AUDIO_THREAD = 24; 93 94 // Dav1d worker threads (in renderer process), which runs the AV1 codec. 95 DAV1D_WORKER_THREAD = 25; 96 97 // Stack sampling profiler uses this thread to periodically stop a thread 98 // and get stack execution information. 99 // Spawned at 100 // https://source.chromium.org/chromium/chromium/src/+/main:base/profiler/stack_sampling_profiler.cc;l=379;drc=ada6c70d141251b40840a6cab657737bf63eed9d. 101 STACK_SAMPLING_THREAD = 26; 102 103 // Used for batching frames for video streams. 104 // Spawned at 105 // https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/renderer_blink_platform_impl.cc;l=988;drc=7172fffc3c545134d5c88af8ab07b04fcb1d628e. 106 VIDEO_FRAME_COMPOSITOR_THREAD = 27; 107 108 // A Chrome thread not identified by any other enum. Defined for the benefit 109 // of Chrome OS. Do not use for the Chrome sampling profiler; define a new 110 // enum instead. 111 OTHER_THREAD = 12; 112} 113 114// Process phases, or where in the lifetime of the process it is such as 115// startup, normal operation, shutdown, etc. These don't necessarily occur in 116// the order defined here so it's fine to add new ones to further segregrate 117// the lifetime of a process. 118enum ProcessPhase { 119 // The browser's main message loop has been started. 120 // Based on histogram Startup.MessageLoopStartTime 121 MAIN_LOOP_START = 0; 122 123 // The beginning of navigation in the first web contents' main frame. 124 // Based on histogram Startup.FirstWebContents.MainNavigationStart 125 MAIN_NAVIGATION_START = 1; 126 127 // The navigation is committed (first bytes received) in the first web 128 // contents' main frame. 129 // Based on histogram Startup.FirstWebContents.MainNavigationFinished 130 MAIN_NAVIGATION_FINISHED = 2; 131 132 // First non-empty paint of the first web contents. 133 // Based on histogram Startup.FirstWebContents.NonEmptyPaint2 134 FIRST_NONEMPTY_PAINT = 3; 135 136 // Process shutdown has begun. 137 SHUTDOWN_START = 4; 138} 139