Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1 | // AUTOGENERATED - DO NOT EDIT |
| 2 | // --------------------------- |
| 3 | // This file has been generated by |
| 4 | // AOSP://external/perfetto/tools/gen_merged_protos |
| 5 | // merging the perfetto config protos. |
| 6 | // This fused proto is intended to be copied in: |
| 7 | // - Android tree, for statsd. |
| 8 | // - Google internal repos. |
| 9 | |
| 10 | syntax = "proto2"; |
| 11 | |
| 12 | package perfetto.protos; |
| 13 | |
Primiano Tucci | 64df2ca | 2019-01-03 22:26:47 +0000 | [diff] [blame] | 14 | // Begin of protos/perfetto/common/android_log_constants.proto |
| 15 | |
| 16 | // Values from NDK's android/log.h. |
| 17 | enum AndroidLogId { |
| 18 | LID_DEFAULT = 0; // MAIN. |
| 19 | LID_RADIO = 1; |
| 20 | LID_EVENTS = 2; |
| 21 | LID_SYSTEM = 3; |
| 22 | LID_CRASH = 4; |
| 23 | LID_STATS = 5; |
| 24 | LID_SECURITY = 6; |
| 25 | LID_KERNEL = 7; |
| 26 | } |
| 27 | |
| 28 | enum AndroidLogPriority { |
| 29 | PRIO_UNSPECIFIED = 0; |
| 30 | PRIO_UNUSED = 1; // _DEFAULT, but should never be seen in logs. |
| 31 | PRIO_VERBOSE = 2; |
| 32 | PRIO_DEBUG = 3; |
| 33 | PRIO_INFO = 4; |
| 34 | PRIO_WARN = 5; |
| 35 | PRIO_ERROR = 6; |
| 36 | PRIO_FATAL = 7; |
| 37 | } |
| 38 | |
| 39 | // End of protos/perfetto/common/android_log_constants.proto |
| 40 | |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 41 | // Begin of protos/perfetto/common/data_source_descriptor.proto |
| 42 | |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 43 | // This message is sent from Producer(s) to the tracing Service when registering |
| 44 | // to advertise their capabilities. It describes the structure of tracing |
| 45 | // protos that will be produced by the data source and the supported filters. |
| 46 | message DataSourceDescriptor { |
| 47 | optional string name = 1; // e.g., "linux.ftrace", "chromium.tracing" |
| 48 | |
| 49 | // When true the data source is expected to ack the stop request through the |
| 50 | // NotifyDataSourceStopped() IPC. This field has been introduced after |
| 51 | // Android P in Jul 2018 and is not supported on older versions. |
| 52 | optional bool will_notify_on_stop = 2; |
| 53 | |
| 54 | // When true the data source is expected to ack the start request through the |
| 55 | // NotifyDataSourceStarted() IPC. This field has been introduced after |
| 56 | // Android P in March 2019 and is not supported on older versions. |
| 57 | optional bool will_notify_on_start = 3; |
| 58 | |
| 59 | // If true, opt into receiving the ClearIncrementalState() IPC. This should be |
| 60 | // set if the data source writes packets that refer to previous trace |
| 61 | // contents, and knows how to stop referring to the already-emitted data. |
| 62 | optional bool handles_incremental_state_clear = 4; |
| 63 | |
| 64 | // Optional specification about available GPU counters. |
| 65 | optional GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true]; |
Nicolò Mazzucato | 51c3c95 | 2019-09-03 14:29:44 +0100 | [diff] [blame] | 66 | |
| 67 | optional TrackEventDescriptor track_event_descriptor = 6 [lazy = true]; |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | // End of protos/perfetto/common/data_source_descriptor.proto |
| 71 | |
| 72 | // Begin of protos/perfetto/common/gpu_counter_descriptor.proto |
| 73 | |
| 74 | // Description of GPU counters. |
Ioannis Ilkos | ed80390 | 2019-09-24 11:58:56 +0100 | [diff] [blame] | 75 | // This message is sent by a GPU counter producer to specify the counters |
| 76 | // available in the hardware. |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 77 | message GpuCounterDescriptor { |
| 78 | message GpuCounterSpec { |
| 79 | optional uint32 counter_id = 1; |
| 80 | optional string name = 2; |
| 81 | optional string description = 3; |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 82 | reserved 4; // MeasureUnit unit (deprecated) |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 83 | oneof peak_value { |
| 84 | int64 int_peak_value = 5; |
| 85 | double double_peak_value = 6; |
| 86 | }; |
Peiyong Lin | f8d8233 | 2019-08-22 16:58:09 -0700 | [diff] [blame] | 87 | repeated MeasureUnit numerator_units = 7; |
| 88 | repeated MeasureUnit denominator_units = 8; |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 89 | optional bool select_by_default = 9; |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 90 | } |
| 91 | repeated GpuCounterSpec specs = 1; |
| 92 | |
Ioannis Ilkos | ed80390 | 2019-09-24 11:58:56 +0100 | [diff] [blame] | 93 | // Allow producer to group counters into block to represent counter islands. |
| 94 | // A capacity may be specified to indicate the number of counters that can be |
| 95 | // enable simultaneously in that block. |
Raymond Chiu | b872f97 | 2019-08-27 18:10:32 -0700 | [diff] [blame] | 96 | message GpuCounterBlock { |
| 97 | // required. Unique ID for the counter group. |
| 98 | optional uint32 block_id = 1; |
| 99 | // optional. Number of counters supported by the block. No limit if unset. |
| 100 | optional uint32 block_capacity = 2; |
| 101 | // optional. Name of block. |
| 102 | optional string name = 3; |
| 103 | // optional. Description for the block. |
| 104 | optional string description = 4; |
| 105 | // list of counters that are part of the block. |
| 106 | repeated uint32 counter_ids = 5; |
| 107 | } |
| 108 | repeated GpuCounterBlock blocks = 2; |
| 109 | |
Ioannis Ilkos | ed80390 | 2019-09-24 11:58:56 +0100 | [diff] [blame] | 110 | // optional. Minimum sampling period supported by the producer in |
| 111 | // nanoseconds. |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 112 | optional uint64 min_sampling_period_ns = 3; |
| 113 | |
Ioannis Ilkos | ed80390 | 2019-09-24 11:58:56 +0100 | [diff] [blame] | 114 | // optional. Maximum sampling period supported by the producer in |
| 115 | // nanoseconds. |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 116 | optional uint64 max_sampling_period_ns = 4; |
| 117 | |
Ioannis Ilkos | ed80390 | 2019-09-24 11:58:56 +0100 | [diff] [blame] | 118 | // optional. The producer supports counter sampling by instrumenting the |
| 119 | // command buffer. |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 120 | optional bool supports_instrumented_sampling = 5; |
| 121 | |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 122 | enum MeasureUnit { |
Peiyong Lin | f8d8233 | 2019-08-22 16:58:09 -0700 | [diff] [blame] | 123 | NONE = 0; |
| 124 | |
| 125 | BIT = 1; |
| 126 | KILOBIT = 2; |
| 127 | MEGABIT = 3; |
| 128 | GIGABIT = 4; |
| 129 | TERABIT = 5; |
| 130 | PETABIT = 6; |
| 131 | |
| 132 | BYTE = 7; |
| 133 | KILOBYTE = 8; |
| 134 | MEGABYTE = 9; |
| 135 | GIGABYTE = 10; |
| 136 | TERABYTE = 11; |
| 137 | PETABYTE = 12; |
| 138 | |
| 139 | HERTZ = 13; |
| 140 | KILOHERTZ = 14; |
| 141 | MEGAHERTZ = 15; |
| 142 | GIGAHERTZ = 16; |
| 143 | TERAHERTZ = 17; |
| 144 | PETAHERTZ = 18; |
| 145 | |
| 146 | NANOSECOND = 19; |
| 147 | MICROSECOND = 20; |
| 148 | MILLISECOND = 21; |
| 149 | SECOND = 22; |
| 150 | MINUTE = 23; |
| 151 | HOUR = 24; |
| 152 | |
| 153 | VERTEX = 25; |
| 154 | PIXEL = 26; |
| 155 | TRIANGLE = 27; |
| 156 | |
| 157 | MILLIWATT = 28; |
| 158 | WATT = 29; |
| 159 | KILOWATT = 30; |
| 160 | |
| 161 | JOULE = 31; |
| 162 | VOLT = 32; |
| 163 | AMPERE = 33; |
| 164 | |
| 165 | CELSIUS = 34; |
| 166 | FAHRENHEIT = 35; |
| 167 | KELVIN = 36; |
| 168 | |
| 169 | PERCENT = 37; |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 170 | }; |
| 171 | } |
| 172 | |
| 173 | // End of protos/perfetto/common/gpu_counter_descriptor.proto |
| 174 | |
Primiano Tucci | 82a8bfd | 2018-09-19 11:33:04 +0100 | [diff] [blame] | 175 | // Begin of protos/perfetto/common/sys_stats_counters.proto |
| 176 | |
| 177 | // When editing entries here remember also to update "sys_stats_counters.h" with |
| 178 | // the corresponding string definitions for the actual /proc files parser. |
| 179 | |
| 180 | // Counter definitions for Linux's /proc/meminfo. |
| 181 | enum MeminfoCounters { |
| 182 | MEMINFO_UNSPECIFIED = 0; |
| 183 | MEMINFO_MEM_TOTAL = 1; |
| 184 | MEMINFO_MEM_FREE = 2; |
| 185 | MEMINFO_MEM_AVAILABLE = 3; |
| 186 | MEMINFO_BUFFERS = 4; |
| 187 | MEMINFO_CACHED = 5; |
| 188 | MEMINFO_SWAP_CACHED = 6; |
| 189 | MEMINFO_ACTIVE = 7; |
| 190 | MEMINFO_INACTIVE = 8; |
| 191 | MEMINFO_ACTIVE_ANON = 9; |
| 192 | MEMINFO_INACTIVE_ANON = 10; |
| 193 | MEMINFO_ACTIVE_FILE = 11; |
| 194 | MEMINFO_INACTIVE_FILE = 12; |
| 195 | MEMINFO_UNEVICTABLE = 13; |
| 196 | MEMINFO_MLOCKED = 14; |
| 197 | MEMINFO_SWAP_TOTAL = 15; |
| 198 | MEMINFO_SWAP_FREE = 16; |
| 199 | MEMINFO_DIRTY = 17; |
| 200 | MEMINFO_WRITEBACK = 18; |
| 201 | MEMINFO_ANON_PAGES = 19; |
| 202 | MEMINFO_MAPPED = 20; |
| 203 | MEMINFO_SHMEM = 21; |
| 204 | MEMINFO_SLAB = 22; |
| 205 | MEMINFO_SLAB_RECLAIMABLE = 23; |
| 206 | MEMINFO_SLAB_UNRECLAIMABLE = 24; |
| 207 | MEMINFO_KERNEL_STACK = 25; |
| 208 | MEMINFO_PAGE_TABLES = 26; |
| 209 | MEMINFO_COMMIT_LIMIT = 27; |
| 210 | MEMINFO_COMMITED_AS = 28; |
| 211 | MEMINFO_VMALLOC_TOTAL = 29; |
| 212 | MEMINFO_VMALLOC_USED = 30; |
| 213 | MEMINFO_VMALLOC_CHUNK = 31; |
| 214 | MEMINFO_CMA_TOTAL = 32; |
| 215 | MEMINFO_CMA_FREE = 33; |
| 216 | } |
| 217 | |
| 218 | // Counter definitions for Linux's /proc/vmstat. |
| 219 | enum VmstatCounters { |
| 220 | VMSTAT_UNSPECIFIED = 0; |
| 221 | VMSTAT_NR_FREE_PAGES = 1; |
| 222 | VMSTAT_NR_ALLOC_BATCH = 2; |
| 223 | VMSTAT_NR_INACTIVE_ANON = 3; |
| 224 | VMSTAT_NR_ACTIVE_ANON = 4; |
| 225 | VMSTAT_NR_INACTIVE_FILE = 5; |
| 226 | VMSTAT_NR_ACTIVE_FILE = 6; |
| 227 | VMSTAT_NR_UNEVICTABLE = 7; |
| 228 | VMSTAT_NR_MLOCK = 8; |
| 229 | VMSTAT_NR_ANON_PAGES = 9; |
| 230 | VMSTAT_NR_MAPPED = 10; |
| 231 | VMSTAT_NR_FILE_PAGES = 11; |
| 232 | VMSTAT_NR_DIRTY = 12; |
| 233 | VMSTAT_NR_WRITEBACK = 13; |
| 234 | VMSTAT_NR_SLAB_RECLAIMABLE = 14; |
| 235 | VMSTAT_NR_SLAB_UNRECLAIMABLE = 15; |
| 236 | VMSTAT_NR_PAGE_TABLE_PAGES = 16; |
| 237 | VMSTAT_NR_KERNEL_STACK = 17; |
| 238 | VMSTAT_NR_OVERHEAD = 18; |
| 239 | VMSTAT_NR_UNSTABLE = 19; |
| 240 | VMSTAT_NR_BOUNCE = 20; |
| 241 | VMSTAT_NR_VMSCAN_WRITE = 21; |
| 242 | VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22; |
| 243 | VMSTAT_NR_WRITEBACK_TEMP = 23; |
| 244 | VMSTAT_NR_ISOLATED_ANON = 24; |
| 245 | VMSTAT_NR_ISOLATED_FILE = 25; |
| 246 | VMSTAT_NR_SHMEM = 26; |
| 247 | VMSTAT_NR_DIRTIED = 27; |
| 248 | VMSTAT_NR_WRITTEN = 28; |
| 249 | VMSTAT_NR_PAGES_SCANNED = 29; |
| 250 | VMSTAT_WORKINGSET_REFAULT = 30; |
| 251 | VMSTAT_WORKINGSET_ACTIVATE = 31; |
| 252 | VMSTAT_WORKINGSET_NODERECLAIM = 32; |
| 253 | VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33; |
| 254 | VMSTAT_NR_FREE_CMA = 34; |
| 255 | VMSTAT_NR_SWAPCACHE = 35; |
| 256 | VMSTAT_NR_DIRTY_THRESHOLD = 36; |
| 257 | VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37; |
| 258 | VMSTAT_PGPGIN = 38; |
| 259 | VMSTAT_PGPGOUT = 39; |
| 260 | VMSTAT_PGPGOUTCLEAN = 40; |
| 261 | VMSTAT_PSWPIN = 41; |
| 262 | VMSTAT_PSWPOUT = 42; |
| 263 | VMSTAT_PGALLOC_DMA = 43; |
| 264 | VMSTAT_PGALLOC_NORMAL = 44; |
| 265 | VMSTAT_PGALLOC_MOVABLE = 45; |
| 266 | VMSTAT_PGFREE = 46; |
| 267 | VMSTAT_PGACTIVATE = 47; |
| 268 | VMSTAT_PGDEACTIVATE = 48; |
| 269 | VMSTAT_PGFAULT = 49; |
| 270 | VMSTAT_PGMAJFAULT = 50; |
| 271 | VMSTAT_PGREFILL_DMA = 51; |
| 272 | VMSTAT_PGREFILL_NORMAL = 52; |
| 273 | VMSTAT_PGREFILL_MOVABLE = 53; |
| 274 | VMSTAT_PGSTEAL_KSWAPD_DMA = 54; |
| 275 | VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55; |
| 276 | VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56; |
| 277 | VMSTAT_PGSTEAL_DIRECT_DMA = 57; |
| 278 | VMSTAT_PGSTEAL_DIRECT_NORMAL = 58; |
| 279 | VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59; |
| 280 | VMSTAT_PGSCAN_KSWAPD_DMA = 60; |
| 281 | VMSTAT_PGSCAN_KSWAPD_NORMAL = 61; |
| 282 | VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62; |
| 283 | VMSTAT_PGSCAN_DIRECT_DMA = 63; |
| 284 | VMSTAT_PGSCAN_DIRECT_NORMAL = 64; |
| 285 | VMSTAT_PGSCAN_DIRECT_MOVABLE = 65; |
| 286 | VMSTAT_PGSCAN_DIRECT_THROTTLE = 66; |
| 287 | VMSTAT_PGINODESTEAL = 67; |
| 288 | VMSTAT_SLABS_SCANNED = 68; |
| 289 | VMSTAT_KSWAPD_INODESTEAL = 69; |
| 290 | VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70; |
| 291 | VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71; |
| 292 | VMSTAT_PAGEOUTRUN = 72; |
| 293 | VMSTAT_ALLOCSTALL = 73; |
| 294 | VMSTAT_PGROTATED = 74; |
| 295 | VMSTAT_DROP_PAGECACHE = 75; |
| 296 | VMSTAT_DROP_SLAB = 76; |
| 297 | VMSTAT_PGMIGRATE_SUCCESS = 77; |
| 298 | VMSTAT_PGMIGRATE_FAIL = 78; |
| 299 | VMSTAT_COMPACT_MIGRATE_SCANNED = 79; |
| 300 | VMSTAT_COMPACT_FREE_SCANNED = 80; |
| 301 | VMSTAT_COMPACT_ISOLATED = 81; |
| 302 | VMSTAT_COMPACT_STALL = 82; |
| 303 | VMSTAT_COMPACT_FAIL = 83; |
| 304 | VMSTAT_COMPACT_SUCCESS = 84; |
| 305 | VMSTAT_COMPACT_DAEMON_WAKE = 85; |
| 306 | VMSTAT_UNEVICTABLE_PGS_CULLED = 86; |
| 307 | VMSTAT_UNEVICTABLE_PGS_SCANNED = 87; |
| 308 | VMSTAT_UNEVICTABLE_PGS_RESCUED = 88; |
| 309 | VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89; |
| 310 | VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90; |
| 311 | VMSTAT_UNEVICTABLE_PGS_CLEARED = 91; |
| 312 | VMSTAT_UNEVICTABLE_PGS_STRANDED = 92; |
Primiano Tucci | 1eb966d | 2019-06-06 15:40:09 +0100 | [diff] [blame] | 313 | VMSTAT_NR_ZSPAGES = 93; |
| 314 | VMSTAT_NR_ION_HEAP = 94; |
| 315 | VMSTAT_NR_GPU_HEAP = 95; |
Primiano Tucci | 82a8bfd | 2018-09-19 11:33:04 +0100 | [diff] [blame] | 316 | } |
| 317 | // End of protos/perfetto/common/sys_stats_counters.proto |
| 318 | |
Ryan Savitski | 41ce459 | 2019-05-02 14:43:59 +0100 | [diff] [blame] | 319 | // Begin of protos/perfetto/common/trace_stats.proto |
| 320 | |
| 321 | // Statistics for the internals of the tracing service. |
| 322 | // |
| 323 | // Next id: 10. |
| 324 | message TraceStats { |
| 325 | // From TraceBuffer::Stats. |
| 326 | // |
Eric Seckler | a516164 | 2019-08-02 14:03:32 +0100 | [diff] [blame] | 327 | // Next id: 20. |
Ryan Savitski | 41ce459 | 2019-05-02 14:43:59 +0100 | [diff] [blame] | 328 | message BufferStats { |
| 329 | // Size of the circular buffer in bytes. |
| 330 | optional uint64 buffer_size = 12; |
| 331 | |
| 332 | // Num. bytes written into the circular buffer, including chunk headers. |
| 333 | optional uint64 bytes_written = 1; |
| 334 | |
| 335 | // Num. bytes overwritten before they have been read (i.e. loss of data). |
| 336 | optional uint64 bytes_overwritten = 13; |
| 337 | |
| 338 | // Total size of chunks that were fully read from the circular buffer by the |
| 339 | // consumer. This may not be equal to |bytes_written| either in the middle |
| 340 | // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the |
| 341 | // size of the chunks read from the buffer, including chunk headers, which |
| 342 | // will be different from the total size of packets returned to the |
| 343 | // consumer. |
| 344 | // |
| 345 | // The current utilization of the trace buffer (mid-tracing) can be obtained |
| 346 | // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|, |
| 347 | // adding the difference of |padding_bytes_written| and |
| 348 | // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|. |
| 349 | // Note that this represents the total size of buffered data in the buffer, |
| 350 | // yet this data may be spread non-contiguously through the buffer and may |
| 351 | // be overridden before the utilization reaches 100%. |
| 352 | optional uint64 bytes_read = 14; |
| 353 | |
| 354 | // Num. bytes that were allocated as padding between chunks in the circular |
| 355 | // buffer. |
| 356 | optional uint64 padding_bytes_written = 15; |
| 357 | |
| 358 | // Num. of padding bytes that were removed from the circular buffer when |
| 359 | // they were overwritten. |
| 360 | // |
| 361 | // The difference between |padding_bytes_written| and |
| 362 | // |padding_bytes_cleared| denotes the total size of padding currently |
| 363 | // present in the buffer. |
| 364 | optional uint64 padding_bytes_cleared = 16; |
| 365 | |
| 366 | // Num. chunks (!= packets) written into the buffer. |
| 367 | optional uint64 chunks_written = 2; |
| 368 | |
| 369 | // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote |
| 370 | // the same chunk with additional packets appended to the end. |
| 371 | optional uint64 chunks_rewritten = 10; |
| 372 | |
| 373 | // Num. chunks overwritten before they have been read (i.e. loss of data). |
| 374 | optional uint64 chunks_overwritten = 3; |
| 375 | |
| 376 | // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer |
| 377 | // is configured with FillPolicy == DISCARD. |
| 378 | optional uint64 chunks_discarded = 18; |
| 379 | |
| 380 | // Num. chunks (!= packets) that were fully read from the circular buffer by |
| 381 | // the consumer. This may not be equal to |chunks_written| either in the |
| 382 | // middle of tracing, or if |chunks_overwritten| is non-zero. |
| 383 | optional uint64 chunks_read = 17; |
| 384 | |
| 385 | // Num. chunks that were committed out of order. |
| 386 | optional uint64 chunks_committed_out_of_order = 11; |
| 387 | |
| 388 | // Num. times the ring buffer wrapped around. |
| 389 | optional uint64 write_wrap_count = 4; |
| 390 | |
| 391 | // Num. out-of-band (OOB) patches that succeeded. |
| 392 | optional uint64 patches_succeeded = 5; |
| 393 | |
| 394 | // Num. OOB patches that failed (e.g., the chunk to patch was gone). |
| 395 | optional uint64 patches_failed = 6; |
| 396 | |
| 397 | // Num. readaheads (for large multi-chunk packet reads) that ended up in a |
| 398 | // successful packet read. |
| 399 | optional uint64 readaheads_succeeded = 7; |
| 400 | |
| 401 | // Num. readaheads aborted because of missing chunks in the sequence stream. |
| 402 | // Note that a small number > 0 is totally expected: occasionally, when |
| 403 | // issuing a read, the very last packet in a sequence might be incomplete |
| 404 | // (because the producer is still writing it while we read). The read will |
| 405 | // stop at that point, for that sequence, increasing this counter. |
| 406 | optional uint64 readaheads_failed = 8; |
| 407 | |
| 408 | // Num. of violations of the SharedMemoryABI found while writing or reading |
| 409 | // the buffer. This is an indication of either a bug in the producer(s) or |
| 410 | // malicious producer(s). |
| 411 | optional uint64 abi_violations = 9; |
Eric Seckler | a516164 | 2019-08-02 14:03:32 +0100 | [diff] [blame] | 412 | |
| 413 | // The fields below have been introduced in Android R. |
| 414 | |
| 415 | // Num. of times the service detected packet loss on a trace writer |
| 416 | // sequence. This is usually caused by exhaustion of available chunks in the |
| 417 | // writer process's SMB. Note that this relies on the client's TraceWriter |
| 418 | // indicating this loss to the service -- packets lost for other reasons are |
| 419 | // not reflected in this stat. |
| 420 | optional uint64 trace_writer_packet_loss = 19; |
Ryan Savitski | 41ce459 | 2019-05-02 14:43:59 +0100 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | // Stats for the TraceBuffer(s) of the current trace session. |
| 424 | repeated BufferStats buffer_stats = 1; |
| 425 | |
| 426 | // Num. producers connected (whether they are involved in the current tracing |
| 427 | // session or not). |
| 428 | optional uint32 producers_connected = 2; |
| 429 | |
| 430 | // Num. producers ever seen for all trace sessions since startup (it's a good |
| 431 | // proxy for inferring num. producers crashed / killed). |
| 432 | optional uint64 producers_seen = 3; |
| 433 | |
| 434 | // Num. data sources registered for all trace sessions. |
| 435 | optional uint32 data_sources_registered = 4; |
| 436 | |
| 437 | // Num. data sources ever seen for all trace sessions since startup. |
| 438 | optional uint64 data_sources_seen = 5; |
| 439 | |
| 440 | // Num. concurrently active tracing sessions. |
| 441 | optional uint32 tracing_sessions = 6; |
| 442 | |
| 443 | // Num. buffers for all tracing session (not just the current one). This will |
| 444 | // be >= buffer_stats.size(), because the latter is only about the current |
| 445 | // session. |
| 446 | optional uint32 total_buffers = 7; |
| 447 | |
| 448 | // The fields below have been introduced in Android Q. |
| 449 | |
| 450 | // Num. chunks that were discarded by the service before attempting to commit |
| 451 | // them to a buffer, e.g. because the producer specified an invalid buffer ID. |
| 452 | optional uint64 chunks_discarded = 8; |
| 453 | |
| 454 | // Num. patches that were discarded by the service before attempting to apply |
| 455 | // them to a buffer, e.g. because the producer specified an invalid buffer ID. |
| 456 | optional uint64 patches_discarded = 9; |
Florian Mayer | f2d4569 | 2019-07-25 16:03:48 +0100 | [diff] [blame] | 457 | |
| 458 | // Packets that failed validation of the TrustedPacket. If this is > 0, there |
| 459 | // is a bug in the producer. |
| 460 | optional uint64 invalid_packets = 10; |
Ryan Savitski | 41ce459 | 2019-05-02 14:43:59 +0100 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | // End of protos/perfetto/common/trace_stats.proto |
| 464 | |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 465 | // Begin of protos/perfetto/common/tracing_service_state.proto |
| 466 | |
Peiyong Lin | cbcc21f | 2019-08-19 17:13:38 -0700 | [diff] [blame] | 467 | // Reports the state of the tracing service. Used to gather details about the |
| 468 | // data sources connected. |
| 469 | // See ConsumerPort::QueryServiceState(). |
| 470 | message TracingServiceState { |
| 471 | // Describes a producer process. |
| 472 | message Producer { |
| 473 | optional int32 id = 1; // Unique ID of the producer (monotonic counter). |
| 474 | optional string name = 2; // Typically matches the process name. |
| 475 | optional int32 uid = 3; // Unix uid of the remote process. |
| 476 | } |
| 477 | |
| 478 | // Describes a data source registered by a producer. Data sources are listed |
| 479 | // regardless of the fact that they are being used or not. |
| 480 | message DataSource { |
| 481 | // Descriptor passed by the data source when calling RegisterDataSource(). |
| 482 | optional DataSourceDescriptor ds_descriptor = 1; |
| 483 | |
| 484 | // ID of the producer, as per Producer.id. |
| 485 | optional int32 producer_id = 2; |
| 486 | } |
| 487 | |
| 488 | // Lists all the producers connected. |
| 489 | repeated Producer producers = 1; |
| 490 | |
| 491 | // Lists the data sources available. |
| 492 | repeated DataSource data_sources = 2; |
| 493 | |
| 494 | // Total number of tracing sessions. |
| 495 | optional int32 num_sessions = 3; |
| 496 | |
| 497 | // Number of tracing sessions in the started state. Always <= num_sessions. |
| 498 | optional int32 num_sessions_started = 4; |
| 499 | } |
| 500 | |
| 501 | // End of protos/perfetto/common/tracing_service_state.proto |
| 502 | |
Nicolò Mazzucato | 51c3c95 | 2019-09-03 14:29:44 +0100 | [diff] [blame] | 503 | // Begin of protos/perfetto/common/track_event_descriptor.proto |
| 504 | |
| 505 | message TrackEventDescriptor { |
| 506 | repeated string available_categories = 1; |
| 507 | } |
| 508 | |
| 509 | // End of protos/perfetto/common/track_event_descriptor.proto |
| 510 | |
Primiano Tucci | 64df2ca | 2019-01-03 22:26:47 +0000 | [diff] [blame] | 511 | // Begin of protos/perfetto/trace/android/android_log.proto |
| 512 | |
| 513 | message AndroidLogPacket { |
| 514 | message LogEvent { |
| 515 | // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from. |
| 516 | optional AndroidLogId log_id = 1; |
| 517 | |
| 518 | // PID (TGID), TID and UID of the task that emitted the event. |
| 519 | optional int32 pid = 2; |
| 520 | optional int32 tid = 3; |
| 521 | optional int32 uid = 4; |
| 522 | |
| 523 | // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other |
| 524 | // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace |
| 525 | // processor will take care of realigning clocks using the ClockSnapshot(s). |
| 526 | optional uint64 timestamp = 5; |
| 527 | |
| 528 | // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in |
| 529 | // the second column of /system/etc/event-log-tags. For all other events, |
| 530 | // |tag| is the app-specified argument passed to __android_log_write(). |
| 531 | optional string tag = 6; |
| 532 | |
| 533 | // Empty when log_id == LID_EVENTS. |
| 534 | optional AndroidLogPriority prio = 7; |
| 535 | |
| 536 | // Empty when log_id == LID_EVENTS. |
| 537 | optional string message = 8; |
| 538 | |
| 539 | message Arg { |
| 540 | optional string name = 1; |
| 541 | oneof value { |
| 542 | int64 int_value = 2; |
| 543 | float float_value = 3; |
| 544 | string string_value = 4; |
| 545 | } |
| 546 | } |
| 547 | // Only populated when log_id == LID_EVENTS. |
| 548 | repeated Arg args = 9; |
| 549 | } |
| 550 | |
| 551 | repeated LogEvent events = 1; |
| 552 | |
| 553 | // Stats are emitted only upon Flush() and are monotonic (i.e. they are |
| 554 | // absolute counters since the beginning of the lifetime of the tracing |
| 555 | // session and NOT relative to the previous Stats snapshot). |
| 556 | message Stats { |
| 557 | // Total number of log events seen, including errors and skipped entries |
| 558 | // (num of events stored in the trace = total - failed - skipped). |
| 559 | optional uint64 num_total = 1; |
| 560 | |
| 561 | // Parser failures. |
| 562 | optional uint64 num_failed = 2; |
| 563 | |
| 564 | // Messages skipped due to filters. |
| 565 | optional uint64 num_skipped = 3; |
| 566 | } |
| 567 | optional Stats stats = 2; |
| 568 | } |
| 569 | |
| 570 | // End of protos/perfetto/trace/android/android_log.proto |
| 571 | |
Mikael Pessa | 625a091 | 2019-07-24 15:28:16 -0700 | [diff] [blame] | 572 | // Begin of protos/perfetto/trace/android/graphics_frame_event.proto |
| 573 | |
| 574 | // Generated by Android's SurfaceFlinger. |
| 575 | message GraphicsFrameEvent { |
| 576 | enum BufferEventType { |
| 577 | UNSPECIFIED = 0; |
| 578 | DEQUEUE = 1; |
| 579 | QUEUE = 2; |
| 580 | POST = 3; |
| 581 | ACQUIRE_FENCE = 4; |
| 582 | LATCH = 5; |
| 583 | HWC_COMPOSITION_QUEUED = 6; // HWC will compose this buffer |
| 584 | FALLBACK_COMPOSITION = 7; // renderEngine composition |
| 585 | PRESENT_FENCE = 8; |
| 586 | RELEASE_FENCE = 9; |
| 587 | MODIFY = 10; |
| 588 | } |
| 589 | |
| 590 | message BufferEvent { |
| 591 | optional uint32 frame_number = 1; |
| 592 | optional BufferEventType type = 2; |
| 593 | optional string layer_name = 3; |
| 594 | // If no duration is set, the event is an instant event. |
| 595 | optional uint64 duration_ns = 4; |
| 596 | // Unique buffer identifier. |
| 597 | optional uint32 buffer_id = 5; |
| 598 | } |
| 599 | |
| 600 | optional BufferEvent buffer_event = 1; |
| 601 | } |
| 602 | |
| 603 | // End of protos/perfetto/trace/android/graphics_frame_event.proto |
| 604 | |
Florian Mayer | 12f0f8e | 2019-04-02 12:31:13 +0100 | [diff] [blame] | 605 | // Begin of protos/perfetto/trace/android/packages_list.proto |
| 606 | |
| 607 | message PackagesList { |
Florian Mayer | e764741 | 2019-04-04 11:00:51 +0100 | [diff] [blame] | 608 | message PackageInfo { |
Florian Mayer | 12f0f8e | 2019-04-02 12:31:13 +0100 | [diff] [blame] | 609 | optional string name = 1; |
| 610 | optional uint64 uid = 2; |
| 611 | optional bool debuggable = 3; |
| 612 | optional bool profileable_from_shell = 4; |
| 613 | optional int64 version_code = 5; |
| 614 | } |
| 615 | |
Florian Mayer | e764741 | 2019-04-04 11:00:51 +0100 | [diff] [blame] | 616 | repeated PackageInfo packages = 1; |
Florian Mayer | 12f0f8e | 2019-04-02 12:31:13 +0100 | [diff] [blame] | 617 | |
Florian Mayer | 03918af | 2019-04-04 10:44:26 +0100 | [diff] [blame] | 618 | // At least one error occurred parsing the packages.list. |
Florian Mayer | e764741 | 2019-04-04 11:00:51 +0100 | [diff] [blame] | 619 | optional bool parse_error = 2; |
| 620 | |
| 621 | // Failed to open / read packages.list. |
| 622 | optional bool read_error = 3; |
Florian Mayer | 12f0f8e | 2019-04-02 12:31:13 +0100 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | // End of protos/perfetto/trace/android/packages_list.proto |
| 626 | |
Mikhail Khokhlov | 5b60af5 | 2019-05-15 10:09:34 +0100 | [diff] [blame] | 627 | // Begin of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto |
| 628 | |
| 629 | // This message is not intended to be written by the chrome on the device. |
| 630 | // It's emitted on the host by the telemetry benchmark infrastructure (it's a |
| 631 | // part of the trace that's written by the telemetry tracing agent). |
| 632 | message ChromeBenchmarkMetadata { |
| 633 | // Time when the benchmark execution started (host unixtime in microseconds). |
| 634 | optional int64 benchmark_start_time_us = 1; |
| 635 | |
| 636 | // Time when this particular story was run (host unixtime in microseconds). |
| 637 | optional int64 story_run_time_us = 2; |
| 638 | |
| 639 | // Name of benchmark. |
| 640 | optional string benchmark_name = 3; |
| 641 | |
| 642 | // Description of benchmark. |
| 643 | optional string benchmark_description = 4; |
| 644 | |
| 645 | // Optional label. |
| 646 | optional string label = 5; |
| 647 | |
| 648 | // Name of story. |
| 649 | optional string story_name = 6; |
| 650 | |
| 651 | // List of story tags. |
| 652 | repeated string story_tags = 7; |
| 653 | |
| 654 | // Index of the story run (>0 if the same story was run several times). |
| 655 | optional int32 story_run_index = 8; |
| 656 | |
| 657 | // Whether this run failed. |
| 658 | optional bool had_failures = 9; |
| 659 | } |
| 660 | |
| 661 | // End of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto |
| 662 | |
Siddhartha S | 1239fb3 | 2019-06-06 11:17:13 -0700 | [diff] [blame] | 663 | // Begin of protos/perfetto/trace/chrome/chrome_metadata.proto |
| 664 | |
| 665 | // Metadata for chrome traces. |
| 666 | message ChromeMetadataPacket { |
| 667 | optional BackgroundTracingMetadata background_tracing_metadata = 1; |
ssid | bda2022 | 2019-08-19 12:02:51 -0700 | [diff] [blame] | 668 | |
| 669 | // Version code of Chrome used by Android's Play Store. This field is only set |
| 670 | // on Android. |
| 671 | optional int32 chrome_version_code = 2; |
Siddhartha S | 1239fb3 | 2019-06-06 11:17:13 -0700 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | // Metadata related to background tracing scenarios, states and triggers. |
| 675 | message BackgroundTracingMetadata { |
| 676 | // Information about a trigger rule defined in the experiment config. |
| 677 | message TriggerRule { |
| 678 | enum TriggerType { |
| 679 | TRIGGER_UNSPECIFIED = 0; |
| 680 | |
| 681 | // Traces are triggered by specific range of values of an UMA histogram. |
| 682 | MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1; |
| 683 | |
| 684 | // Traces are triggered by specific named events in chromium codebase, |
| 685 | // like "second-update-failure". |
| 686 | MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2; |
| 687 | } |
| 688 | optional TriggerType trigger_type = 1; |
| 689 | |
| 690 | // Configuration of histogram trigger. |
| 691 | message HistogramRule { |
| 692 | // UMA histogram name hash, same as HistogramEventProto.name_hash. |
| 693 | optional fixed64 histogram_name_hash = 1; |
| 694 | |
| 695 | // Range of values of the histogram that activates trigger. |
| 696 | optional int64 histogram_min_trigger = 2; |
| 697 | optional int64 histogram_max_trigger = 3; |
| 698 | } |
| 699 | optional HistogramRule histogram_rule = 2; |
| 700 | |
| 701 | // Configuration of named trigger. |
| 702 | message NamedRule { |
| 703 | enum EventType { |
| 704 | UNSPECIFIED = 0; |
| 705 | SESSION_RESTORE = 1; |
| 706 | NAVIGATION = 2; |
| 707 | STARTUP = 3; |
| 708 | |
| 709 | TEST_RULE = 1000; |
| 710 | } |
| 711 | optional EventType event_type = 1; |
| 712 | } |
| 713 | optional NamedRule named_rule = 3; |
| 714 | } |
| 715 | |
| 716 | // Specifies the rule that caused the trace to be uploaded. |
| 717 | optional TriggerRule triggered_rule = 1; |
| 718 | |
| 719 | // List of all active triggers in current session, when trace was triggered. |
| 720 | repeated TriggerRule active_rules = 2; |
| 721 | } |
| 722 | |
| 723 | // End of protos/perfetto/trace/chrome/chrome_metadata.proto |
| 724 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 725 | // Begin of protos/perfetto/trace/clock_snapshot.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 726 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 727 | // A snapshot of clock readings to allow for trace alignment. |
| 728 | message ClockSnapshot { |
| 729 | message Clock { |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 730 | enum BuiltinClocks { |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 731 | UNKNOWN = 0; |
| 732 | REALTIME = 1; |
| 733 | REALTIME_COARSE = 2; |
| 734 | MONOTONIC = 3; |
| 735 | MONOTONIC_COARSE = 4; |
| 736 | MONOTONIC_RAW = 5; |
| 737 | BOOTTIME = 6; |
| 738 | PROCESS_CPUTIME = 7; |
| 739 | THREAD_CPUTIME = 8; |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 740 | BUILTIN_CLOCK_MAX_ID = 63; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 741 | } |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 742 | |
| 743 | // Clock IDs have the following semantic: |
| 744 | // [1, 63]: Builtin types, see BuiltinClocks above. |
| 745 | // [64, 127]: User-defined clocks. These clocks are sequence-scoped. They |
| 746 | // are only valid within the same |trusted_packet_sequence_id| |
| 747 | // (i.e. only for TracePacket(s) emitted by the same TraceWriter |
| 748 | // that emitted the clock snapshot). |
| 749 | // [128, MAX]: Reserved for future use. The idea is to allow global clock |
| 750 | // IDs and setting this ID to hash(full_clock_name) & ~127. |
| 751 | optional uint32 clock_id = 1; |
| 752 | |
| 753 | // Unit is ns unless specified otherwise by the resolution_* fields below. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 754 | optional uint64 timestamp = 2; |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 755 | |
| 756 | // TODO(eseckler): the fields below and sequence-scoped clock IDs are not |
| 757 | // supported yet by the trace processor. |
| 758 | |
| 759 | // When true the timestamp should be interpreted as a delta from the last |
| 760 | // TracePacket's timestamp emitted by the same packet_sequence_id. |
| 761 | // The first packet timestamp after a ClockSnapshot is relative to the last |
| 762 | // ClockSnapshot seen on the packet sequence. |
| 763 | // optional bool is_incremental = 3; |
| 764 | |
| 765 | // Allows to specify a custom unit different than the default (ns) |
| 766 | // for this clock domain. A multiplier of 1000 means that a timestamp = 3 |
| 767 | // should be interpreted as 3000 ns = 3 us. |
| 768 | // optional uint64 unit_multiplier_ns = 4; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 769 | } |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 770 | repeated Clock clocks = 1; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 771 | } |
| 772 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 773 | // End of protos/perfetto/trace/clock_snapshot.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 774 | |
Florian Mayer | beba726 | 2018-04-17 19:05:43 +0100 | [diff] [blame] | 775 | // Begin of protos/perfetto/trace/filesystem/inode_file_map.proto |
| 776 | |
| 777 | // Represents the mapping between inode numbers in a block device and their path |
| 778 | // on the filesystem |
| 779 | message InodeFileMap { |
| 780 | // Representation of Entry |
| 781 | message Entry { |
| 782 | optional uint64 inode_number = 1; |
| 783 | |
| 784 | // The path to the file, e.g. "etc/file.xml" |
| 785 | // List of strings for multiple hardlinks |
| 786 | repeated string paths = 2; |
| 787 | |
| 788 | // The file type |
| 789 | enum Type { |
| 790 | UNKNOWN = 0; |
| 791 | FILE = 1; |
| 792 | DIRECTORY = 2; |
| 793 | } |
| 794 | optional Type type = 3; |
| 795 | } |
| 796 | |
| 797 | optional uint64 block_device_id = 1; |
| 798 | |
| 799 | // The mount points of the block device, e.g. ["system"]. |
| 800 | repeated string mount_points = 2; |
| 801 | |
| 802 | // The list of all the entries from the block device |
| 803 | repeated Entry entries = 3; |
| 804 | } |
| 805 | |
| 806 | // End of protos/perfetto/trace/filesystem/inode_file_map.proto |
| 807 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 808 | // Begin of protos/perfetto/trace/ftrace/binder.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 809 | |
| 810 | message BinderTransactionFtraceEvent { |
| 811 | optional int32 debug_id = 1; |
| 812 | optional int32 target_node = 2; |
| 813 | optional int32 to_proc = 3; |
| 814 | optional int32 to_thread = 4; |
| 815 | optional int32 reply = 5; |
| 816 | optional uint32 code = 6; |
| 817 | optional uint32 flags = 7; |
| 818 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 819 | message BinderTransactionReceivedFtraceEvent { |
| 820 | optional int32 debug_id = 1; |
| 821 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 822 | message BinderSetPriorityFtraceEvent { |
| 823 | optional int32 proc = 1; |
| 824 | optional int32 thread = 2; |
| 825 | optional uint32 old_prio = 3; |
| 826 | optional uint32 new_prio = 4; |
| 827 | optional uint32 desired_prio = 5; |
| 828 | } |
| 829 | message BinderLockFtraceEvent { |
| 830 | optional string tag = 1; |
| 831 | } |
| 832 | message BinderLockedFtraceEvent { |
| 833 | optional string tag = 1; |
| 834 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 835 | message BinderUnlockFtraceEvent { |
| 836 | optional string tag = 1; |
| 837 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 838 | message BinderTransactionAllocBufFtraceEvent { |
| 839 | optional uint64 data_size = 1; |
| 840 | optional int32 debug_id = 2; |
| 841 | optional uint64 offsets_size = 3; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 842 | } |
| 843 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 844 | // End of protos/perfetto/trace/ftrace/binder.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 845 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 846 | // Begin of protos/perfetto/trace/ftrace/block.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 847 | |
| 848 | message BlockRqIssueFtraceEvent { |
| 849 | optional uint64 dev = 1; |
| 850 | optional uint64 sector = 2; |
| 851 | optional uint32 nr_sector = 3; |
| 852 | optional uint32 bytes = 4; |
| 853 | optional string rwbs = 5; |
| 854 | optional string comm = 6; |
| 855 | optional string cmd = 7; |
| 856 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 857 | message BlockBioBackmergeFtraceEvent { |
| 858 | optional uint64 dev = 1; |
| 859 | optional uint64 sector = 2; |
| 860 | optional uint32 nr_sector = 3; |
| 861 | optional string rwbs = 4; |
| 862 | optional string comm = 5; |
| 863 | } |
| 864 | message BlockBioBounceFtraceEvent { |
| 865 | optional uint64 dev = 1; |
| 866 | optional uint64 sector = 2; |
| 867 | optional uint32 nr_sector = 3; |
| 868 | optional string rwbs = 4; |
| 869 | optional string comm = 5; |
| 870 | } |
| 871 | message BlockBioCompleteFtraceEvent { |
| 872 | optional uint64 dev = 1; |
| 873 | optional uint64 sector = 2; |
| 874 | optional uint32 nr_sector = 3; |
| 875 | optional int32 error = 4; |
| 876 | optional string rwbs = 5; |
| 877 | } |
| 878 | message BlockBioFrontmergeFtraceEvent { |
| 879 | optional uint64 dev = 1; |
| 880 | optional uint64 sector = 2; |
| 881 | optional uint32 nr_sector = 3; |
| 882 | optional string rwbs = 4; |
| 883 | optional string comm = 5; |
| 884 | } |
| 885 | message BlockBioQueueFtraceEvent { |
| 886 | optional uint64 dev = 1; |
| 887 | optional uint64 sector = 2; |
| 888 | optional uint32 nr_sector = 3; |
| 889 | optional string rwbs = 4; |
| 890 | optional string comm = 5; |
| 891 | } |
| 892 | message BlockBioRemapFtraceEvent { |
| 893 | optional uint64 dev = 1; |
| 894 | optional uint64 sector = 2; |
| 895 | optional uint32 nr_sector = 3; |
| 896 | optional uint64 old_dev = 4; |
| 897 | optional uint64 old_sector = 5; |
| 898 | optional string rwbs = 6; |
| 899 | } |
| 900 | message BlockDirtyBufferFtraceEvent { |
| 901 | optional uint64 dev = 1; |
| 902 | optional uint64 sector = 2; |
| 903 | optional uint64 size = 3; |
| 904 | } |
| 905 | message BlockGetrqFtraceEvent { |
| 906 | optional uint64 dev = 1; |
| 907 | optional uint64 sector = 2; |
| 908 | optional uint32 nr_sector = 3; |
| 909 | optional string rwbs = 4; |
| 910 | optional string comm = 5; |
| 911 | } |
| 912 | message BlockPlugFtraceEvent { |
| 913 | optional string comm = 1; |
| 914 | } |
| 915 | message BlockRqAbortFtraceEvent { |
| 916 | optional uint64 dev = 1; |
| 917 | optional uint64 sector = 2; |
| 918 | optional uint32 nr_sector = 3; |
| 919 | optional int32 errors = 4; |
| 920 | optional string rwbs = 5; |
| 921 | optional string cmd = 6; |
| 922 | } |
| 923 | message BlockRqCompleteFtraceEvent { |
| 924 | optional uint64 dev = 1; |
| 925 | optional uint64 sector = 2; |
| 926 | optional uint32 nr_sector = 3; |
| 927 | optional int32 errors = 4; |
| 928 | optional string rwbs = 5; |
| 929 | optional string cmd = 6; |
| 930 | } |
| 931 | message BlockRqInsertFtraceEvent { |
| 932 | optional uint64 dev = 1; |
| 933 | optional uint64 sector = 2; |
| 934 | optional uint32 nr_sector = 3; |
| 935 | optional uint32 bytes = 4; |
| 936 | optional string rwbs = 5; |
| 937 | optional string comm = 6; |
| 938 | optional string cmd = 7; |
| 939 | } |
| 940 | message BlockRqRemapFtraceEvent { |
| 941 | optional uint64 dev = 1; |
| 942 | optional uint64 sector = 2; |
| 943 | optional uint32 nr_sector = 3; |
| 944 | optional uint64 old_dev = 4; |
| 945 | optional uint64 old_sector = 5; |
| 946 | optional uint32 nr_bios = 6; |
| 947 | optional string rwbs = 7; |
| 948 | } |
| 949 | message BlockRqRequeueFtraceEvent { |
| 950 | optional uint64 dev = 1; |
| 951 | optional uint64 sector = 2; |
| 952 | optional uint32 nr_sector = 3; |
| 953 | optional int32 errors = 4; |
| 954 | optional string rwbs = 5; |
| 955 | optional string cmd = 6; |
| 956 | } |
| 957 | message BlockSleeprqFtraceEvent { |
| 958 | optional uint64 dev = 1; |
| 959 | optional uint64 sector = 2; |
| 960 | optional uint32 nr_sector = 3; |
| 961 | optional string rwbs = 4; |
| 962 | optional string comm = 5; |
| 963 | } |
| 964 | message BlockSplitFtraceEvent { |
| 965 | optional uint64 dev = 1; |
| 966 | optional uint64 sector = 2; |
| 967 | optional uint64 new_sector = 3; |
| 968 | optional string rwbs = 4; |
| 969 | optional string comm = 5; |
| 970 | } |
| 971 | message BlockTouchBufferFtraceEvent { |
| 972 | optional uint64 dev = 1; |
| 973 | optional uint64 sector = 2; |
| 974 | optional uint64 size = 3; |
| 975 | } |
| 976 | message BlockUnplugFtraceEvent { |
| 977 | optional int32 nr_rq = 1; |
| 978 | optional string comm = 2; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 979 | } |
| 980 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 981 | // End of protos/perfetto/trace/ftrace/block.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 982 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 983 | // Begin of protos/perfetto/trace/ftrace/clk.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 984 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 985 | message ClkEnableFtraceEvent { |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 986 | optional string name = 1; |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 987 | } |
| 988 | message ClkDisableFtraceEvent { |
| 989 | optional string name = 1; |
| 990 | } |
| 991 | message ClkSetRateFtraceEvent { |
| 992 | optional string name = 1; |
| 993 | optional uint64 rate = 2; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 994 | } |
| 995 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 996 | // End of protos/perfetto/trace/ftrace/clk.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 997 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 998 | // Begin of protos/perfetto/trace/ftrace/ext4.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 999 | |
| 1000 | message Ext4DaWriteBeginFtraceEvent { |
| 1001 | optional uint64 dev = 1; |
| 1002 | optional uint64 ino = 2; |
| 1003 | optional int64 pos = 3; |
| 1004 | optional uint32 len = 4; |
| 1005 | optional uint32 flags = 5; |
| 1006 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1007 | message Ext4DaWriteEndFtraceEvent { |
| 1008 | optional uint64 dev = 1; |
| 1009 | optional uint64 ino = 2; |
| 1010 | optional int64 pos = 3; |
| 1011 | optional uint32 len = 4; |
| 1012 | optional uint32 copied = 5; |
| 1013 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1014 | message Ext4SyncFileEnterFtraceEvent { |
| 1015 | optional uint64 dev = 1; |
| 1016 | optional uint64 ino = 2; |
| 1017 | optional uint64 parent = 3; |
| 1018 | optional int32 datasync = 4; |
| 1019 | } |
| 1020 | message Ext4SyncFileExitFtraceEvent { |
| 1021 | optional uint64 dev = 1; |
| 1022 | optional uint64 ino = 2; |
| 1023 | optional int32 ret = 3; |
| 1024 | } |
| 1025 | message Ext4AllocDaBlocksFtraceEvent { |
| 1026 | optional uint64 dev = 1; |
| 1027 | optional uint64 ino = 2; |
| 1028 | optional uint32 data_blocks = 3; |
| 1029 | optional uint32 meta_blocks = 4; |
| 1030 | } |
| 1031 | message Ext4AllocateBlocksFtraceEvent { |
| 1032 | optional uint64 dev = 1; |
| 1033 | optional uint64 ino = 2; |
| 1034 | optional uint64 block = 3; |
| 1035 | optional uint32 len = 4; |
| 1036 | optional uint32 logical = 5; |
| 1037 | optional uint32 lleft = 6; |
| 1038 | optional uint32 lright = 7; |
| 1039 | optional uint64 goal = 8; |
| 1040 | optional uint64 pleft = 9; |
| 1041 | optional uint64 pright = 10; |
| 1042 | optional uint32 flags = 11; |
| 1043 | } |
| 1044 | message Ext4AllocateInodeFtraceEvent { |
| 1045 | optional uint64 dev = 1; |
| 1046 | optional uint64 ino = 2; |
| 1047 | optional uint64 dir = 3; |
| 1048 | optional uint32 mode = 4; |
| 1049 | } |
| 1050 | message Ext4BeginOrderedTruncateFtraceEvent { |
| 1051 | optional uint64 dev = 1; |
| 1052 | optional uint64 ino = 2; |
| 1053 | optional int64 new_size = 3; |
| 1054 | } |
| 1055 | message Ext4CollapseRangeFtraceEvent { |
| 1056 | optional uint64 dev = 1; |
| 1057 | optional uint64 ino = 2; |
| 1058 | optional int64 offset = 3; |
| 1059 | optional int64 len = 4; |
| 1060 | } |
| 1061 | message Ext4DaReleaseSpaceFtraceEvent { |
| 1062 | optional uint64 dev = 1; |
| 1063 | optional uint64 ino = 2; |
| 1064 | optional uint64 i_blocks = 3; |
| 1065 | optional int32 freed_blocks = 4; |
| 1066 | optional int32 reserved_data_blocks = 5; |
| 1067 | optional int32 reserved_meta_blocks = 6; |
| 1068 | optional int32 allocated_meta_blocks = 7; |
| 1069 | optional uint32 mode = 8; |
| 1070 | } |
| 1071 | message Ext4DaReserveSpaceFtraceEvent { |
| 1072 | optional uint64 dev = 1; |
| 1073 | optional uint64 ino = 2; |
| 1074 | optional uint64 i_blocks = 3; |
| 1075 | optional int32 reserved_data_blocks = 4; |
| 1076 | optional int32 reserved_meta_blocks = 5; |
| 1077 | optional uint32 mode = 6; |
| 1078 | optional int32 md_needed = 7; |
| 1079 | } |
| 1080 | message Ext4DaUpdateReserveSpaceFtraceEvent { |
| 1081 | optional uint64 dev = 1; |
| 1082 | optional uint64 ino = 2; |
| 1083 | optional uint64 i_blocks = 3; |
| 1084 | optional int32 used_blocks = 4; |
| 1085 | optional int32 reserved_data_blocks = 5; |
| 1086 | optional int32 reserved_meta_blocks = 6; |
| 1087 | optional int32 allocated_meta_blocks = 7; |
| 1088 | optional int32 quota_claim = 8; |
| 1089 | optional uint32 mode = 9; |
| 1090 | } |
| 1091 | message Ext4DaWritePagesFtraceEvent { |
| 1092 | optional uint64 dev = 1; |
| 1093 | optional uint64 ino = 2; |
| 1094 | optional uint64 first_page = 3; |
| 1095 | optional int64 nr_to_write = 4; |
| 1096 | optional int32 sync_mode = 5; |
| 1097 | optional uint64 b_blocknr = 6; |
| 1098 | optional uint32 b_size = 7; |
| 1099 | optional uint32 b_state = 8; |
| 1100 | optional int32 io_done = 9; |
| 1101 | optional int32 pages_written = 10; |
| 1102 | } |
| 1103 | message Ext4DaWritePagesExtentFtraceEvent { |
| 1104 | optional uint64 dev = 1; |
| 1105 | optional uint64 ino = 2; |
| 1106 | optional uint64 lblk = 3; |
| 1107 | optional uint32 len = 4; |
| 1108 | optional uint32 flags = 5; |
| 1109 | } |
| 1110 | message Ext4DirectIOEnterFtraceEvent { |
| 1111 | optional uint64 dev = 1; |
| 1112 | optional uint64 ino = 2; |
| 1113 | optional int64 pos = 3; |
| 1114 | optional uint64 len = 4; |
| 1115 | optional int32 rw = 5; |
| 1116 | } |
| 1117 | message Ext4DirectIOExitFtraceEvent { |
| 1118 | optional uint64 dev = 1; |
| 1119 | optional uint64 ino = 2; |
| 1120 | optional int64 pos = 3; |
| 1121 | optional uint64 len = 4; |
| 1122 | optional int32 rw = 5; |
| 1123 | optional int32 ret = 6; |
| 1124 | } |
| 1125 | message Ext4DiscardBlocksFtraceEvent { |
| 1126 | optional uint64 dev = 1; |
| 1127 | optional uint64 blk = 2; |
| 1128 | optional uint64 count = 3; |
| 1129 | } |
| 1130 | message Ext4DiscardPreallocationsFtraceEvent { |
| 1131 | optional uint64 dev = 1; |
| 1132 | optional uint64 ino = 2; |
| 1133 | } |
| 1134 | message Ext4DropInodeFtraceEvent { |
| 1135 | optional uint64 dev = 1; |
| 1136 | optional uint64 ino = 2; |
| 1137 | optional int32 drop = 3; |
| 1138 | } |
| 1139 | message Ext4EsCacheExtentFtraceEvent { |
| 1140 | optional uint64 dev = 1; |
| 1141 | optional uint64 ino = 2; |
| 1142 | optional uint32 lblk = 3; |
| 1143 | optional uint32 len = 4; |
| 1144 | optional uint64 pblk = 5; |
| 1145 | optional uint32 status = 6; |
| 1146 | } |
| 1147 | message Ext4EsFindDelayedExtentRangeEnterFtraceEvent { |
| 1148 | optional uint64 dev = 1; |
| 1149 | optional uint64 ino = 2; |
| 1150 | optional uint32 lblk = 3; |
| 1151 | } |
| 1152 | message Ext4EsFindDelayedExtentRangeExitFtraceEvent { |
| 1153 | optional uint64 dev = 1; |
| 1154 | optional uint64 ino = 2; |
| 1155 | optional uint32 lblk = 3; |
| 1156 | optional uint32 len = 4; |
| 1157 | optional uint64 pblk = 5; |
| 1158 | optional uint64 status = 6; |
| 1159 | } |
| 1160 | message Ext4EsInsertExtentFtraceEvent { |
| 1161 | optional uint64 dev = 1; |
| 1162 | optional uint64 ino = 2; |
| 1163 | optional uint32 lblk = 3; |
| 1164 | optional uint32 len = 4; |
| 1165 | optional uint64 pblk = 5; |
| 1166 | optional uint64 status = 6; |
| 1167 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1168 | message Ext4EsLookupExtentEnterFtraceEvent { |
| 1169 | optional uint64 dev = 1; |
| 1170 | optional uint64 ino = 2; |
| 1171 | optional uint32 lblk = 3; |
| 1172 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1173 | message Ext4EsLookupExtentExitFtraceEvent { |
| 1174 | optional uint64 dev = 1; |
| 1175 | optional uint64 ino = 2; |
| 1176 | optional uint32 lblk = 3; |
| 1177 | optional uint32 len = 4; |
| 1178 | optional uint64 pblk = 5; |
Florian Mayer | 7c9e3b2 | 2018-04-26 11:55:15 +0100 | [diff] [blame] | 1179 | optional uint64 status = 6; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1180 | optional int32 found = 7; |
| 1181 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1182 | message Ext4EsRemoveExtentFtraceEvent { |
| 1183 | optional uint64 dev = 1; |
| 1184 | optional uint64 ino = 2; |
| 1185 | optional int64 lblk = 3; |
| 1186 | optional int64 len = 4; |
| 1187 | } |
| 1188 | message Ext4EsShrinkFtraceEvent { |
| 1189 | optional uint64 dev = 1; |
| 1190 | optional int32 nr_shrunk = 2; |
| 1191 | optional uint64 scan_time = 3; |
| 1192 | optional int32 nr_skipped = 4; |
| 1193 | optional int32 retried = 5; |
| 1194 | } |
| 1195 | message Ext4EsShrinkCountFtraceEvent { |
| 1196 | optional uint64 dev = 1; |
| 1197 | optional int32 nr_to_scan = 2; |
| 1198 | optional int32 cache_cnt = 3; |
| 1199 | } |
| 1200 | message Ext4EsShrinkScanEnterFtraceEvent { |
| 1201 | optional uint64 dev = 1; |
| 1202 | optional int32 nr_to_scan = 2; |
| 1203 | optional int32 cache_cnt = 3; |
| 1204 | } |
| 1205 | message Ext4EsShrinkScanExitFtraceEvent { |
| 1206 | optional uint64 dev = 1; |
| 1207 | optional int32 nr_shrunk = 2; |
| 1208 | optional int32 cache_cnt = 3; |
| 1209 | } |
| 1210 | message Ext4EvictInodeFtraceEvent { |
| 1211 | optional uint64 dev = 1; |
| 1212 | optional uint64 ino = 2; |
| 1213 | optional int32 nlink = 3; |
| 1214 | } |
| 1215 | message Ext4ExtConvertToInitializedEnterFtraceEvent { |
| 1216 | optional uint64 dev = 1; |
| 1217 | optional uint64 ino = 2; |
| 1218 | optional uint32 m_lblk = 3; |
| 1219 | optional uint32 m_len = 4; |
| 1220 | optional uint32 u_lblk = 5; |
| 1221 | optional uint32 u_len = 6; |
| 1222 | optional uint64 u_pblk = 7; |
| 1223 | } |
| 1224 | message Ext4ExtConvertToInitializedFastpathFtraceEvent { |
| 1225 | optional uint64 dev = 1; |
| 1226 | optional uint64 ino = 2; |
| 1227 | optional uint32 m_lblk = 3; |
| 1228 | optional uint32 m_len = 4; |
| 1229 | optional uint32 u_lblk = 5; |
| 1230 | optional uint32 u_len = 6; |
| 1231 | optional uint64 u_pblk = 7; |
| 1232 | optional uint32 i_lblk = 8; |
| 1233 | optional uint32 i_len = 9; |
| 1234 | optional uint64 i_pblk = 10; |
| 1235 | } |
| 1236 | message Ext4ExtHandleUnwrittenExtentsFtraceEvent { |
| 1237 | optional uint64 dev = 1; |
| 1238 | optional uint64 ino = 2; |
| 1239 | optional int32 flags = 3; |
| 1240 | optional uint32 lblk = 4; |
| 1241 | optional uint64 pblk = 5; |
| 1242 | optional uint32 len = 6; |
| 1243 | optional uint32 allocated = 7; |
| 1244 | optional uint64 newblk = 8; |
| 1245 | } |
| 1246 | message Ext4ExtInCacheFtraceEvent { |
| 1247 | optional uint64 dev = 1; |
| 1248 | optional uint64 ino = 2; |
| 1249 | optional uint32 lblk = 3; |
| 1250 | optional int32 ret = 4; |
| 1251 | } |
| 1252 | message Ext4ExtLoadExtentFtraceEvent { |
| 1253 | optional uint64 dev = 1; |
| 1254 | optional uint64 ino = 2; |
| 1255 | optional uint64 pblk = 3; |
| 1256 | optional uint32 lblk = 4; |
| 1257 | } |
| 1258 | message Ext4ExtMapBlocksEnterFtraceEvent { |
| 1259 | optional uint64 dev = 1; |
| 1260 | optional uint64 ino = 2; |
| 1261 | optional uint32 lblk = 3; |
| 1262 | optional uint32 len = 4; |
| 1263 | optional uint32 flags = 5; |
| 1264 | } |
| 1265 | message Ext4ExtMapBlocksExitFtraceEvent { |
| 1266 | optional uint64 dev = 1; |
| 1267 | optional uint64 ino = 2; |
| 1268 | optional uint32 flags = 3; |
| 1269 | optional uint64 pblk = 4; |
| 1270 | optional uint32 lblk = 5; |
| 1271 | optional uint32 len = 6; |
| 1272 | optional uint32 mflags = 7; |
| 1273 | optional int32 ret = 8; |
| 1274 | } |
| 1275 | message Ext4ExtPutInCacheFtraceEvent { |
| 1276 | optional uint64 dev = 1; |
| 1277 | optional uint64 ino = 2; |
| 1278 | optional uint32 lblk = 3; |
| 1279 | optional uint32 len = 4; |
| 1280 | optional uint64 start = 5; |
| 1281 | } |
| 1282 | message Ext4ExtRemoveSpaceFtraceEvent { |
| 1283 | optional uint64 dev = 1; |
| 1284 | optional uint64 ino = 2; |
| 1285 | optional uint32 start = 3; |
| 1286 | optional uint32 end = 4; |
| 1287 | optional int32 depth = 5; |
| 1288 | } |
| 1289 | message Ext4ExtRemoveSpaceDoneFtraceEvent { |
| 1290 | optional uint64 dev = 1; |
| 1291 | optional uint64 ino = 2; |
| 1292 | optional uint32 start = 3; |
| 1293 | optional uint32 end = 4; |
| 1294 | optional int32 depth = 5; |
| 1295 | optional int64 partial = 6; |
| 1296 | optional uint32 eh_entries = 7; |
| 1297 | } |
| 1298 | message Ext4ExtRmIdxFtraceEvent { |
| 1299 | optional uint64 dev = 1; |
| 1300 | optional uint64 ino = 2; |
| 1301 | optional uint64 pblk = 3; |
| 1302 | } |
| 1303 | message Ext4ExtRmLeafFtraceEvent { |
| 1304 | optional uint64 dev = 1; |
| 1305 | optional uint64 ino = 2; |
| 1306 | optional int64 partial = 3; |
| 1307 | optional uint32 start = 4; |
| 1308 | optional uint32 ee_lblk = 5; |
| 1309 | optional uint64 ee_pblk = 6; |
| 1310 | optional int32 ee_len = 7; |
| 1311 | } |
| 1312 | message Ext4ExtShowExtentFtraceEvent { |
| 1313 | optional uint64 dev = 1; |
| 1314 | optional uint64 ino = 2; |
| 1315 | optional uint64 pblk = 3; |
| 1316 | optional uint32 lblk = 4; |
| 1317 | optional uint32 len = 5; |
| 1318 | } |
| 1319 | message Ext4FallocateEnterFtraceEvent { |
| 1320 | optional uint64 dev = 1; |
| 1321 | optional uint64 ino = 2; |
| 1322 | optional int64 offset = 3; |
| 1323 | optional int64 len = 4; |
| 1324 | optional int32 mode = 5; |
| 1325 | optional int64 pos = 6; |
| 1326 | } |
| 1327 | message Ext4FallocateExitFtraceEvent { |
| 1328 | optional uint64 dev = 1; |
| 1329 | optional uint64 ino = 2; |
| 1330 | optional int64 pos = 3; |
| 1331 | optional uint32 blocks = 4; |
| 1332 | optional int32 ret = 5; |
| 1333 | } |
| 1334 | message Ext4FindDelallocRangeFtraceEvent { |
| 1335 | optional uint64 dev = 1; |
| 1336 | optional uint64 ino = 2; |
| 1337 | optional uint32 from = 3; |
| 1338 | optional uint32 to = 4; |
| 1339 | optional int32 reverse = 5; |
| 1340 | optional int32 found = 6; |
| 1341 | optional uint32 found_blk = 7; |
| 1342 | } |
| 1343 | message Ext4ForgetFtraceEvent { |
| 1344 | optional uint64 dev = 1; |
| 1345 | optional uint64 ino = 2; |
| 1346 | optional uint64 block = 3; |
| 1347 | optional int32 is_metadata = 4; |
| 1348 | optional uint32 mode = 5; |
| 1349 | } |
| 1350 | message Ext4FreeBlocksFtraceEvent { |
| 1351 | optional uint64 dev = 1; |
| 1352 | optional uint64 ino = 2; |
| 1353 | optional uint64 block = 3; |
| 1354 | optional uint64 count = 4; |
| 1355 | optional int32 flags = 5; |
| 1356 | optional uint32 mode = 6; |
| 1357 | } |
| 1358 | message Ext4FreeInodeFtraceEvent { |
| 1359 | optional uint64 dev = 1; |
| 1360 | optional uint64 ino = 2; |
| 1361 | optional uint32 uid = 3; |
| 1362 | optional uint32 gid = 4; |
| 1363 | optional uint64 blocks = 5; |
| 1364 | optional uint32 mode = 6; |
| 1365 | } |
| 1366 | message Ext4GetImpliedClusterAllocExitFtraceEvent { |
| 1367 | optional uint64 dev = 1; |
| 1368 | optional uint32 flags = 2; |
| 1369 | optional uint32 lblk = 3; |
| 1370 | optional uint64 pblk = 4; |
| 1371 | optional uint32 len = 5; |
| 1372 | optional int32 ret = 6; |
| 1373 | } |
| 1374 | message Ext4GetReservedClusterAllocFtraceEvent { |
| 1375 | optional uint64 dev = 1; |
| 1376 | optional uint64 ino = 2; |
| 1377 | optional uint32 lblk = 3; |
| 1378 | optional uint32 len = 4; |
| 1379 | } |
| 1380 | message Ext4IndMapBlocksEnterFtraceEvent { |
| 1381 | optional uint64 dev = 1; |
| 1382 | optional uint64 ino = 2; |
| 1383 | optional uint32 lblk = 3; |
| 1384 | optional uint32 len = 4; |
| 1385 | optional uint32 flags = 5; |
| 1386 | } |
| 1387 | message Ext4IndMapBlocksExitFtraceEvent { |
| 1388 | optional uint64 dev = 1; |
| 1389 | optional uint64 ino = 2; |
| 1390 | optional uint32 flags = 3; |
| 1391 | optional uint64 pblk = 4; |
| 1392 | optional uint32 lblk = 5; |
| 1393 | optional uint32 len = 6; |
| 1394 | optional uint32 mflags = 7; |
| 1395 | optional int32 ret = 8; |
| 1396 | } |
| 1397 | message Ext4InsertRangeFtraceEvent { |
| 1398 | optional uint64 dev = 1; |
| 1399 | optional uint64 ino = 2; |
| 1400 | optional int64 offset = 3; |
| 1401 | optional int64 len = 4; |
| 1402 | } |
| 1403 | message Ext4InvalidatepageFtraceEvent { |
| 1404 | optional uint64 dev = 1; |
| 1405 | optional uint64 ino = 2; |
| 1406 | optional uint64 index = 3; |
| 1407 | optional uint64 offset = 4; |
| 1408 | optional uint32 length = 5; |
| 1409 | } |
| 1410 | message Ext4JournalStartFtraceEvent { |
| 1411 | optional uint64 dev = 1; |
| 1412 | optional uint64 ip = 2; |
| 1413 | optional int32 blocks = 3; |
| 1414 | optional int32 rsv_blocks = 4; |
| 1415 | optional int32 nblocks = 5; |
| 1416 | } |
| 1417 | message Ext4JournalStartReservedFtraceEvent { |
| 1418 | optional uint64 dev = 1; |
| 1419 | optional uint64 ip = 2; |
| 1420 | optional int32 blocks = 3; |
| 1421 | } |
| 1422 | message Ext4JournalledInvalidatepageFtraceEvent { |
| 1423 | optional uint64 dev = 1; |
| 1424 | optional uint64 ino = 2; |
| 1425 | optional uint64 index = 3; |
| 1426 | optional uint64 offset = 4; |
| 1427 | optional uint32 length = 5; |
| 1428 | } |
| 1429 | message Ext4JournalledWriteEndFtraceEvent { |
| 1430 | optional uint64 dev = 1; |
| 1431 | optional uint64 ino = 2; |
| 1432 | optional int64 pos = 3; |
| 1433 | optional uint32 len = 4; |
| 1434 | optional uint32 copied = 5; |
| 1435 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1436 | message Ext4LoadInodeFtraceEvent { |
| 1437 | optional uint64 dev = 1; |
| 1438 | optional uint64 ino = 2; |
| 1439 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1440 | message Ext4LoadInodeBitmapFtraceEvent { |
| 1441 | optional uint64 dev = 1; |
| 1442 | optional uint32 group = 2; |
| 1443 | } |
| 1444 | message Ext4MarkInodeDirtyFtraceEvent { |
| 1445 | optional uint64 dev = 1; |
| 1446 | optional uint64 ino = 2; |
| 1447 | optional uint64 ip = 3; |
| 1448 | } |
| 1449 | message Ext4MbBitmapLoadFtraceEvent { |
| 1450 | optional uint64 dev = 1; |
| 1451 | optional uint32 group = 2; |
| 1452 | } |
| 1453 | message Ext4MbBuddyBitmapLoadFtraceEvent { |
| 1454 | optional uint64 dev = 1; |
| 1455 | optional uint32 group = 2; |
| 1456 | } |
| 1457 | message Ext4MbDiscardPreallocationsFtraceEvent { |
| 1458 | optional uint64 dev = 1; |
| 1459 | optional int32 needed = 2; |
| 1460 | } |
| 1461 | message Ext4MbNewGroupPaFtraceEvent { |
| 1462 | optional uint64 dev = 1; |
| 1463 | optional uint64 ino = 2; |
| 1464 | optional uint64 pa_pstart = 3; |
| 1465 | optional uint64 pa_lstart = 4; |
| 1466 | optional uint32 pa_len = 5; |
| 1467 | } |
| 1468 | message Ext4MbNewInodePaFtraceEvent { |
| 1469 | optional uint64 dev = 1; |
| 1470 | optional uint64 ino = 2; |
| 1471 | optional uint64 pa_pstart = 3; |
| 1472 | optional uint64 pa_lstart = 4; |
| 1473 | optional uint32 pa_len = 5; |
| 1474 | } |
| 1475 | message Ext4MbReleaseGroupPaFtraceEvent { |
| 1476 | optional uint64 dev = 1; |
| 1477 | optional uint64 pa_pstart = 2; |
| 1478 | optional uint32 pa_len = 3; |
| 1479 | } |
| 1480 | message Ext4MbReleaseInodePaFtraceEvent { |
| 1481 | optional uint64 dev = 1; |
| 1482 | optional uint64 ino = 2; |
| 1483 | optional uint64 block = 3; |
| 1484 | optional uint32 count = 4; |
| 1485 | } |
| 1486 | message Ext4MballocAllocFtraceEvent { |
| 1487 | optional uint64 dev = 1; |
| 1488 | optional uint64 ino = 2; |
| 1489 | optional uint32 orig_logical = 3; |
| 1490 | optional int32 orig_start = 4; |
| 1491 | optional uint32 orig_group = 5; |
| 1492 | optional int32 orig_len = 6; |
| 1493 | optional uint32 goal_logical = 7; |
| 1494 | optional int32 goal_start = 8; |
| 1495 | optional uint32 goal_group = 9; |
| 1496 | optional int32 goal_len = 10; |
| 1497 | optional uint32 result_logical = 11; |
| 1498 | optional int32 result_start = 12; |
| 1499 | optional uint32 result_group = 13; |
| 1500 | optional int32 result_len = 14; |
| 1501 | optional uint32 found = 15; |
| 1502 | optional uint32 groups = 16; |
| 1503 | optional uint32 buddy = 17; |
| 1504 | optional uint32 flags = 18; |
| 1505 | optional uint32 tail = 19; |
| 1506 | optional uint32 cr = 20; |
| 1507 | } |
| 1508 | message Ext4MballocDiscardFtraceEvent { |
| 1509 | optional uint64 dev = 1; |
| 1510 | optional uint64 ino = 2; |
| 1511 | optional int32 result_start = 3; |
| 1512 | optional uint32 result_group = 4; |
| 1513 | optional int32 result_len = 5; |
| 1514 | } |
| 1515 | message Ext4MballocFreeFtraceEvent { |
| 1516 | optional uint64 dev = 1; |
| 1517 | optional uint64 ino = 2; |
| 1518 | optional int32 result_start = 3; |
| 1519 | optional uint32 result_group = 4; |
| 1520 | optional int32 result_len = 5; |
| 1521 | } |
| 1522 | message Ext4MballocPreallocFtraceEvent { |
| 1523 | optional uint64 dev = 1; |
| 1524 | optional uint64 ino = 2; |
| 1525 | optional uint32 orig_logical = 3; |
| 1526 | optional int32 orig_start = 4; |
| 1527 | optional uint32 orig_group = 5; |
| 1528 | optional int32 orig_len = 6; |
| 1529 | optional uint32 result_logical = 7; |
| 1530 | optional int32 result_start = 8; |
| 1531 | optional uint32 result_group = 9; |
| 1532 | optional int32 result_len = 10; |
| 1533 | } |
| 1534 | message Ext4OtherInodeUpdateTimeFtraceEvent { |
| 1535 | optional uint64 dev = 1; |
| 1536 | optional uint64 ino = 2; |
| 1537 | optional uint64 orig_ino = 3; |
| 1538 | optional uint32 uid = 4; |
| 1539 | optional uint32 gid = 5; |
| 1540 | optional uint32 mode = 6; |
| 1541 | } |
| 1542 | message Ext4PunchHoleFtraceEvent { |
| 1543 | optional uint64 dev = 1; |
| 1544 | optional uint64 ino = 2; |
| 1545 | optional int64 offset = 3; |
| 1546 | optional int64 len = 4; |
| 1547 | optional int32 mode = 5; |
| 1548 | } |
| 1549 | message Ext4ReadBlockBitmapLoadFtraceEvent { |
| 1550 | optional uint64 dev = 1; |
| 1551 | optional uint32 group = 2; |
| 1552 | } |
| 1553 | message Ext4ReadpageFtraceEvent { |
| 1554 | optional uint64 dev = 1; |
| 1555 | optional uint64 ino = 2; |
| 1556 | optional uint64 index = 3; |
| 1557 | } |
| 1558 | message Ext4ReleasepageFtraceEvent { |
| 1559 | optional uint64 dev = 1; |
| 1560 | optional uint64 ino = 2; |
| 1561 | optional uint64 index = 3; |
| 1562 | } |
| 1563 | message Ext4RemoveBlocksFtraceEvent { |
| 1564 | optional uint64 dev = 1; |
| 1565 | optional uint64 ino = 2; |
| 1566 | optional uint32 from = 3; |
| 1567 | optional uint32 to = 4; |
| 1568 | optional int64 partial = 5; |
| 1569 | optional uint64 ee_pblk = 6; |
| 1570 | optional uint32 ee_lblk = 7; |
| 1571 | optional uint32 ee_len = 8; |
| 1572 | } |
| 1573 | message Ext4RequestBlocksFtraceEvent { |
| 1574 | optional uint64 dev = 1; |
| 1575 | optional uint64 ino = 2; |
| 1576 | optional uint32 len = 3; |
| 1577 | optional uint32 logical = 4; |
| 1578 | optional uint32 lleft = 5; |
| 1579 | optional uint32 lright = 6; |
| 1580 | optional uint64 goal = 7; |
| 1581 | optional uint64 pleft = 8; |
| 1582 | optional uint64 pright = 9; |
| 1583 | optional uint32 flags = 10; |
| 1584 | } |
| 1585 | message Ext4RequestInodeFtraceEvent { |
| 1586 | optional uint64 dev = 1; |
| 1587 | optional uint64 dir = 2; |
| 1588 | optional uint32 mode = 3; |
| 1589 | } |
| 1590 | message Ext4SyncFsFtraceEvent { |
| 1591 | optional uint64 dev = 1; |
| 1592 | optional int32 wait = 2; |
| 1593 | } |
| 1594 | message Ext4TrimAllFreeFtraceEvent { |
| 1595 | optional int32 dev_major = 1; |
| 1596 | optional int32 dev_minor = 2; |
| 1597 | optional uint32 group = 3; |
| 1598 | optional int32 start = 4; |
| 1599 | optional int32 len = 5; |
| 1600 | } |
| 1601 | message Ext4TrimExtentFtraceEvent { |
| 1602 | optional int32 dev_major = 1; |
| 1603 | optional int32 dev_minor = 2; |
| 1604 | optional uint32 group = 3; |
| 1605 | optional int32 start = 4; |
| 1606 | optional int32 len = 5; |
| 1607 | } |
| 1608 | message Ext4TruncateEnterFtraceEvent { |
| 1609 | optional uint64 dev = 1; |
| 1610 | optional uint64 ino = 2; |
| 1611 | optional uint64 blocks = 3; |
| 1612 | } |
| 1613 | message Ext4TruncateExitFtraceEvent { |
| 1614 | optional uint64 dev = 1; |
| 1615 | optional uint64 ino = 2; |
| 1616 | optional uint64 blocks = 3; |
| 1617 | } |
| 1618 | message Ext4UnlinkEnterFtraceEvent { |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1619 | optional uint64 dev = 1; |
| 1620 | optional uint64 ino = 2; |
| 1621 | optional uint64 parent = 3; |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1622 | optional int64 size = 4; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1623 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1624 | message Ext4UnlinkExitFtraceEvent { |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1625 | optional uint64 dev = 1; |
| 1626 | optional uint64 ino = 2; |
| 1627 | optional int32 ret = 3; |
| 1628 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1629 | message Ext4WriteBeginFtraceEvent { |
| 1630 | optional uint64 dev = 1; |
| 1631 | optional uint64 ino = 2; |
| 1632 | optional int64 pos = 3; |
| 1633 | optional uint32 len = 4; |
| 1634 | optional uint32 flags = 5; |
| 1635 | } |
| 1636 | message Ext4WriteEndFtraceEvent { |
| 1637 | optional uint64 dev = 1; |
| 1638 | optional uint64 ino = 2; |
| 1639 | optional int64 pos = 3; |
| 1640 | optional uint32 len = 4; |
| 1641 | optional uint32 copied = 5; |
| 1642 | } |
| 1643 | message Ext4WritepageFtraceEvent { |
| 1644 | optional uint64 dev = 1; |
| 1645 | optional uint64 ino = 2; |
| 1646 | optional uint64 index = 3; |
| 1647 | } |
| 1648 | message Ext4WritepagesFtraceEvent { |
| 1649 | optional uint64 dev = 1; |
| 1650 | optional uint64 ino = 2; |
| 1651 | optional int64 nr_to_write = 3; |
| 1652 | optional int64 pages_skipped = 4; |
| 1653 | optional int64 range_start = 5; |
| 1654 | optional int64 range_end = 6; |
| 1655 | optional uint64 writeback_index = 7; |
| 1656 | optional int32 sync_mode = 8; |
| 1657 | optional uint32 for_kupdate = 9; |
| 1658 | optional uint32 range_cyclic = 10; |
| 1659 | } |
| 1660 | message Ext4WritepagesResultFtraceEvent { |
| 1661 | optional uint64 dev = 1; |
| 1662 | optional uint64 ino = 2; |
| 1663 | optional int32 ret = 3; |
| 1664 | optional int32 pages_written = 4; |
| 1665 | optional int64 pages_skipped = 5; |
| 1666 | optional uint64 writeback_index = 6; |
| 1667 | optional int32 sync_mode = 7; |
| 1668 | } |
| 1669 | message Ext4ZeroRangeFtraceEvent { |
| 1670 | optional uint64 dev = 1; |
| 1671 | optional uint64 ino = 2; |
| 1672 | optional int64 offset = 3; |
| 1673 | optional int64 len = 4; |
| 1674 | optional int32 mode = 5; |
| 1675 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1676 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1677 | // End of protos/perfetto/trace/ftrace/ext4.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1678 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1679 | // Begin of protos/perfetto/trace/ftrace/f2fs.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1680 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1681 | message F2fsDoSubmitBioFtraceEvent { |
| 1682 | optional uint64 dev = 1; |
| 1683 | optional int32 btype = 2; |
| 1684 | optional uint32 sync = 3; |
| 1685 | optional uint64 sector = 4; |
| 1686 | optional uint32 size = 5; |
| 1687 | } |
| 1688 | message F2fsEvictInodeFtraceEvent { |
| 1689 | optional uint64 dev = 1; |
| 1690 | optional uint64 ino = 2; |
| 1691 | optional uint64 pino = 3; |
| 1692 | optional uint32 mode = 4; |
| 1693 | optional int64 size = 5; |
| 1694 | optional uint32 nlink = 6; |
| 1695 | optional uint64 blocks = 7; |
| 1696 | optional uint32 advise = 8; |
| 1697 | } |
| 1698 | message F2fsFallocateFtraceEvent { |
| 1699 | optional uint64 dev = 1; |
| 1700 | optional uint64 ino = 2; |
| 1701 | optional int32 mode = 3; |
| 1702 | optional int64 offset = 4; |
| 1703 | optional int64 len = 5; |
| 1704 | optional int64 size = 6; |
| 1705 | optional uint64 blocks = 7; |
| 1706 | optional int32 ret = 8; |
| 1707 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1708 | message F2fsGetDataBlockFtraceEvent { |
| 1709 | optional uint64 dev = 1; |
| 1710 | optional uint64 ino = 2; |
| 1711 | optional uint64 iblock = 3; |
| 1712 | optional uint64 bh_start = 4; |
| 1713 | optional uint64 bh_size = 5; |
| 1714 | optional int32 ret = 6; |
| 1715 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1716 | message F2fsGetVictimFtraceEvent { |
| 1717 | optional uint64 dev = 1; |
| 1718 | optional int32 type = 2; |
| 1719 | optional int32 gc_type = 3; |
| 1720 | optional int32 alloc_mode = 4; |
| 1721 | optional int32 gc_mode = 5; |
| 1722 | optional uint32 victim = 6; |
| 1723 | optional uint32 ofs_unit = 7; |
| 1724 | optional uint32 pre_victim = 8; |
| 1725 | optional uint32 prefree = 9; |
| 1726 | optional uint32 free = 10; |
| 1727 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1728 | message F2fsIgetFtraceEvent { |
| 1729 | optional uint64 dev = 1; |
| 1730 | optional uint64 ino = 2; |
| 1731 | optional uint64 pino = 3; |
| 1732 | optional uint32 mode = 4; |
| 1733 | optional int64 size = 5; |
| 1734 | optional uint32 nlink = 6; |
| 1735 | optional uint64 blocks = 7; |
| 1736 | optional uint32 advise = 8; |
| 1737 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1738 | message F2fsIgetExitFtraceEvent { |
| 1739 | optional uint64 dev = 1; |
| 1740 | optional uint64 ino = 2; |
| 1741 | optional int32 ret = 3; |
| 1742 | } |
| 1743 | message F2fsNewInodeFtraceEvent { |
| 1744 | optional uint64 dev = 1; |
| 1745 | optional uint64 ino = 2; |
| 1746 | optional int32 ret = 3; |
| 1747 | } |
| 1748 | message F2fsReadpageFtraceEvent { |
| 1749 | optional uint64 dev = 1; |
| 1750 | optional uint64 ino = 2; |
| 1751 | optional uint64 index = 3; |
| 1752 | optional uint64 blkaddr = 4; |
| 1753 | optional int32 type = 5; |
| 1754 | } |
| 1755 | message F2fsReserveNewBlockFtraceEvent { |
| 1756 | optional uint64 dev = 1; |
| 1757 | optional uint32 nid = 2; |
| 1758 | optional uint32 ofs_in_node = 3; |
| 1759 | } |
| 1760 | message F2fsSetPageDirtyFtraceEvent { |
| 1761 | optional uint64 dev = 1; |
| 1762 | optional uint64 ino = 2; |
| 1763 | optional int32 type = 3; |
| 1764 | optional int32 dir = 4; |
| 1765 | optional uint64 index = 5; |
| 1766 | optional int32 dirty = 6; |
| 1767 | } |
| 1768 | message F2fsSubmitWritePageFtraceEvent { |
| 1769 | optional uint64 dev = 1; |
| 1770 | optional uint64 ino = 2; |
| 1771 | optional int32 type = 3; |
| 1772 | optional uint64 index = 4; |
| 1773 | optional uint32 block = 5; |
| 1774 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1775 | message F2fsSyncFileEnterFtraceEvent { |
| 1776 | optional uint64 dev = 1; |
| 1777 | optional uint64 ino = 2; |
| 1778 | optional uint64 pino = 3; |
| 1779 | optional uint32 mode = 4; |
| 1780 | optional int64 size = 5; |
| 1781 | optional uint32 nlink = 6; |
| 1782 | optional uint64 blocks = 7; |
| 1783 | optional uint32 advise = 8; |
| 1784 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1785 | message F2fsSyncFileExitFtraceEvent { |
| 1786 | optional uint64 dev = 1; |
| 1787 | optional uint64 ino = 2; |
| 1788 | optional uint32 need_cp = 3; |
| 1789 | optional int32 datasync = 4; |
| 1790 | optional int32 ret = 5; |
| 1791 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1792 | message F2fsSyncFsFtraceEvent { |
| 1793 | optional uint64 dev = 1; |
| 1794 | optional int32 dirty = 2; |
| 1795 | optional int32 wait = 3; |
| 1796 | } |
| 1797 | message F2fsTruncateFtraceEvent { |
| 1798 | optional uint64 dev = 1; |
| 1799 | optional uint64 ino = 2; |
| 1800 | optional uint64 pino = 3; |
| 1801 | optional uint32 mode = 4; |
| 1802 | optional int64 size = 5; |
| 1803 | optional uint32 nlink = 6; |
| 1804 | optional uint64 blocks = 7; |
| 1805 | optional uint32 advise = 8; |
| 1806 | } |
| 1807 | message F2fsTruncateBlocksEnterFtraceEvent { |
| 1808 | optional uint64 dev = 1; |
| 1809 | optional uint64 ino = 2; |
| 1810 | optional int64 size = 3; |
| 1811 | optional uint64 blocks = 4; |
| 1812 | optional uint64 from = 5; |
| 1813 | } |
| 1814 | message F2fsTruncateBlocksExitFtraceEvent { |
| 1815 | optional uint64 dev = 1; |
| 1816 | optional uint64 ino = 2; |
| 1817 | optional int32 ret = 3; |
| 1818 | } |
| 1819 | message F2fsTruncateDataBlocksRangeFtraceEvent { |
| 1820 | optional uint64 dev = 1; |
| 1821 | optional uint64 ino = 2; |
| 1822 | optional uint32 nid = 3; |
| 1823 | optional uint32 ofs = 4; |
| 1824 | optional int32 free = 5; |
| 1825 | } |
| 1826 | message F2fsTruncateInodeBlocksEnterFtraceEvent { |
| 1827 | optional uint64 dev = 1; |
| 1828 | optional uint64 ino = 2; |
| 1829 | optional int64 size = 3; |
| 1830 | optional uint64 blocks = 4; |
| 1831 | optional uint64 from = 5; |
| 1832 | } |
| 1833 | message F2fsTruncateInodeBlocksExitFtraceEvent { |
| 1834 | optional uint64 dev = 1; |
| 1835 | optional uint64 ino = 2; |
| 1836 | optional int32 ret = 3; |
| 1837 | } |
| 1838 | message F2fsTruncateNodeFtraceEvent { |
| 1839 | optional uint64 dev = 1; |
| 1840 | optional uint64 ino = 2; |
| 1841 | optional uint32 nid = 3; |
| 1842 | optional uint32 blk_addr = 4; |
| 1843 | } |
| 1844 | message F2fsTruncateNodesEnterFtraceEvent { |
| 1845 | optional uint64 dev = 1; |
| 1846 | optional uint64 ino = 2; |
| 1847 | optional uint32 nid = 3; |
| 1848 | optional uint32 blk_addr = 4; |
| 1849 | } |
| 1850 | message F2fsTruncateNodesExitFtraceEvent { |
| 1851 | optional uint64 dev = 1; |
| 1852 | optional uint64 ino = 2; |
| 1853 | optional int32 ret = 3; |
| 1854 | } |
| 1855 | message F2fsTruncatePartialNodesFtraceEvent { |
| 1856 | optional uint64 dev = 1; |
| 1857 | optional uint64 ino = 2; |
| 1858 | optional uint32 nid = 3; |
| 1859 | optional int32 depth = 4; |
| 1860 | optional int32 err = 5; |
| 1861 | } |
| 1862 | message F2fsUnlinkEnterFtraceEvent { |
| 1863 | optional uint64 dev = 1; |
| 1864 | optional uint64 ino = 2; |
| 1865 | optional int64 size = 3; |
| 1866 | optional uint64 blocks = 4; |
| 1867 | optional string name = 5; |
| 1868 | } |
| 1869 | message F2fsUnlinkExitFtraceEvent { |
| 1870 | optional uint64 dev = 1; |
| 1871 | optional uint64 ino = 2; |
| 1872 | optional int32 ret = 3; |
| 1873 | } |
| 1874 | message F2fsVmPageMkwriteFtraceEvent { |
| 1875 | optional uint64 dev = 1; |
| 1876 | optional uint64 ino = 2; |
| 1877 | optional int32 type = 3; |
| 1878 | optional int32 dir = 4; |
| 1879 | optional uint64 index = 5; |
| 1880 | optional int32 dirty = 6; |
| 1881 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1882 | message F2fsWriteBeginFtraceEvent { |
| 1883 | optional uint64 dev = 1; |
| 1884 | optional uint64 ino = 2; |
| 1885 | optional int64 pos = 3; |
| 1886 | optional uint32 len = 4; |
| 1887 | optional uint32 flags = 5; |
| 1888 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1889 | message F2fsWriteCheckpointFtraceEvent { |
| 1890 | optional uint64 dev = 1; |
| 1891 | optional uint32 is_umount = 2; |
| 1892 | optional string msg = 3; |
| 1893 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1894 | message F2fsWriteEndFtraceEvent { |
| 1895 | optional uint64 dev = 1; |
| 1896 | optional uint64 ino = 2; |
| 1897 | optional int64 pos = 3; |
| 1898 | optional uint32 len = 4; |
| 1899 | optional uint32 copied = 5; |
| 1900 | } |
| 1901 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1902 | // End of protos/perfetto/trace/ftrace/f2fs.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 1903 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 1904 | // Begin of protos/perfetto/trace/ftrace/filemap.proto |
| 1905 | |
| 1906 | message MmFilemapAddToPageCacheFtraceEvent { |
| 1907 | optional uint64 pfn = 1; |
| 1908 | optional uint64 i_ino = 2; |
| 1909 | optional uint64 index = 3; |
| 1910 | optional uint64 s_dev = 4; |
| 1911 | optional uint64 page = 5; |
| 1912 | } |
| 1913 | message MmFilemapDeleteFromPageCacheFtraceEvent { |
| 1914 | optional uint64 pfn = 1; |
| 1915 | optional uint64 i_ino = 2; |
| 1916 | optional uint64 index = 3; |
| 1917 | optional uint64 s_dev = 4; |
| 1918 | optional uint64 page = 5; |
| 1919 | } |
| 1920 | |
| 1921 | // End of protos/perfetto/trace/ftrace/filemap.proto |
| 1922 | |
| 1923 | // Begin of protos/perfetto/trace/ftrace/ftrace.proto |
| 1924 | |
| 1925 | message PrintFtraceEvent { |
| 1926 | optional uint64 ip = 1; |
| 1927 | optional string buf = 2; |
| 1928 | } |
| 1929 | |
| 1930 | // End of protos/perfetto/trace/ftrace/ftrace.proto |
| 1931 | |
| 1932 | // Begin of protos/perfetto/trace/ftrace/ftrace_event.proto |
| 1933 | |
| 1934 | message FtraceEvent { |
| 1935 | // Nanoseconds since an epoch. |
| 1936 | // Epoch is configurable by writing into trace_clock. |
| 1937 | // By default this timestamp is CPU local. |
| 1938 | // TODO: Figure out a story for reconciling the various clocks. |
| 1939 | optional uint64 timestamp = 1; |
| 1940 | |
| 1941 | // Kernel pid (do not confuse with userspace pid aka tgid) |
| 1942 | optional uint32 pid = 2; |
| 1943 | |
| 1944 | oneof event { |
| 1945 | PrintFtraceEvent print = 3; |
| 1946 | SchedSwitchFtraceEvent sched_switch = 4; |
| 1947 | // removed field with id 5; |
| 1948 | // removed field with id 6; |
| 1949 | // removed field with id 7; |
| 1950 | // removed field with id 8; |
| 1951 | // removed field with id 9; |
| 1952 | // removed field with id 10; |
| 1953 | CpuFrequencyFtraceEvent cpu_frequency = 11; |
| 1954 | CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12; |
| 1955 | CpuIdleFtraceEvent cpu_idle = 13; |
| 1956 | ClockEnableFtraceEvent clock_enable = 14; |
| 1957 | ClockDisableFtraceEvent clock_disable = 15; |
| 1958 | ClockSetRateFtraceEvent clock_set_rate = 16; |
| 1959 | SchedWakeupFtraceEvent sched_wakeup = 17; |
| 1960 | SchedBlockedReasonFtraceEvent sched_blocked_reason = 18; |
| 1961 | SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19; |
| 1962 | SchedWakingFtraceEvent sched_waking = 20; |
| 1963 | // removed field with id 21 |
| 1964 | // removed field with id 22 |
| 1965 | // removed field with id 23 |
| 1966 | // removed field with id 24 |
| 1967 | // removed field with id 25 |
| 1968 | // removed field with id 26 |
| 1969 | // removed field with id 27 |
| 1970 | // removed field with id 28 |
| 1971 | // removed field with id 29 |
| 1972 | // removed field with id 30 |
| 1973 | // removed field with id 31 |
| 1974 | // removed field with id 32 |
| 1975 | // removed field with id 33 |
| 1976 | // removed field with id 34 |
| 1977 | LowmemoryKillFtraceEvent lowmemory_kill = 35; |
| 1978 | // removed field with id 36 |
| 1979 | // removed field with id 37 |
| 1980 | // removed field with id 38 |
| 1981 | // removed field with id 39 |
| 1982 | // removed field with id 40 |
| 1983 | Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41; |
| 1984 | Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42; |
| 1985 | Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43; |
| 1986 | Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44; |
| 1987 | BlockRqIssueFtraceEvent block_rq_issue = 45; |
| 1988 | MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46; |
| 1989 | MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47; |
| 1990 | MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48; |
| 1991 | MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49; |
| 1992 | BinderTransactionFtraceEvent binder_transaction = 50; |
| 1993 | BinderTransactionReceivedFtraceEvent binder_transaction_received = 51; |
| 1994 | BinderSetPriorityFtraceEvent binder_set_priority = 52; |
| 1995 | BinderLockFtraceEvent binder_lock = 53; |
| 1996 | BinderLockedFtraceEvent binder_locked = 54; |
| 1997 | BinderUnlockFtraceEvent binder_unlock = 55; |
| 1998 | // removed field with id 56 |
| 1999 | // removed field with id 57 |
| 2000 | // removed field with id 58 |
| 2001 | // removed field with id 59 |
| 2002 | // removed field with id 60 |
| 2003 | // removed field with id 61 |
| 2004 | // removed field with id 62 |
| 2005 | // removed field with id 63 |
| 2006 | // removed field with id 64 |
| 2007 | // removed field with id 65 |
| 2008 | // removed field with id 66 |
| 2009 | // removed field with id 67 |
| 2010 | // removed field with id 68 |
| 2011 | // removed field with id 69 |
| 2012 | // removed field with id 70 |
| 2013 | // removed field with id 71 |
| 2014 | // removed field with id 72 |
| 2015 | // removed field with id 73 |
| 2016 | // removed field with id 74 |
| 2017 | // removed field with id 75 |
| 2018 | // removed field with id 76 |
| 2019 | // removed field with id 77 |
| 2020 | // removed field with id 78 |
| 2021 | // removed field with id 79 |
| 2022 | // removed field with id 80 |
| 2023 | // removed field with id 81 |
| 2024 | // removed field with id 82 |
| 2025 | // removed field with id 83 |
| 2026 | // removed field with id 84 |
| 2027 | // removed field with id 85 |
| 2028 | // removed field with id 86 |
| 2029 | // removed field with id 87 |
| 2030 | // removed field with id 88 |
| 2031 | // removed field with id 89 |
| 2032 | // removed field with id 90 |
| 2033 | // removed field with id 91 |
| 2034 | // removed field with id 92 |
| 2035 | // removed field with id 93 |
| 2036 | // removed field with id 94 |
| 2037 | // removed field with id 95 |
| 2038 | // removed field with id 96 |
| 2039 | MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97; |
| 2040 | MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache = |
| 2041 | 98; |
| 2042 | // removed field with id 99 |
| 2043 | // removed field with id 100 |
| 2044 | // removed field with id 101 |
| 2045 | // removed field with id 102 |
| 2046 | // removed field with id 103 |
| 2047 | // removed field with id 104 |
| 2048 | // removed field with id 105 |
| 2049 | // removed field with id 106 |
| 2050 | // removed field with id 107 |
| 2051 | // removed field with id 108 |
| 2052 | // removed field with id 109 |
| 2053 | // removed field with id 110 |
| 2054 | // removed field with id 111 |
| 2055 | // removed field with id 112 |
| 2056 | SuspendResumeFtraceEvent suspend_resume = 113; |
| 2057 | SchedWakeupNewFtraceEvent sched_wakeup_new = 114; |
| 2058 | BlockBioBackmergeFtraceEvent block_bio_backmerge = 115; |
| 2059 | BlockBioBounceFtraceEvent block_bio_bounce = 116; |
| 2060 | BlockBioCompleteFtraceEvent block_bio_complete = 117; |
| 2061 | BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118; |
| 2062 | BlockBioQueueFtraceEvent block_bio_queue = 119; |
| 2063 | BlockBioRemapFtraceEvent block_bio_remap = 120; |
| 2064 | BlockDirtyBufferFtraceEvent block_dirty_buffer = 121; |
| 2065 | BlockGetrqFtraceEvent block_getrq = 122; |
| 2066 | BlockPlugFtraceEvent block_plug = 123; |
| 2067 | BlockRqAbortFtraceEvent block_rq_abort = 124; |
| 2068 | BlockRqCompleteFtraceEvent block_rq_complete = 125; |
| 2069 | BlockRqInsertFtraceEvent block_rq_insert = 126; |
| 2070 | // removed field with id 127; |
| 2071 | BlockRqRemapFtraceEvent block_rq_remap = 128; |
| 2072 | BlockRqRequeueFtraceEvent block_rq_requeue = 129; |
| 2073 | BlockSleeprqFtraceEvent block_sleeprq = 130; |
| 2074 | BlockSplitFtraceEvent block_split = 131; |
| 2075 | BlockTouchBufferFtraceEvent block_touch_buffer = 132; |
| 2076 | BlockUnplugFtraceEvent block_unplug = 133; |
| 2077 | Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134; |
| 2078 | Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135; |
| 2079 | Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136; |
| 2080 | Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137; |
| 2081 | Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138; |
| 2082 | Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139; |
| 2083 | Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140; |
| 2084 | Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141; |
| 2085 | Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142; |
| 2086 | Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143; |
| 2087 | Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144; |
| 2088 | Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145; |
| 2089 | Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146; |
| 2090 | Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147; |
| 2091 | Ext4DropInodeFtraceEvent ext4_drop_inode = 148; |
| 2092 | Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149; |
| 2093 | Ext4EsFindDelayedExtentRangeEnterFtraceEvent |
| 2094 | ext4_es_find_delayed_extent_range_enter = 150; |
| 2095 | Ext4EsFindDelayedExtentRangeExitFtraceEvent |
| 2096 | ext4_es_find_delayed_extent_range_exit = 151; |
| 2097 | Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152; |
| 2098 | Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153; |
| 2099 | Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154; |
| 2100 | Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155; |
| 2101 | Ext4EsShrinkFtraceEvent ext4_es_shrink = 156; |
| 2102 | Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157; |
| 2103 | Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158; |
| 2104 | Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159; |
| 2105 | Ext4EvictInodeFtraceEvent ext4_evict_inode = 160; |
| 2106 | Ext4ExtConvertToInitializedEnterFtraceEvent |
| 2107 | ext4_ext_convert_to_initialized_enter = 161; |
| 2108 | Ext4ExtConvertToInitializedFastpathFtraceEvent |
| 2109 | ext4_ext_convert_to_initialized_fastpath = 162; |
| 2110 | Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents = |
| 2111 | 163; |
| 2112 | Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164; |
| 2113 | Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165; |
| 2114 | Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166; |
| 2115 | Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167; |
| 2116 | Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168; |
| 2117 | Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169; |
| 2118 | Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170; |
| 2119 | Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171; |
| 2120 | Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172; |
| 2121 | Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173; |
| 2122 | Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174; |
| 2123 | Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175; |
| 2124 | Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176; |
| 2125 | Ext4ForgetFtraceEvent ext4_forget = 177; |
| 2126 | Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178; |
| 2127 | Ext4FreeInodeFtraceEvent ext4_free_inode = 179; |
| 2128 | Ext4GetImpliedClusterAllocExitFtraceEvent |
| 2129 | ext4_get_implied_cluster_alloc_exit = 180; |
| 2130 | Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc = |
| 2131 | 181; |
| 2132 | Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182; |
| 2133 | Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183; |
| 2134 | Ext4InsertRangeFtraceEvent ext4_insert_range = 184; |
| 2135 | Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185; |
| 2136 | Ext4JournalStartFtraceEvent ext4_journal_start = 186; |
| 2137 | Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187; |
| 2138 | Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage = |
| 2139 | 188; |
| 2140 | Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189; |
| 2141 | Ext4LoadInodeFtraceEvent ext4_load_inode = 190; |
| 2142 | Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191; |
| 2143 | Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192; |
| 2144 | Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193; |
| 2145 | Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194; |
| 2146 | Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195; |
| 2147 | Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196; |
| 2148 | Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197; |
| 2149 | Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198; |
| 2150 | Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199; |
| 2151 | Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200; |
| 2152 | Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201; |
| 2153 | Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202; |
| 2154 | Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203; |
| 2155 | Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204; |
| 2156 | Ext4PunchHoleFtraceEvent ext4_punch_hole = 205; |
| 2157 | Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206; |
| 2158 | Ext4ReadpageFtraceEvent ext4_readpage = 207; |
| 2159 | Ext4ReleasepageFtraceEvent ext4_releasepage = 208; |
| 2160 | Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209; |
| 2161 | Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210; |
| 2162 | Ext4RequestInodeFtraceEvent ext4_request_inode = 211; |
| 2163 | Ext4SyncFsFtraceEvent ext4_sync_fs = 212; |
| 2164 | Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213; |
| 2165 | Ext4TrimExtentFtraceEvent ext4_trim_extent = 214; |
| 2166 | Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215; |
| 2167 | Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216; |
| 2168 | Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217; |
| 2169 | Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218; |
| 2170 | Ext4WriteBeginFtraceEvent ext4_write_begin = 219; |
| 2171 | // removed field with id 220; |
| 2172 | // removed field with id 221; |
| 2173 | // removed field with id 222; |
| 2174 | // removed field with id 223; |
| 2175 | // removed field with id 224; |
| 2176 | // removed field with id 225; |
| 2177 | // removed field with id 226; |
| 2178 | // removed field with id 227; |
| 2179 | // removed field with id 228; |
| 2180 | // removed field with id 229; |
| 2181 | Ext4WriteEndFtraceEvent ext4_write_end = 230; |
| 2182 | Ext4WritepageFtraceEvent ext4_writepage = 231; |
| 2183 | Ext4WritepagesFtraceEvent ext4_writepages = 232; |
| 2184 | Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233; |
| 2185 | Ext4ZeroRangeFtraceEvent ext4_zero_range = 234; |
| 2186 | TaskNewtaskFtraceEvent task_newtask = 235; |
| 2187 | TaskRenameFtraceEvent task_rename = 236; |
| 2188 | SchedProcessExecFtraceEvent sched_process_exec = 237; |
| 2189 | SchedProcessExitFtraceEvent sched_process_exit = 238; |
| 2190 | SchedProcessForkFtraceEvent sched_process_fork = 239; |
| 2191 | SchedProcessFreeFtraceEvent sched_process_free = 240; |
| 2192 | SchedProcessHangFtraceEvent sched_process_hang = 241; |
| 2193 | SchedProcessWaitFtraceEvent sched_process_wait = 242; |
| 2194 | F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243; |
| 2195 | F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244; |
| 2196 | F2fsFallocateFtraceEvent f2fs_fallocate = 245; |
| 2197 | F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246; |
| 2198 | F2fsGetVictimFtraceEvent f2fs_get_victim = 247; |
| 2199 | F2fsIgetFtraceEvent f2fs_iget = 248; |
| 2200 | F2fsIgetExitFtraceEvent f2fs_iget_exit = 249; |
| 2201 | F2fsNewInodeFtraceEvent f2fs_new_inode = 250; |
| 2202 | F2fsReadpageFtraceEvent f2fs_readpage = 251; |
| 2203 | F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252; |
| 2204 | F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253; |
| 2205 | F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254; |
| 2206 | F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255; |
| 2207 | F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256; |
| 2208 | F2fsSyncFsFtraceEvent f2fs_sync_fs = 257; |
| 2209 | F2fsTruncateFtraceEvent f2fs_truncate = 258; |
| 2210 | F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259; |
| 2211 | F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260; |
| 2212 | F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range = |
| 2213 | 261; |
| 2214 | F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter = |
| 2215 | 262; |
| 2216 | F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit = |
| 2217 | 263; |
| 2218 | F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264; |
| 2219 | F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265; |
| 2220 | F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266; |
| 2221 | F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267; |
| 2222 | F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268; |
| 2223 | F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269; |
| 2224 | F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270; |
| 2225 | F2fsWriteBeginFtraceEvent f2fs_write_begin = 271; |
| 2226 | F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272; |
| 2227 | F2fsWriteEndFtraceEvent f2fs_write_end = 273; |
| 2228 | AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274; |
| 2229 | AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275; |
| 2230 | AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276; |
| 2231 | AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277; |
| 2232 | AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278; |
| 2233 | AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279; |
| 2234 | DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280; |
| 2235 | IommuMapRangeFtraceEvent iommu_map_range = 281; |
| 2236 | IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282; |
| 2237 | IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283; |
| 2238 | IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284; |
| 2239 | IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285; |
| 2240 | IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286; |
| 2241 | IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287; |
| 2242 | IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288; |
| 2243 | IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289; |
| 2244 | IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290; |
| 2245 | IonPrefetchingFtraceEvent ion_prefetching = 291; |
| 2246 | IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292; |
| 2247 | IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start = |
| 2248 | 293; |
| 2249 | IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294; |
| 2250 | IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295; |
| 2251 | IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296; |
| 2252 | IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start = |
| 2253 | 297; |
| 2254 | KfreeFtraceEvent kfree = 298; |
| 2255 | KmallocFtraceEvent kmalloc = 299; |
| 2256 | KmallocNodeFtraceEvent kmalloc_node = 300; |
| 2257 | KmemCacheAllocFtraceEvent kmem_cache_alloc = 301; |
| 2258 | KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302; |
| 2259 | KmemCacheFreeFtraceEvent kmem_cache_free = 303; |
| 2260 | MigratePagesEndFtraceEvent migrate_pages_end = 304; |
| 2261 | MigratePagesStartFtraceEvent migrate_pages_start = 305; |
| 2262 | MigrateRetryFtraceEvent migrate_retry = 306; |
| 2263 | MmPageAllocFtraceEvent mm_page_alloc = 307; |
| 2264 | MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308; |
| 2265 | MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309; |
| 2266 | MmPageFreeFtraceEvent mm_page_free = 310; |
| 2267 | MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311; |
| 2268 | MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312; |
| 2269 | RssStatFtraceEvent rss_stat = 313; |
| 2270 | IonHeapShrinkFtraceEvent ion_heap_shrink = 314; |
| 2271 | IonHeapGrowFtraceEvent ion_heap_grow = 315; |
| 2272 | // removed field with id 316 |
| 2273 | // removed field with id 317 |
| 2274 | // removed field with id 318 |
| 2275 | // removed field with id 319 |
| 2276 | ClkEnableFtraceEvent clk_enable = 320; |
| 2277 | ClkDisableFtraceEvent clk_disable = 321; |
| 2278 | ClkSetRateFtraceEvent clk_set_rate = 322; |
| 2279 | BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323; |
| 2280 | SignalDeliverFtraceEvent signal_deliver = 324; |
| 2281 | SignalGenerateFtraceEvent signal_generate = 325; |
| 2282 | // removed field with id 326 |
Isabelle Taylor | 98e560d | 2018-11-22 11:59:12 +0000 | [diff] [blame] | 2283 | GenericFtraceEvent generic = 327; |
Lalit Maganti | 3bd67ef | 2019-01-18 17:44:09 +0000 | [diff] [blame] | 2284 | MmEventRecordFtraceEvent mm_event_record = 328; |
Lalit Maganti | a73a725 | 2019-01-25 10:32:40 +0000 | [diff] [blame] | 2285 | SysEnterFtraceEvent sys_enter = 329; |
| 2286 | SysExitFtraceEvent sys_exit = 330; |
Hector Dearman | bfc2411 | 2019-06-04 19:35:51 +0100 | [diff] [blame] | 2287 | ZeroFtraceEvent zero = 331; |
Sidath Senanayake | 1f5f93a | 2019-06-06 22:24:15 +0100 | [diff] [blame] | 2288 | GpuFrequencyFtraceEvent gpu_frequency = 332; |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2289 | } |
| 2290 | } |
| 2291 | |
| 2292 | // End of protos/perfetto/trace/ftrace/ftrace_event.proto |
| 2293 | |
| 2294 | // Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto |
| 2295 | |
Ryan | bcc3456 | 2019-09-18 17:40:39 +0100 | [diff] [blame] | 2296 | // The result of tracing one or more ftrace data pages from a single per-cpu |
| 2297 | // kernel ring buffer. If collating multiple pages' worth of events, all of |
| 2298 | // them come from contiguous pages, with no kernel data loss in between. |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2299 | message FtraceEventBundle { |
| 2300 | optional uint32 cpu = 1; |
| 2301 | repeated FtraceEvent event = 2; |
Ryan | bcc3456 | 2019-09-18 17:40:39 +0100 | [diff] [blame] | 2302 | // Set to true if there was data loss between the last time we've read from |
| 2303 | // the corresponding per-cpu kernel buffer, and the earliest event recorded |
| 2304 | // in this bundle. |
Ryan Savitski | c7fb94a | 2019-07-24 22:42:43 +0100 | [diff] [blame] | 2305 | optional bool lost_events = 3; |
Ryan | bcc3456 | 2019-09-18 17:40:39 +0100 | [diff] [blame] | 2306 | |
| 2307 | // Optionally-enabled compact encoding of a batch of scheduling events. Only |
| 2308 | // a subset of events & their fields is recorded. |
| 2309 | // All fields (except comms) are stored in a structure-of-arrays form, one |
| 2310 | // entry in each repeated field per event. |
| 2311 | // TODO(rsavitski): unstable, do not use. |
| 2312 | message CompactSched { |
| 2313 | // Delta-encoded timestamps across all sched_switch events within this |
| 2314 | // bundle. The first is absolute, each next one is relative to its |
| 2315 | // predecessor. |
| 2316 | repeated uint64 switch_timestamp = 1 [packed = true]; |
Ryan Savitski | eb65cc6 | 2019-09-24 16:39:08 +0100 | [diff] [blame] | 2317 | repeated int64 switch_prev_state = 2 [packed = true]; |
Ryan | bcc3456 | 2019-09-18 17:40:39 +0100 | [diff] [blame] | 2318 | repeated int32 switch_next_pid = 3 [packed = true]; |
| 2319 | repeated int32 switch_next_prio = 4 [packed = true]; |
| 2320 | |
| 2321 | // Interned table of unique comm strings for this bundle. |
| 2322 | repeated string switch_next_comm_table = 5; |
| 2323 | // One per event, index into |switch_next_comm_table| corresponding to the |
| 2324 | // next_comm field of the event. |
| 2325 | repeated uint32 switch_next_comm_index = 6 [packed = true]; |
| 2326 | } |
| 2327 | optional CompactSched compact_sched = 4; |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2328 | } |
| 2329 | |
| 2330 | // End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto |
| 2331 | |
| 2332 | // Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto |
| 2333 | |
| 2334 | // Per-CPU stats for the ftrace data source gathered from the kernel from |
| 2335 | // /sys/kernel/debug/tracing/per_cpu/cpuX/stats. |
| 2336 | message FtraceCpuStats { |
| 2337 | // CPU index. |
| 2338 | optional uint64 cpu = 1; |
| 2339 | |
| 2340 | // Number of entries still in the kernel buffer. Ideally this should be close |
| 2341 | // to zero, as events are consumed regularly and moved into the userspace |
| 2342 | // buffers (or file). |
| 2343 | optional uint64 entries = 2; |
| 2344 | |
| 2345 | // Number of events lost in kernel buffers due to overwriting of old events |
| 2346 | // before userspace had a chance to drain them. |
| 2347 | optional uint64 overrun = 3; |
| 2348 | |
| 2349 | // This should always be zero. If not the buffer size is way too small or |
| 2350 | // something went wrong with the tracer. |
| 2351 | optional uint64 commit_overrun = 4; |
| 2352 | |
| 2353 | // Bytes actually read (not overwritten). |
| 2354 | optional uint64 bytes_read = 5; |
| 2355 | |
| 2356 | // The timestamp for the oldest event still in the ring buffer. |
| 2357 | optional double oldest_event_ts = 6; |
| 2358 | |
| 2359 | // The current timestamp. |
| 2360 | optional double now_ts = 7; |
| 2361 | |
| 2362 | // If the kernel buffer has overwrite mode disabled, this will show the number |
| 2363 | // of new events that were lost because the buffer was full. This is similar |
| 2364 | // to |overrun| but only for the overwrite=false case. |
| 2365 | optional uint64 dropped_events = 8; |
| 2366 | |
| 2367 | // The number of events read. |
| 2368 | optional uint64 read_events = 9; |
| 2369 | } |
| 2370 | |
| 2371 | // Ftrace stats for all CPUs. |
| 2372 | message FtraceStats { |
| 2373 | enum Phase { |
| 2374 | UNSPECIFIED = 0; |
| 2375 | START_OF_TRACE = 1; |
| 2376 | END_OF_TRACE = 2; |
| 2377 | } |
| 2378 | |
| 2379 | // Tells when stats were sampled. There should be one sample at the beginning |
| 2380 | // of the trace and one sample at the end. |
| 2381 | optional Phase phase = 1; |
| 2382 | |
| 2383 | // Per-CPU stats (one entry for each CPU). |
| 2384 | repeated FtraceCpuStats cpu_stats = 2; |
| 2385 | } |
| 2386 | |
| 2387 | // End of protos/perfetto/trace/ftrace/ftrace_stats.proto |
| 2388 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 2389 | // Begin of protos/perfetto/trace/ftrace/generic.proto |
| 2390 | |
| 2391 | // This generic proto is used to output events in the trace |
| 2392 | // when a specific proto for that event does not exist. |
| 2393 | message GenericFtraceEvent { |
| 2394 | message Field { |
| 2395 | optional string name = 1; |
| 2396 | oneof value { |
| 2397 | string str_value = 3; |
| 2398 | int64 int_value = 4; |
| 2399 | uint64 uint_value = 5; |
| 2400 | } |
| 2401 | } |
| 2402 | |
| 2403 | optional string event_name = 1; |
| 2404 | repeated Field field = 2; |
| 2405 | } |
| 2406 | |
| 2407 | // End of protos/perfetto/trace/ftrace/generic.proto |
| 2408 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2409 | // Begin of protos/perfetto/trace/ftrace/kmem.proto |
| 2410 | |
| 2411 | message AllocPagesIommuEndFtraceEvent { |
| 2412 | optional uint32 gfp_flags = 1; |
| 2413 | optional uint32 order = 2; |
| 2414 | } |
| 2415 | message AllocPagesIommuFailFtraceEvent { |
| 2416 | optional uint32 gfp_flags = 1; |
| 2417 | optional uint32 order = 2; |
| 2418 | } |
| 2419 | message AllocPagesIommuStartFtraceEvent { |
| 2420 | optional uint32 gfp_flags = 1; |
| 2421 | optional uint32 order = 2; |
| 2422 | } |
| 2423 | message AllocPagesSysEndFtraceEvent { |
| 2424 | optional uint32 gfp_flags = 1; |
| 2425 | optional uint32 order = 2; |
| 2426 | } |
| 2427 | message AllocPagesSysFailFtraceEvent { |
| 2428 | optional uint32 gfp_flags = 1; |
| 2429 | optional uint32 order = 2; |
| 2430 | } |
| 2431 | message AllocPagesSysStartFtraceEvent { |
| 2432 | optional uint32 gfp_flags = 1; |
| 2433 | optional uint32 order = 2; |
| 2434 | } |
| 2435 | message DmaAllocContiguousRetryFtraceEvent { |
| 2436 | optional int32 tries = 1; |
| 2437 | } |
| 2438 | message IommuMapRangeFtraceEvent { |
| 2439 | optional uint64 chunk_size = 1; |
| 2440 | optional uint64 len = 2; |
| 2441 | optional uint64 pa = 3; |
| 2442 | optional uint64 va = 4; |
| 2443 | } |
| 2444 | message IommuSecPtblMapRangeEndFtraceEvent { |
| 2445 | optional uint64 len = 1; |
| 2446 | optional int32 num = 2; |
| 2447 | optional uint32 pa = 3; |
| 2448 | optional int32 sec_id = 4; |
| 2449 | optional uint64 va = 5; |
| 2450 | } |
| 2451 | message IommuSecPtblMapRangeStartFtraceEvent { |
| 2452 | optional uint64 len = 1; |
| 2453 | optional int32 num = 2; |
| 2454 | optional uint32 pa = 3; |
| 2455 | optional int32 sec_id = 4; |
| 2456 | optional uint64 va = 5; |
| 2457 | } |
| 2458 | message IonAllocBufferEndFtraceEvent { |
| 2459 | optional string client_name = 1; |
| 2460 | optional uint32 flags = 2; |
| 2461 | optional string heap_name = 3; |
| 2462 | optional uint64 len = 4; |
| 2463 | optional uint32 mask = 5; |
| 2464 | } |
| 2465 | message IonAllocBufferFailFtraceEvent { |
| 2466 | optional string client_name = 1; |
| 2467 | optional int64 error = 2; |
| 2468 | optional uint32 flags = 3; |
| 2469 | optional string heap_name = 4; |
| 2470 | optional uint64 len = 5; |
| 2471 | optional uint32 mask = 6; |
| 2472 | } |
| 2473 | message IonAllocBufferFallbackFtraceEvent { |
| 2474 | optional string client_name = 1; |
| 2475 | optional int64 error = 2; |
| 2476 | optional uint32 flags = 3; |
| 2477 | optional string heap_name = 4; |
| 2478 | optional uint64 len = 5; |
| 2479 | optional uint32 mask = 6; |
| 2480 | } |
| 2481 | message IonAllocBufferStartFtraceEvent { |
| 2482 | optional string client_name = 1; |
| 2483 | optional uint32 flags = 2; |
| 2484 | optional string heap_name = 3; |
| 2485 | optional uint64 len = 4; |
| 2486 | optional uint32 mask = 5; |
| 2487 | } |
| 2488 | message IonCpAllocRetryFtraceEvent { |
| 2489 | optional int32 tries = 1; |
| 2490 | } |
| 2491 | message IonCpSecureBufferEndFtraceEvent { |
| 2492 | optional uint64 align = 1; |
| 2493 | optional uint64 flags = 2; |
| 2494 | optional string heap_name = 3; |
| 2495 | optional uint64 len = 4; |
| 2496 | } |
| 2497 | message IonCpSecureBufferStartFtraceEvent { |
| 2498 | optional uint64 align = 1; |
| 2499 | optional uint64 flags = 2; |
| 2500 | optional string heap_name = 3; |
| 2501 | optional uint64 len = 4; |
| 2502 | } |
| 2503 | message IonPrefetchingFtraceEvent { |
| 2504 | optional uint64 len = 1; |
| 2505 | } |
| 2506 | message IonSecureCmaAddToPoolEndFtraceEvent { |
| 2507 | optional uint32 is_prefetch = 1; |
| 2508 | optional uint64 len = 2; |
| 2509 | optional int32 pool_total = 3; |
| 2510 | } |
| 2511 | message IonSecureCmaAddToPoolStartFtraceEvent { |
| 2512 | optional uint32 is_prefetch = 1; |
| 2513 | optional uint64 len = 2; |
| 2514 | optional int32 pool_total = 3; |
| 2515 | } |
| 2516 | message IonSecureCmaAllocateEndFtraceEvent { |
| 2517 | optional uint64 align = 1; |
| 2518 | optional uint64 flags = 2; |
| 2519 | optional string heap_name = 3; |
| 2520 | optional uint64 len = 4; |
| 2521 | } |
| 2522 | message IonSecureCmaAllocateStartFtraceEvent { |
| 2523 | optional uint64 align = 1; |
| 2524 | optional uint64 flags = 2; |
| 2525 | optional string heap_name = 3; |
| 2526 | optional uint64 len = 4; |
| 2527 | } |
| 2528 | message IonSecureCmaShrinkPoolEndFtraceEvent { |
| 2529 | optional uint64 drained_size = 1; |
| 2530 | optional uint64 skipped_size = 2; |
| 2531 | } |
| 2532 | message IonSecureCmaShrinkPoolStartFtraceEvent { |
| 2533 | optional uint64 drained_size = 1; |
| 2534 | optional uint64 skipped_size = 2; |
| 2535 | } |
| 2536 | message KfreeFtraceEvent { |
| 2537 | optional uint64 call_site = 1; |
| 2538 | optional uint64 ptr = 2; |
| 2539 | } |
| 2540 | message KmallocFtraceEvent { |
| 2541 | optional uint64 bytes_alloc = 1; |
| 2542 | optional uint64 bytes_req = 2; |
| 2543 | optional uint64 call_site = 3; |
| 2544 | optional uint32 gfp_flags = 4; |
| 2545 | optional uint64 ptr = 5; |
| 2546 | } |
| 2547 | message KmallocNodeFtraceEvent { |
| 2548 | optional uint64 bytes_alloc = 1; |
| 2549 | optional uint64 bytes_req = 2; |
| 2550 | optional uint64 call_site = 3; |
| 2551 | optional uint32 gfp_flags = 4; |
| 2552 | optional int32 node = 5; |
| 2553 | optional uint64 ptr = 6; |
| 2554 | } |
| 2555 | message KmemCacheAllocFtraceEvent { |
| 2556 | optional uint64 bytes_alloc = 1; |
| 2557 | optional uint64 bytes_req = 2; |
| 2558 | optional uint64 call_site = 3; |
| 2559 | optional uint32 gfp_flags = 4; |
| 2560 | optional uint64 ptr = 5; |
| 2561 | } |
| 2562 | message KmemCacheAllocNodeFtraceEvent { |
| 2563 | optional uint64 bytes_alloc = 1; |
| 2564 | optional uint64 bytes_req = 2; |
| 2565 | optional uint64 call_site = 3; |
| 2566 | optional uint32 gfp_flags = 4; |
| 2567 | optional int32 node = 5; |
| 2568 | optional uint64 ptr = 6; |
| 2569 | } |
| 2570 | message KmemCacheFreeFtraceEvent { |
| 2571 | optional uint64 call_site = 1; |
| 2572 | optional uint64 ptr = 2; |
| 2573 | } |
| 2574 | message MigratePagesEndFtraceEvent { |
| 2575 | optional int32 mode = 1; |
| 2576 | } |
| 2577 | message MigratePagesStartFtraceEvent { |
| 2578 | optional int32 mode = 1; |
| 2579 | } |
| 2580 | message MigrateRetryFtraceEvent { |
| 2581 | optional int32 tries = 1; |
| 2582 | } |
| 2583 | message MmPageAllocFtraceEvent { |
| 2584 | optional uint32 gfp_flags = 1; |
| 2585 | optional int32 migratetype = 2; |
| 2586 | optional uint32 order = 3; |
| 2587 | optional uint64 page = 4; |
| 2588 | optional uint64 pfn = 5; |
| 2589 | } |
| 2590 | message MmPageAllocExtfragFtraceEvent { |
| 2591 | optional int32 alloc_migratetype = 1; |
| 2592 | optional int32 alloc_order = 2; |
| 2593 | optional int32 fallback_migratetype = 3; |
| 2594 | optional int32 fallback_order = 4; |
| 2595 | optional uint64 page = 5; |
| 2596 | optional int32 change_ownership = 6; |
| 2597 | optional uint64 pfn = 7; |
| 2598 | } |
| 2599 | message MmPageAllocZoneLockedFtraceEvent { |
| 2600 | optional int32 migratetype = 1; |
| 2601 | optional uint32 order = 2; |
| 2602 | optional uint64 page = 3; |
| 2603 | optional uint64 pfn = 4; |
| 2604 | } |
| 2605 | message MmPageFreeFtraceEvent { |
| 2606 | optional uint32 order = 1; |
| 2607 | optional uint64 page = 2; |
| 2608 | optional uint64 pfn = 3; |
| 2609 | } |
| 2610 | message MmPageFreeBatchedFtraceEvent { |
| 2611 | optional int32 cold = 1; |
| 2612 | optional uint64 page = 2; |
| 2613 | optional uint64 pfn = 3; |
| 2614 | } |
| 2615 | message MmPagePcpuDrainFtraceEvent { |
| 2616 | optional int32 migratetype = 1; |
| 2617 | optional uint32 order = 2; |
| 2618 | optional uint64 page = 3; |
| 2619 | optional uint64 pfn = 4; |
| 2620 | } |
| 2621 | message RssStatFtraceEvent { |
| 2622 | optional int32 member = 1; |
| 2623 | optional int64 size = 2; |
| 2624 | } |
| 2625 | message IonHeapShrinkFtraceEvent { |
| 2626 | optional string heap_name = 1; |
| 2627 | optional uint64 len = 2; |
| 2628 | optional int64 total_allocated = 3; |
| 2629 | } |
| 2630 | message IonHeapGrowFtraceEvent { |
| 2631 | optional string heap_name = 1; |
| 2632 | optional uint64 len = 2; |
| 2633 | optional int64 total_allocated = 3; |
| 2634 | } |
| 2635 | |
| 2636 | // End of protos/perfetto/trace/ftrace/kmem.proto |
| 2637 | |
| 2638 | // Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2639 | |
| 2640 | message LowmemoryKillFtraceEvent { |
| 2641 | optional string comm = 1; |
| 2642 | optional int32 pid = 2; |
| 2643 | optional int64 pagecache_size = 3; |
| 2644 | optional int64 pagecache_limit = 4; |
| 2645 | optional int64 free = 5; |
| 2646 | } |
| 2647 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2648 | // End of protos/perfetto/trace/ftrace/lowmemorykiller.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2649 | |
Lalit Maganti | 3bd67ef | 2019-01-18 17:44:09 +0000 | [diff] [blame] | 2650 | // Begin of protos/perfetto/trace/ftrace/mm_event.proto |
| 2651 | |
| 2652 | message MmEventRecordFtraceEvent { |
| 2653 | optional uint32 avg_lat = 1; |
| 2654 | optional uint32 count = 2; |
| 2655 | optional uint32 max_lat = 3; |
| 2656 | optional uint32 type = 4; |
| 2657 | } |
| 2658 | |
| 2659 | // End of protos/perfetto/trace/ftrace/mm_event.proto |
| 2660 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2661 | // Begin of protos/perfetto/trace/ftrace/power.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2662 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2663 | message CpuFrequencyFtraceEvent { |
| 2664 | optional uint32 state = 1; |
| 2665 | optional uint32 cpu_id = 2; |
| 2666 | } |
| 2667 | message CpuFrequencyLimitsFtraceEvent { |
| 2668 | optional uint32 min_freq = 1; |
| 2669 | optional uint32 max_freq = 2; |
| 2670 | optional uint32 cpu_id = 3; |
| 2671 | } |
| 2672 | message CpuIdleFtraceEvent { |
| 2673 | optional uint32 state = 1; |
| 2674 | optional uint32 cpu_id = 2; |
| 2675 | } |
| 2676 | message ClockEnableFtraceEvent { |
| 2677 | optional string name = 1; |
| 2678 | optional uint64 state = 2; |
| 2679 | optional uint64 cpu_id = 3; |
| 2680 | } |
| 2681 | message ClockDisableFtraceEvent { |
| 2682 | optional string name = 1; |
| 2683 | optional uint64 state = 2; |
| 2684 | optional uint64 cpu_id = 3; |
| 2685 | } |
| 2686 | message ClockSetRateFtraceEvent { |
| 2687 | optional string name = 1; |
| 2688 | optional uint64 state = 2; |
| 2689 | optional uint64 cpu_id = 3; |
| 2690 | } |
| 2691 | message SuspendResumeFtraceEvent { |
| 2692 | optional string action = 1; |
| 2693 | optional int32 val = 2; |
| 2694 | optional uint32 start = 3; |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2695 | } |
Sidath Senanayake | 1f5f93a | 2019-06-06 22:24:15 +0100 | [diff] [blame] | 2696 | message GpuFrequencyFtraceEvent { |
| 2697 | optional uint32 gpu_id = 1; |
| 2698 | optional uint32 state = 2; |
| 2699 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2700 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2701 | // End of protos/perfetto/trace/ftrace/power.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2702 | |
Lalit Maganti | a73a725 | 2019-01-25 10:32:40 +0000 | [diff] [blame] | 2703 | // Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto |
| 2704 | |
| 2705 | message SysEnterFtraceEvent { |
| 2706 | optional int64 id = 1; |
| 2707 | } |
| 2708 | message SysExitFtraceEvent { |
| 2709 | optional int64 id = 1; |
| 2710 | optional int64 ret = 2; |
| 2711 | } |
| 2712 | |
| 2713 | // End of protos/perfetto/trace/ftrace/raw_syscalls.proto |
| 2714 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2715 | // Begin of protos/perfetto/trace/ftrace/sched.proto |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2716 | |
| 2717 | message SchedSwitchFtraceEvent { |
| 2718 | optional string prev_comm = 1; |
| 2719 | optional int32 prev_pid = 2; |
| 2720 | optional int32 prev_prio = 3; |
| 2721 | optional int64 prev_state = 4; |
| 2722 | optional string next_comm = 5; |
| 2723 | optional int32 next_pid = 6; |
| 2724 | optional int32 next_prio = 7; |
| 2725 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2726 | message SchedWakeupFtraceEvent { |
| 2727 | optional string comm = 1; |
| 2728 | optional int32 pid = 2; |
| 2729 | optional int32 prio = 3; |
| 2730 | optional int32 success = 4; |
| 2731 | optional int32 target_cpu = 5; |
| 2732 | } |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2733 | message SchedBlockedReasonFtraceEvent { |
| 2734 | optional int32 pid = 1; |
| 2735 | optional uint64 caller = 2; |
| 2736 | optional uint32 io_wait = 3; |
| 2737 | } |
| 2738 | message SchedCpuHotplugFtraceEvent { |
| 2739 | optional int32 affected_cpu = 1; |
| 2740 | optional int32 error = 2; |
| 2741 | optional int32 status = 3; |
| 2742 | } |
| 2743 | message SchedWakingFtraceEvent { |
| 2744 | optional string comm = 1; |
| 2745 | optional int32 pid = 2; |
| 2746 | optional int32 prio = 3; |
| 2747 | optional int32 success = 4; |
| 2748 | optional int32 target_cpu = 5; |
| 2749 | } |
| 2750 | message SchedWakeupNewFtraceEvent { |
| 2751 | optional string comm = 1; |
| 2752 | optional int32 pid = 2; |
| 2753 | optional int32 prio = 3; |
| 2754 | optional int32 success = 4; |
| 2755 | optional int32 target_cpu = 5; |
| 2756 | } |
| 2757 | message SchedProcessExecFtraceEvent { |
| 2758 | optional string filename = 1; |
| 2759 | optional int32 pid = 2; |
| 2760 | optional int32 old_pid = 3; |
| 2761 | } |
| 2762 | message SchedProcessExitFtraceEvent { |
| 2763 | optional string comm = 1; |
| 2764 | optional int32 pid = 2; |
| 2765 | optional int32 tgid = 3; |
| 2766 | optional int32 prio = 4; |
| 2767 | } |
| 2768 | message SchedProcessForkFtraceEvent { |
| 2769 | optional string parent_comm = 1; |
| 2770 | optional int32 parent_pid = 2; |
| 2771 | optional string child_comm = 3; |
| 2772 | optional int32 child_pid = 4; |
| 2773 | } |
| 2774 | message SchedProcessFreeFtraceEvent { |
| 2775 | optional string comm = 1; |
| 2776 | optional int32 pid = 2; |
| 2777 | optional int32 prio = 3; |
| 2778 | } |
| 2779 | message SchedProcessHangFtraceEvent { |
| 2780 | optional string comm = 1; |
| 2781 | optional int32 pid = 2; |
| 2782 | } |
| 2783 | message SchedProcessWaitFtraceEvent { |
| 2784 | optional string comm = 1; |
| 2785 | optional int32 pid = 2; |
| 2786 | optional int32 prio = 3; |
| 2787 | } |
Hector Dearman | 55ef3e0 | 2018-04-11 17:28:55 +0100 | [diff] [blame] | 2788 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2789 | // End of protos/perfetto/trace/ftrace/sched.proto |
| 2790 | |
| 2791 | // Begin of protos/perfetto/trace/ftrace/signal.proto |
| 2792 | |
| 2793 | message SignalDeliverFtraceEvent { |
| 2794 | optional int32 code = 1; |
| 2795 | optional uint64 sa_flags = 2; |
| 2796 | optional int32 sig = 3; |
| 2797 | } |
| 2798 | message SignalGenerateFtraceEvent { |
| 2799 | optional int32 code = 1; |
| 2800 | optional string comm = 2; |
| 2801 | optional int32 group = 3; |
| 2802 | optional int32 pid = 4; |
| 2803 | optional int32 result = 5; |
| 2804 | optional int32 sig = 6; |
| 2805 | } |
| 2806 | |
| 2807 | // End of protos/perfetto/trace/ftrace/signal.proto |
| 2808 | |
Hector Dearman | bfc2411 | 2019-06-04 19:35:51 +0100 | [diff] [blame] | 2809 | // Begin of protos/perfetto/trace/ftrace/systrace.proto |
| 2810 | |
| 2811 | message ZeroFtraceEvent { |
| 2812 | optional int32 flag = 1; |
| 2813 | optional string name = 2; |
| 2814 | optional int32 pid = 3; |
| 2815 | optional int64 value = 4; |
| 2816 | } |
| 2817 | |
| 2818 | // End of protos/perfetto/trace/ftrace/systrace.proto |
| 2819 | |
Hector Dearman | e0e5780 | 2018-11-21 16:09:56 +0000 | [diff] [blame] | 2820 | // Begin of protos/perfetto/trace/ftrace/task.proto |
| 2821 | |
| 2822 | message TaskNewtaskFtraceEvent { |
| 2823 | optional int32 pid = 1; |
| 2824 | optional string comm = 2; |
| 2825 | optional uint64 clone_flags = 3; |
| 2826 | optional int32 oom_score_adj = 4; |
| 2827 | } |
| 2828 | message TaskRenameFtraceEvent { |
| 2829 | optional int32 pid = 1; |
| 2830 | optional string oldcomm = 2; |
| 2831 | optional string newcomm = 3; |
| 2832 | optional int32 oom_score_adj = 4; |
| 2833 | } |
| 2834 | |
| 2835 | // End of protos/perfetto/trace/ftrace/task.proto |
| 2836 | |
| 2837 | // Begin of protos/perfetto/trace/ftrace/vmscan.proto |
| 2838 | |
| 2839 | message MmVmscanDirectReclaimBeginFtraceEvent { |
| 2840 | optional int32 order = 1; |
| 2841 | optional int32 may_writepage = 2; |
| 2842 | optional uint32 gfp_flags = 3; |
| 2843 | } |
| 2844 | message MmVmscanDirectReclaimEndFtraceEvent { |
| 2845 | optional uint64 nr_reclaimed = 1; |
| 2846 | } |
| 2847 | message MmVmscanKswapdWakeFtraceEvent { |
| 2848 | optional int32 nid = 1; |
| 2849 | optional int32 order = 2; |
| 2850 | } |
| 2851 | message MmVmscanKswapdSleepFtraceEvent { |
| 2852 | optional int32 nid = 1; |
| 2853 | } |
| 2854 | |
| 2855 | // End of protos/perfetto/trace/ftrace/vmscan.proto |
Isabelle Taylor | 98e560d | 2018-11-22 11:59:12 +0000 | [diff] [blame] | 2856 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2857 | // Begin of protos/perfetto/trace/interned_data/interned_data.proto |
| 2858 | |
| 2859 | // ------------------------------ DATA INTERNING: ------------------------------ |
| 2860 | // Interning indexes are built up gradually by adding the entries contained in |
| 2861 | // each TracePacket of the same packet sequence (packets emitted by the same |
| 2862 | // producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets |
| 2863 | // can only refer to interned data from other packets in the same sequence. |
| 2864 | // |
| 2865 | // The writer will emit new entries when it encounters new internable values |
| 2866 | // that aren't yet in the index. Data in current and subsequent TracePackets can |
| 2867 | // then refer to the entry by its position (interning ID, abbreviated "iid") in |
Eric Seckler | 612d1d0 | 2019-05-01 15:04:02 +0100 | [diff] [blame] | 2868 | // its index. An interning ID with value 0 is considered invalid (not set). |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2869 | // |
| 2870 | // Because of the incremental build-up, the interning index will miss data when |
| 2871 | // TracePackets are lost, e.g. because a chunk was overridden in the central |
| 2872 | // ring buffer. To avoid invalidation of the whole trace in such a case, the |
Primiano Tucci | d3f8d8e | 2019-08-12 19:00:55 +0200 | [diff] [blame] | 2873 | // index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED). |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2874 | // When packet loss occurs, the reader will only lose interning data up to the |
| 2875 | // next reset. |
| 2876 | // ----------------------------------------------------------------------------- |
| 2877 | |
| 2878 | // Message that contains new entries for the interning indices of a packet |
| 2879 | // sequence. |
| 2880 | // |
| 2881 | // The writer will usually emit new entries in the same TracePacket that first |
| 2882 | // refers to them (since the last reset of interning state). They may also be |
| 2883 | // emitted proactively in advance of referring to them in later packets. |
| 2884 | // |
Siddhartha S | 06add2b | 2019-06-20 02:58:50 -0700 | [diff] [blame] | 2885 | // Next reserved id: 8 (up to 15). |
Matthew Clarkson | 9a5dfa5 | 2019-10-03 09:54:04 +0100 | [diff] [blame] | 2886 | // Next id: 23. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2887 | message InternedData { |
| 2888 | // Each field's message type needs to specify an |iid| field, which is the ID |
| 2889 | // of the entry in the field's interning index. Each field constructs its own |
| 2890 | // index, thus interning IDs are scoped to the tracing session and field |
| 2891 | // (usually as a counter for efficient var-int encoding). It is illegal to |
| 2892 | // override entries in an index (using the same iid for two different values) |
| 2893 | // within the same tracing session, even after a reset of the emitted |
| 2894 | // interning state. |
| 2895 | repeated EventCategory event_categories = 1; |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 2896 | repeated EventName event_names = 2; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2897 | repeated DebugAnnotationName debug_annotation_names = 3; |
| 2898 | repeated SourceLocation source_locations = 4; |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 2899 | repeated LogMessageBody log_message_body = 20; |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 2900 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2901 | // Note: field IDs up to 15 should be used for frequent data only. |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 2902 | |
| 2903 | // Build IDs of exectuable files. |
| 2904 | repeated InternedString build_ids = 16; |
| 2905 | // Paths to executable files. |
| 2906 | repeated InternedString mapping_paths = 17; |
Florian Mayer | 36fb019 | 2019-08-02 11:22:45 +0100 | [diff] [blame] | 2907 | // Paths to source files. |
| 2908 | repeated InternedString source_paths = 18; |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 2909 | // Names of functions used in frames below. |
| 2910 | repeated InternedString function_names = 5; |
Florian Mayer | cf9eadc | 2019-08-05 11:59:35 +0100 | [diff] [blame] | 2911 | // Symbols that were added to this trace after the fact. |
| 2912 | repeated ProfiledFrameSymbols profiled_frame_symbols = 21; |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 2913 | |
| 2914 | // Executable files mapped into processes. |
| 2915 | repeated Mapping mappings = 19; |
| 2916 | // Frames of callstacks of a program. |
| 2917 | repeated Frame frames = 6; |
| 2918 | // A callstack of a program. |
| 2919 | repeated Callstack callstacks = 7; |
Matthew Clarkson | 9a5dfa5 | 2019-10-03 09:54:04 +0100 | [diff] [blame] | 2920 | |
| 2921 | // Additional Vulkan information sent in a VulkanMemoryEvent message |
| 2922 | repeated InternedString vulkan_memory_keys = 22; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 2923 | } |
| 2924 | |
| 2925 | // End of protos/perfetto/trace/interned_data/interned_data.proto |
| 2926 | |
Primiano Tucci | b02d8dc | 2019-06-04 11:46:43 +0100 | [diff] [blame] | 2927 | // Begin of protos/perfetto/trace/perfetto/perfetto_metatrace.proto |
| 2928 | |
| 2929 | // Used to trace the execution of perfetto itself. |
| 2930 | message PerfettoMetatrace { |
| 2931 | // See base/metatrace_events.h for definitions. |
| 2932 | oneof record_type { |
| 2933 | uint32 event_id = 1; |
| 2934 | uint32 counter_id = 2; |
| 2935 | } |
| 2936 | |
| 2937 | // Only when using |event_id|. |
| 2938 | optional uint32 event_duration_ns = 3; |
| 2939 | |
| 2940 | // Only when using |counter_id|. |
| 2941 | optional int32 counter_value = 4; |
| 2942 | |
| 2943 | // ID of the thread that emitted the event. |
| 2944 | optional uint32 thread_id = 5; |
| 2945 | |
| 2946 | // If true the meta-tracing ring buffer had overruns and hence some data is |
| 2947 | // missing from this point. |
| 2948 | optional bool has_overruns = 6; |
| 2949 | } |
| 2950 | |
| 2951 | // End of protos/perfetto/trace/perfetto/perfetto_metatrace.proto |
| 2952 | |
Primiano Tucci | b86e9ca | 2018-12-03 20:20:11 +0100 | [diff] [blame] | 2953 | // Begin of protos/perfetto/trace/power/battery_counters.proto |
| 2954 | |
| 2955 | message BatteryCounters { |
| 2956 | // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter. |
| 2957 | optional int64 charge_counter_uah = 1; |
| 2958 | |
| 2959 | // Remaining battery capacity percentage of total capacity |
| 2960 | optional float capacity_percent = 2; |
| 2961 | |
| 2962 | // Instantaneous battery current in microamperes(µA). |
| 2963 | // Positive values indicate net current entering the battery from a charge |
| 2964 | // source, negative values indicate net current discharging from the battery. |
| 2965 | optional int64 current_ua = 3; |
| 2966 | |
| 2967 | // Instantaneous battery current in microamperes(µA). |
| 2968 | optional int64 current_avg_ua = 4; |
| 2969 | } |
| 2970 | |
| 2971 | // End of protos/perfetto/trace/power/battery_counters.proto |
| 2972 | |
Esteban Talavera | 7714cec | 2019-01-31 15:53:34 +0000 | [diff] [blame] | 2973 | // Begin of protos/perfetto/trace/power/power_rails.proto |
| 2974 | |
| 2975 | message PowerRails { |
| 2976 | |
| 2977 | message RailDescriptor { |
| 2978 | // Index corresponding to the rail |
| 2979 | optional uint32 index = 1; |
| 2980 | // Name of the rail |
| 2981 | optional string rail_name = 2; |
| 2982 | // Name of the subsystem to which this rail belongs |
| 2983 | optional string subsys_name = 3; |
| 2984 | // Hardware sampling rate |
| 2985 | optional uint32 sampling_rate = 4; |
| 2986 | } |
| 2987 | |
| 2988 | // This is only emitted at the beginning of the trace. |
| 2989 | repeated RailDescriptor rail_descriptor = 1; |
| 2990 | |
| 2991 | message EnergyData { |
| 2992 | // Index corresponding to RailDescriptor.index |
| 2993 | optional uint32 index = 1; |
| 2994 | // Time since device boot(CLOCK_BOOTTIME) in milli-seconds |
| 2995 | optional uint64 timestamp_ms = 2; |
| 2996 | // Accumulated energy since device boot in microwatt-seconds (uWs) |
| 2997 | optional uint64 energy = 3; |
| 2998 | } |
| 2999 | |
| 3000 | repeated EnergyData energy_data = 2; |
| 3001 | } |
| 3002 | |
| 3003 | // End of protos/perfetto/trace/power/power_rails.proto |
| 3004 | |
Florian Mayer | 06264b4 | 2019-07-30 12:09:30 +0100 | [diff] [blame] | 3005 | // Begin of protos/perfetto/trace/profiling/heap_graph.proto |
| 3006 | |
Florian Mayer | 544d08d | 2019-10-11 13:03:40 +0100 | [diff] [blame] | 3007 | message HeapGraphRoot { |
| 3008 | // Objects retained by this root. |
| 3009 | repeated uint64 object_ids = 1; |
| 3010 | |
| 3011 | // From art:RootType, e.g. "kRootThreadObject". |
| 3012 | optional string root_type = 2; |
| 3013 | } |
| 3014 | |
Florian Mayer | 06264b4 | 2019-07-30 12:09:30 +0100 | [diff] [blame] | 3015 | message HeapGraphObject { |
| 3016 | optional uint64 id = 1; |
| 3017 | |
| 3018 | // Index for InternedData.type_names for the name of the type of this object. |
| 3019 | optional uint64 type_id = 2; |
| 3020 | |
| 3021 | // Bytes occupied by this objects. |
| 3022 | optional uint64 self_size = 3; |
| 3023 | |
| 3024 | // Indices for InternedData.field_names for the name of the field referring |
| 3025 | // to the object. |
| 3026 | repeated uint64 reference_field_id = 4; |
| 3027 | |
| 3028 | // Ids of the Object that is referred to. |
| 3029 | repeated uint64 reference_object_id = 5; |
| 3030 | } |
| 3031 | |
| 3032 | message HeapGraph { |
| 3033 | optional int32 pid = 1; |
| 3034 | |
Florian Mayer | 544d08d | 2019-10-11 13:03:40 +0100 | [diff] [blame] | 3035 | // This contains all objects at the time this dump was taken. Some of these |
| 3036 | // will be live, some of those unreachable (garbage). To find the live |
| 3037 | // objects, the client needs to build the transitive closure of objects |
| 3038 | // reachable from |roots|. |
| 3039 | // All objects not contained within that transitive closure are garbage that |
| 3040 | // has not yet been collected. |
Florian Mayer | 06264b4 | 2019-07-30 12:09:30 +0100 | [diff] [blame] | 3041 | repeated HeapGraphObject objects = 2; |
| 3042 | |
Florian Mayer | 544d08d | 2019-10-11 13:03:40 +0100 | [diff] [blame] | 3043 | // Roots at the time this dump was taken. |
| 3044 | // All live objects are reachable from the roots. All other objects are |
| 3045 | // garbage. |
| 3046 | repeated HeapGraphRoot roots = 7; |
| 3047 | |
Florian Mayer | 06264b4 | 2019-07-30 12:09:30 +0100 | [diff] [blame] | 3048 | // Type names used in managed heap graph. |
| 3049 | repeated InternedString type_names = 3; |
| 3050 | |
| 3051 | // Field names for references in managed heap graph. |
| 3052 | repeated InternedString field_names = 4; |
| 3053 | |
| 3054 | optional bool continued = 5; |
| 3055 | optional uint64 index = 6; |
| 3056 | } |
| 3057 | |
| 3058 | // End of protos/perfetto/trace/profiling/heap_graph.proto |
| 3059 | |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3060 | // Begin of protos/perfetto/trace/profiling/profile_common.proto |
| 3061 | |
Florian Mayer | 80de698 | 2019-09-20 15:10:37 +0100 | [diff] [blame] | 3062 | // TODO(fmayer): Figure out naming thoroughout this file to get a |
| 3063 | // nomenclature that works between Windows and Linux. |
| 3064 | |
Siddhartha S | 545776e | 2019-06-12 19:30:19 -0700 | [diff] [blame] | 3065 | // The interning fields in this file can refer to 2 different intern tables, |
| 3066 | // depending on the message they are used in. If the interned fields are present |
| 3067 | // in ProfilePacket proto, then the intern tables included in the ProfilePacket |
| 3068 | // should be used. If the intered fields are present in the |
| 3069 | // StreamingProfilePacket proto, then the intern tables included in all of the |
| 3070 | // previous InternedData message with same sequence ID should be used. |
| 3071 | // TODO(fmayer): Move to the intern tables to a common location. |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 3072 | message InternedString { |
| 3073 | optional uint64 iid = 1; |
| 3074 | optional bytes str = 2; |
| 3075 | } |
| 3076 | |
Siddhartha S | 545776e | 2019-06-12 19:30:19 -0700 | [diff] [blame] | 3077 | // A symbol field that is emitted after the trace is written. These tables would |
| 3078 | // be appended as the last packets in the trace that the profiler will use, so |
| 3079 | // that the actual trace need not be rewritten to symbolize the profiles. |
Siddhartha S | 06add2b | 2019-06-20 02:58:50 -0700 | [diff] [blame] | 3080 | message ProfiledFrameSymbols { |
Siddhartha S | 545776e | 2019-06-12 19:30:19 -0700 | [diff] [blame] | 3081 | // Use the frame id as the interning key for the symbols. |
Florian Mayer | cf9eadc | 2019-08-05 11:59:35 +0100 | [diff] [blame] | 3082 | optional uint64 frame_iid = 1; |
Siddhartha S | 545776e | 2019-06-12 19:30:19 -0700 | [diff] [blame] | 3083 | |
Florian Mayer | eac2892 | 2019-08-01 13:00:38 +0100 | [diff] [blame] | 3084 | // These are repeated because when inlining happens, multiple functions' |
| 3085 | // frames can be at a single address. Imagine function Foo calling the |
| 3086 | // std::vector<int> constructor, which gets inlined at 0xf00. We then get |
| 3087 | // both Foo and the std::vector<int> constructor when we symbolize the |
| 3088 | // address. |
Florian Mayer | cf9eadc | 2019-08-05 11:59:35 +0100 | [diff] [blame] | 3089 | repeated uint64 function_name_id = 2; // key to InternedString |
| 3090 | repeated uint64 file_name_id = 3; // key to InternedString |
| 3091 | repeated uint32 line_number = 4; |
Siddhartha S | 545776e | 2019-06-12 19:30:19 -0700 | [diff] [blame] | 3092 | } |
| 3093 | |
Florian Mayer | 80de698 | 2019-09-20 15:10:37 +0100 | [diff] [blame] | 3094 | message Line { |
| 3095 | optional string function_name = 1; |
| 3096 | optional string source_file_name = 2; |
| 3097 | optional uint32 line_number = 3; |
| 3098 | } |
| 3099 | |
| 3100 | // Symbols for a given address in a module. |
| 3101 | message AddressSymbols { |
| 3102 | optional uint64 address = 1; |
| 3103 | |
| 3104 | // Source lines that correspond to this address. |
| 3105 | // |
| 3106 | // These are repeated because when inlining happens, multiple functions' |
| 3107 | // frames can be at a single address. Imagine function Foo calling the |
| 3108 | // std::vector<int> constructor, which gets inlined at 0xf00. We then get |
| 3109 | // both Foo and the std::vector<int> constructor when we symbolize the |
| 3110 | // address. |
| 3111 | repeated Line lines = 2; |
| 3112 | } |
| 3113 | |
| 3114 | // Symbols for addresses seen in a module. |
| 3115 | message ModuleSymbols { |
| 3116 | // Fully qualified path to the mapping. |
| 3117 | // E.g. /system/lib64/libc.so. |
| 3118 | optional string path = 1; |
| 3119 | |
| 3120 | // .note.gnu.build-id on Linux (not hex encoded). |
| 3121 | // uuid on MacOS. |
| 3122 | // Module GUID on Windows. |
| 3123 | optional string build_id = 2; |
| 3124 | repeated AddressSymbols address_symbols = 3; |
| 3125 | } |
| 3126 | |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3127 | message Mapping { |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 3128 | optional uint64 iid = 1; // Interning key. |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3129 | optional uint64 build_id = 2; // Interning key. |
Florian Mayer | a383a80 | 2019-09-27 17:18:45 +0100 | [diff] [blame] | 3130 | |
| 3131 | // The linker may create multiple memory mappings for the same shared |
| 3132 | // library. |
| 3133 | // This is so that the ELF header is mapped as read only, while the |
| 3134 | // executable memory is mapped as executable only. |
| 3135 | // The details of this depend on the linker, a possible mapping of an ELF |
| 3136 | // file is this: |
| 3137 | // +----------------------+ |
| 3138 | // ELF |xxxxxxxxxyyyyyyyyyyyyy| |
| 3139 | // +---------+------------+ |
| 3140 | // | | |
| 3141 | // | read | executable |
| 3142 | // v mapping v mapping |
| 3143 | // +----------------------+ |
| 3144 | // Memory |xxxxxxxxx|yyyyyyyyyyyy| |
| 3145 | // +------------------+---+ |
| 3146 | // ^ ^ ^ |
| 3147 | // + + + |
| 3148 | // start exact relpc |
| 3149 | // offset offset 0x1800 |
| 3150 | // 0x0000 0x1000 |
| 3151 | // |
| 3152 | // exact_offset is the offset into the library file of this mapping. |
| 3153 | // start_offset is the offset into the library file of the first mapping |
| 3154 | // for that library. For native libraries (.so files) this should be 0. |
| 3155 | optional uint64 exact_offset = 8; // This is not set on Android 10. |
Florian Mayer | 1265573 | 2019-07-02 15:08:26 +0100 | [diff] [blame] | 3156 | optional uint64 start_offset = 3; |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3157 | optional uint64 start = 4; |
| 3158 | optional uint64 end = 5; |
| 3159 | optional uint64 load_bias = 6; |
| 3160 | // E.g. ["system", "lib64", "libc.so"] |
| 3161 | repeated uint64 path_string_ids = 7; // id of string. |
| 3162 | } |
| 3163 | |
| 3164 | message Frame { |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 3165 | optional uint64 iid = 1; // Interning key |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3166 | // E.g. "fopen" |
| 3167 | optional uint64 function_name_id = 2; // id of string. |
| 3168 | optional uint64 mapping_id = 3; |
| 3169 | optional uint64 rel_pc = 4; |
| 3170 | } |
| 3171 | |
| 3172 | message Callstack { |
Florian Mayer | d0ee632 | 2019-06-07 12:15:48 +0100 | [diff] [blame] | 3173 | optional uint64 iid = 1; |
Florian Mayer | 93d16ec | 2019-06-05 09:51:58 +0100 | [diff] [blame] | 3174 | // Frames of this callstack. Bottom frame first. |
| 3175 | repeated uint64 frame_ids = 2; |
| 3176 | } |
| 3177 | |
| 3178 | // End of protos/perfetto/trace/profiling/profile_common.proto |
| 3179 | |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3180 | // Begin of protos/perfetto/trace/profiling/profile_packet.proto |
| 3181 | |
| 3182 | message ProfilePacket { |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 3183 | // The following interning tables are only used in Android version Q. |
| 3184 | // In newer versions, these tables are in InternedData |
| 3185 | // (see protos/perfetto/trace/interned_data) and are shared across |
| 3186 | // multiple ProfilePackets. |
| 3187 | // For backwards compatibility, consumers need to first look up interned |
| 3188 | // data in the tables within the ProfilePacket, and then, if they are empty, |
| 3189 | // look up in the InternedData instead. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3190 | repeated InternedString strings = 1; |
Florian Mayer | dc642fa | 2019-04-16 20:20:12 +0100 | [diff] [blame] | 3191 | repeated Mapping mappings = 4; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3192 | repeated Frame frames = 2; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3193 | repeated Callstack callstacks = 3; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3194 | |
Florian Mayer | 8707d4d | 2019-07-16 11:17:46 +0100 | [diff] [blame] | 3195 | // Next ID: 9 |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3196 | message HeapSample { |
| 3197 | optional uint64 callstack_id = 1; |
Florian Mayer | 78760f2 | 2019-05-15 18:05:53 +0100 | [diff] [blame] | 3198 | // bytes allocated at this callstack. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3199 | optional uint64 self_allocated = 2; |
Florian Mayer | 78760f2 | 2019-05-15 18:05:53 +0100 | [diff] [blame] | 3200 | // bytes allocated at this callstack that have been freed. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3201 | optional uint64 self_freed = 3; |
Florian Mayer | 7142c7c | 2019-05-20 18:11:41 +0100 | [diff] [blame] | 3202 | // bytes allocated at this callstack but not used since the last |
Florian Mayer | 4c19b69 | 2019-07-15 16:58:38 +0100 | [diff] [blame] | 3203 | // dump. |
Florian Mayer | 7142c7c | 2019-05-20 18:11:41 +0100 | [diff] [blame] | 3204 | // See documentation of idle_allocations in HeapprofdConfig for more |
| 3205 | // details. |
| 3206 | optional uint64 self_idle = 7; |
Florian Mayer | 8707d4d | 2019-07-16 11:17:46 +0100 | [diff] [blame] | 3207 | // Bytes allocated by this callstack but not freed at the time the malloc |
| 3208 | // heap usage of this process was maximal. This is only set if dump_at_max |
| 3209 | // is true in HeapprofdConfig. In that case, self_allocated, self_freed and |
| 3210 | // self_idle will not be set. |
| 3211 | optional uint64 self_max = 8; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3212 | optional uint64 timestamp = 4; // timestamp [opt] |
Florian Mayer | 78760f2 | 2019-05-15 18:05:53 +0100 | [diff] [blame] | 3213 | // Number of allocations that were sampled at this callstack. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3214 | optional uint64 alloc_count = 5; |
Florian Mayer | 78760f2 | 2019-05-15 18:05:53 +0100 | [diff] [blame] | 3215 | // Number of allocations that were sampled at this callstack that have been |
| 3216 | // freed. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3217 | optional uint64 free_count = 6; |
| 3218 | } |
| 3219 | |
Florian Mayer | 096bbe3 | 2019-04-03 12:10:53 +0100 | [diff] [blame] | 3220 | message Histogram { |
| 3221 | message Bucket { |
| 3222 | // This bucket counts values from the previous bucket's (or -infinity if |
| 3223 | // this is the first bucket) upper_limit (inclusive) to this upper_limit |
| 3224 | // (exclusive). |
| 3225 | optional uint64 upper_limit = 1; |
| 3226 | // This is the highest bucket. This is set instead of the upper_limit. Any |
| 3227 | // values larger or equal to the previous bucket's upper_limit are counted |
| 3228 | // in this bucket. |
| 3229 | optional bool max_bucket = 2; |
| 3230 | // Number of values that fall into this range. |
| 3231 | optional uint64 count = 3; |
| 3232 | } |
| 3233 | repeated Bucket buckets = 1; |
| 3234 | } |
Florian Mayer | dc642fa | 2019-04-16 20:20:12 +0100 | [diff] [blame] | 3235 | |
Florian Mayer | dba63f7 | 2019-03-27 10:20:46 +0000 | [diff] [blame] | 3236 | message ProcessStats { |
| 3237 | optional uint64 unwinding_errors = 1; |
| 3238 | optional uint64 heap_samples = 2; |
| 3239 | optional uint64 map_reparses = 3; |
Florian Mayer | 096bbe3 | 2019-04-03 12:10:53 +0100 | [diff] [blame] | 3240 | optional Histogram unwinding_time_us = 4; |
Florian Mayer | 9fe278d | 2019-04-04 19:20:41 +0100 | [diff] [blame] | 3241 | optional uint64 total_unwinding_time_us = 5; |
Florian Mayer | dba63f7 | 2019-03-27 10:20:46 +0000 | [diff] [blame] | 3242 | } |
Florian Mayer | d0335fe | 2019-03-27 10:20:22 +0000 | [diff] [blame] | 3243 | |
Florian Mayer | dc642fa | 2019-04-16 20:20:12 +0100 | [diff] [blame] | 3244 | repeated ProcessHeapSamples process_dumps = 5; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3245 | message ProcessHeapSamples { |
| 3246 | optional uint64 pid = 1; |
Florian Mayer | d0335fe | 2019-03-27 10:20:22 +0000 | [diff] [blame] | 3247 | |
| 3248 | // This process was profiled from startup. |
| 3249 | // If false, this process was already running when profiling started. |
| 3250 | optional bool from_startup = 3; |
| 3251 | |
| 3252 | // This process was not profiled because a concurrent session was active. |
| 3253 | // If this is true, samples will be empty. |
| 3254 | optional bool rejected_concurrent = 4; |
Florian Mayer | 22e08dc | 2019-03-28 11:36:02 +0000 | [diff] [blame] | 3255 | |
| 3256 | // This process disconnected while it was profiled. |
| 3257 | // If false, the process outlived the profiling session. |
| 3258 | optional bool disconnected = 6; |
| 3259 | |
Florian Mayer | f668053 | 2019-04-10 17:39:31 +0100 | [diff] [blame] | 3260 | // If disconnected, this disconnect was caused by the client overrunning |
| 3261 | // the buffer. |
| 3262 | optional bool buffer_overran = 7; |
| 3263 | |
Florian Mayer | e32b4fd | 2019-04-15 14:37:52 +0100 | [diff] [blame] | 3264 | // If disconnected, this disconnected was caused by the shared memory |
| 3265 | // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT |
| 3266 | // MEMORY CORRUPTION. |
| 3267 | optional bool buffer_corrupted = 8; |
| 3268 | |
Florian Mayer | 5bd65f4 | 2019-05-02 16:20:38 +0100 | [diff] [blame] | 3269 | // Timestamp of the state of the target process that this dump represents. |
| 3270 | // This can be different to the timestamp of the TracePackets for various |
| 3271 | // reasons: |
| 3272 | // * If disconnected is set above, this is the timestamp of last state |
| 3273 | // heapprofd had of the process before it disconnected. |
| 3274 | // * Otherwise, if the rate of events produced by the process is high, |
| 3275 | // heapprofd might be behind. |
| 3276 | // |
| 3277 | // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock |
| 3278 | // to have a type enum that we can reuse here. |
| 3279 | optional uint64 timestamp = 9; |
| 3280 | |
Florian Mayer | b77b639 | 2019-09-05 14:53:20 +0100 | [diff] [blame] | 3281 | // Metadata about heapprofd. |
Florian Mayer | d0335fe | 2019-03-27 10:20:22 +0000 | [diff] [blame] | 3282 | optional ProcessStats stats = 5; |
| 3283 | |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3284 | repeated HeapSample samples = 2; |
| 3285 | } |
| 3286 | |
Florian Mayer | b77b639 | 2019-09-05 14:53:20 +0100 | [diff] [blame] | 3287 | // If this is true, the next ProfilePacket in this package_sequence_id is a |
| 3288 | // continuation of this one. |
| 3289 | // To get all samples for a process, accummulate its |
| 3290 | // ProcessHeapSamples.samples until you see continued=false. |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3291 | optional bool continued = 6; |
Florian Mayer | b77b639 | 2019-09-05 14:53:20 +0100 | [diff] [blame] | 3292 | |
| 3293 | // Index of this ProfilePacket on its package_sequence_id. Can be used |
| 3294 | // to detect dropped data. |
| 3295 | // Verify these are consecutive. |
Florian Mayer | 638a116 | 2019-07-12 10:42:56 +0000 | [diff] [blame] | 3296 | optional uint64 index = 7; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3297 | } |
| 3298 | |
Oystein Eftevaag | cba5641 | 2019-06-13 10:32:01 -0700 | [diff] [blame] | 3299 | // Message used to represent individual stack samples sampled at discrete |
| 3300 | // points in time, rather than aggregated over an interval. |
| 3301 | message StreamingProfilePacket { |
| 3302 | repeated uint64 callstack_iid = 1; // Index into InternedData.callstacks |
| 3303 | repeated int64 timestamp_delta_us = 2; |
| 3304 | } |
| 3305 | |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3306 | // End of protos/perfetto/trace/profiling/profile_packet.proto |
| 3307 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3308 | // Begin of protos/perfetto/trace/ps/process_stats.proto |
Isabelle Taylor | 98e560d | 2018-11-22 11:59:12 +0000 | [diff] [blame] | 3309 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3310 | // Per-process periodically sampled stats. These samples are wrapped in a |
| 3311 | // dedicated message (as opposite to be fields in process_tree.proto) because |
| 3312 | // they are dumped at a different rate than cmdline and thread list. |
Lalit Maganti | 999355c | 2019-03-27 18:17:08 +0000 | [diff] [blame] | 3313 | // Note: not all of these stats will be present in every ProcessStats message |
| 3314 | // and sometimes processes may be missing . This is because counters are |
| 3315 | // cached to reduce emission of counters which do not change. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3316 | message ProcessStats { |
Lalit Maganti | 6820abc | 2019-01-21 11:12:23 +0000 | [diff] [blame] | 3317 | message Process { |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3318 | optional int32 pid = 1; |
Lalit Maganti | 6820abc | 2019-01-21 11:12:23 +0000 | [diff] [blame] | 3319 | |
| 3320 | // See /proc/[pid]/status in `man 5 proc` for a description of these fields. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3321 | optional uint64 vm_size_kb = 2; |
| 3322 | optional uint64 vm_rss_kb = 3; |
| 3323 | optional uint64 rss_anon_kb = 4; |
| 3324 | optional uint64 rss_file_kb = 5; |
| 3325 | optional uint64 rss_shmem_kb = 6; |
| 3326 | optional uint64 vm_swap_kb = 7; |
| 3327 | optional uint64 vm_locked_kb = 8; |
| 3328 | optional uint64 vm_hwm_kb = 9; |
| 3329 | // When adding a new field remember to update kProcMemCounterSize in |
| 3330 | // the trace processor. |
Lalit Maganti | 6820abc | 2019-01-21 11:12:23 +0000 | [diff] [blame] | 3331 | |
| 3332 | optional int64 oom_score_adj = 10; |
Isabelle Taylor | 98e560d | 2018-11-22 11:59:12 +0000 | [diff] [blame] | 3333 | } |
Lalit Maganti | 6820abc | 2019-01-21 11:12:23 +0000 | [diff] [blame] | 3334 | repeated Process processes = 1; |
Daniel Colascione | 4fe75a5 | 2019-05-30 12:39:12 -0700 | [diff] [blame] | 3335 | |
| 3336 | // The time at which we finish collecting this batch of samples; |
| 3337 | // the top-level packet timestamp is the time at which |
| 3338 | // we begin collection. |
| 3339 | // TODO(dancol): analysis might be improved by |
| 3340 | // time-bracketing each sample as well as the whole |
| 3341 | // ProcessStats, but doing that is probably gated on |
| 3342 | // a vdso for CLOCK_BOOTTIME. |
| 3343 | optional uint64 collection_end_timestamp = 2; |
Isabelle Taylor | 98e560d | 2018-11-22 11:59:12 +0000 | [diff] [blame] | 3344 | } |
| 3345 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3346 | // End of protos/perfetto/trace/ps/process_stats.proto |
| 3347 | |
| 3348 | // Begin of protos/perfetto/trace/ps/process_tree.proto |
| 3349 | |
| 3350 | message ProcessTree { |
| 3351 | // Representation of a thread. |
| 3352 | message Thread { |
| 3353 | // The thread id (as per gettid()) |
| 3354 | optional int32 tid = 1; |
| 3355 | |
| 3356 | // Thread group id (i.e. the PID of the process, == TID of the main thread) |
| 3357 | optional int32 tgid = 3; |
| 3358 | |
| 3359 | // The name of the thread. |
| 3360 | optional string name = 2; |
| 3361 | } |
| 3362 | |
| 3363 | // Representation of a process. |
| 3364 | message Process { |
| 3365 | // The UNIX process ID, aka thread group ID (as per getpid()). |
| 3366 | optional int32 pid = 1; |
| 3367 | |
| 3368 | // The parent process ID, as per getppid(). |
| 3369 | optional int32 ppid = 2; |
| 3370 | |
| 3371 | // The command line for the process, as per /proc/pid/cmdline. |
| 3372 | // If it is a kernel thread there will only be one cmdline field |
| 3373 | // and it will contain /proc/pid/comm. |
| 3374 | repeated string cmdline = 3; |
| 3375 | |
| 3376 | // No longer used as of Apr 2018, when the dedicated |threads| field was |
| 3377 | // introduced in ProcessTree. |
| 3378 | repeated Thread threads_deprecated = 4 [deprecated = true]; |
Ioannis Ilkos | df2a838 | 2019-10-06 20:26:51 +0100 | [diff] [blame] | 3379 | |
| 3380 | // The uid for the process, as per /proc/pid/status. |
| 3381 | optional int32 uid = 5; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3382 | } |
| 3383 | |
| 3384 | // List of processes and threads in the client. These lists are incremental |
| 3385 | // and not exhaustive. A process and its threads might show up separately in |
| 3386 | // different ProcessTree messages. A thread might event not show up at all, if |
| 3387 | // no sched_switch activity was detected, for instance: |
| 3388 | // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] } |
| 3389 | // #1 { threads: [{pid: 12, tgid: 10}] } |
| 3390 | // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] } |
| 3391 | repeated Process processes = 1; |
| 3392 | repeated Thread threads = 2; |
Daniel Colascione | 4fe75a5 | 2019-05-30 12:39:12 -0700 | [diff] [blame] | 3393 | |
| 3394 | // The time at which we finish collecting this process tree; |
| 3395 | // the top-level packet timestamp is the time at which |
| 3396 | // we begin collection. |
| 3397 | optional uint64 collection_end_timestamp = 3; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3398 | } |
| 3399 | |
| 3400 | // End of protos/perfetto/trace/ps/process_tree.proto |
| 3401 | |
| 3402 | // Begin of protos/perfetto/trace/sys_stats/sys_stats.proto |
| 3403 | |
| 3404 | // Various Linux system stat counters from /proc. |
| 3405 | // The fields in this message can be reported at different rates and with |
| 3406 | // different granularity. See sys_stats_config.proto. |
| 3407 | message SysStats { |
| 3408 | // Counters from /proc/meminfo. Values are in KB. |
| 3409 | message MeminfoValue { |
| 3410 | optional MeminfoCounters key = 1; |
| 3411 | optional uint64 value = 2; |
| 3412 | }; |
| 3413 | repeated MeminfoValue meminfo = 1; |
| 3414 | |
| 3415 | // Counter from /proc/vmstat. Units are often pages, not KB. |
| 3416 | message VmstatValue { |
| 3417 | optional VmstatCounters key = 1; |
| 3418 | optional uint64 value = 2; |
| 3419 | }; |
| 3420 | repeated VmstatValue vmstat = 2; |
| 3421 | |
| 3422 | // Times in each mode, since boot. Unit: nanoseconds. |
| 3423 | message CpuTimes { |
| 3424 | optional uint32 cpu_id = 1; |
| 3425 | optional uint64 user_ns = 2; // Time spent in user mode. |
| 3426 | optional uint64 user_ice_ns = 3; // Time spent in user mode (low prio). |
| 3427 | optional uint64 system_mode_ns = 4; // Time spent in system mode. |
| 3428 | optional uint64 idle_ns = 5; // Time spent in the idle task. |
| 3429 | optional uint64 io_wait_ns = 6; // Time spent waiting for I/O. |
| 3430 | optional uint64 irq_ns = 7; // Time spent servicing interrupts. |
| 3431 | optional uint64 softirq_ns = 8; // Time spent servicing softirqs. |
| 3432 | } |
| 3433 | repeated CpuTimes cpu_stat = 3; // One entry per cpu. |
| 3434 | |
| 3435 | // Num processes forked since boot. |
| 3436 | // Populated only if FORK_COUNT in config.stat_counters. |
| 3437 | optional uint64 num_forks = 4; |
| 3438 | |
| 3439 | message InterruptCount { |
| 3440 | optional int32 irq = 1; |
| 3441 | optional uint64 count = 2; |
| 3442 | } |
| 3443 | |
| 3444 | // Number of interrupts, broken by IRQ number. |
| 3445 | // Populated only if IRQ_COUNTS in config.stat_counters. |
| 3446 | optional uint64 num_irq_total = 5; // Total num of irqs serviced since boot. |
| 3447 | repeated InterruptCount num_irq = 6; |
| 3448 | |
| 3449 | // Number of softirqs, broken by softirq number. |
| 3450 | // Populated only if SOFTIRQ_COUNTS in config.stat_counters. |
| 3451 | optional uint64 num_softirq_total = 7; // Total num of softirqs since boot. |
| 3452 | repeated InterruptCount num_softirq = 8; // Per-softirq count. |
Daniel Colascione | 4fe75a5 | 2019-05-30 12:39:12 -0700 | [diff] [blame] | 3453 | |
| 3454 | // The time at which we finish collecting this set of samples; |
| 3455 | // the top-level packet timestamp is the time at which |
| 3456 | // we begin collection. |
| 3457 | optional uint64 collection_end_timestamp = 9; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3458 | } |
| 3459 | |
| 3460 | // End of protos/perfetto/trace/sys_stats/sys_stats.proto |
| 3461 | |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3462 | // Begin of protos/perfetto/trace/system_info.proto |
| 3463 | |
| 3464 | message Utsname { |
| 3465 | optional string sysname = 1; |
| 3466 | optional string version = 2; |
| 3467 | optional string release = 3; |
| 3468 | optional string machine = 4; |
| 3469 | } |
| 3470 | |
| 3471 | message SystemInfo { |
| 3472 | optional Utsname utsname = 1; |
| 3473 | } |
| 3474 | |
| 3475 | // End of protos/perfetto/trace/system_info.proto |
| 3476 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3477 | // Begin of protos/perfetto/trace/trace.proto |
| 3478 | |
| 3479 | message Trace { |
| 3480 | repeated TracePacket packet = 1; |
| 3481 | |
| 3482 | // Do NOT add any other field here. This is just a convenience wrapper for |
| 3483 | // the use case of a trace being saved to a file. There are other cases |
| 3484 | // (streaming) where TracePacket are directly streamed without being wrapped |
| 3485 | // in a Trace proto. Nothing should ever rely on the full trace, all the |
| 3486 | // logic should be based on TracePacket(s). |
| 3487 | } |
| 3488 | |
| 3489 | // End of protos/perfetto/trace/trace.proto |
| 3490 | |
| 3491 | // Begin of protos/perfetto/trace/trace_packet.proto |
| 3492 | |
| 3493 | // The root object emitted by Perfetto. A perfetto trace is just a stream of |
| 3494 | // TracePacket(s). |
| 3495 | // |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3496 | // Next reserved id: 13 (up to 15). |
Raymond Chiu | c612b7f | 2019-09-18 14:53:28 -0700 | [diff] [blame] | 3497 | // Next id: 64. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3498 | message TracePacket { |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3499 | // The timestamp of the TracePacket. |
| 3500 | // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on |
| 3501 | // Android). It can be overridden using a different timestamp_clock_id. |
| 3502 | // The clock domain definition in ClockSnapshot can also override: |
| 3503 | // - The unit (default: 1ns). |
| 3504 | // - The absolute vs delta encoding (default: absolute timestamp). |
| 3505 | optional uint64 timestamp = 8; |
| 3506 | |
| 3507 | // Specifies the ID of the clock used for the TracePacket |timestamp|. Can be |
| 3508 | // one of the built-in types from ClockSnapshot::BuiltinClocks, or a |
| 3509 | // producer-defined clock id. |
| 3510 | // If unspecified and if no default per-sequence value has been provided via |
| 3511 | // TracePacketDefaults, it defaults to BuiltinClocks::BOOTTIME. |
| 3512 | optional uint32 timestamp_clock_id = 58; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3513 | |
| 3514 | oneof data { |
| 3515 | FtraceEventBundle ftrace_events = 1; |
| 3516 | ProcessTree process_tree = 2; |
| 3517 | ProcessStats process_stats = 9; |
| 3518 | InodeFileMap inode_file_map = 4; |
| 3519 | // removed field with id 5 |
| 3520 | ClockSnapshot clock_snapshot = 6; |
| 3521 | SysStats sys_stats = 7; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3522 | TrackEvent track_event = 11; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3523 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3524 | // IDs up to 15 are reserved. They take only one byte to encode their |
| 3525 | // preamble so should be used for freqeuent events. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3526 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 3527 | TraceConfig trace_config = 33; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3528 | FtraceStats ftrace_stats = 34; |
Ryan Savitski | 41ce459 | 2019-05-02 14:43:59 +0100 | [diff] [blame] | 3529 | TraceStats trace_stats = 35; |
Florian Mayer | 8411367 | 2019-01-21 14:48:27 +0000 | [diff] [blame] | 3530 | ProfilePacket profile_packet = 37; |
Primiano Tucci | b86e9ca | 2018-12-03 20:20:11 +0100 | [diff] [blame] | 3531 | BatteryCounters battery = 38; |
Esteban Talavera | 7714cec | 2019-01-31 15:53:34 +0000 | [diff] [blame] | 3532 | PowerRails power_rails = 40; |
Primiano Tucci | 64df2ca | 2019-01-03 22:26:47 +0000 | [diff] [blame] | 3533 | AndroidLogPacket android_log = 39; |
Hector Dearman | 685f752 | 2019-03-12 14:28:56 +0000 | [diff] [blame] | 3534 | SystemInfo system_info = 45; |
Stephen Nusko | 70ea330 | 2019-04-01 19:44:40 +0100 | [diff] [blame] | 3535 | Trigger trigger = 46; |
Florian Mayer | 12f0f8e | 2019-04-02 12:31:13 +0100 | [diff] [blame] | 3536 | PackagesList packages_list = 47; |
Mikhail Khokhlov | 5b60af5 | 2019-05-15 10:09:34 +0100 | [diff] [blame] | 3537 | ChromeBenchmarkMetadata chrome_benchmark_metadata = 48; |
Primiano Tucci | b02d8dc | 2019-06-04 11:46:43 +0100 | [diff] [blame] | 3538 | PerfettoMetatrace perfetto_metatrace = 49; |
Siddhartha S | 1239fb3 | 2019-06-06 11:17:13 -0700 | [diff] [blame] | 3539 | ChromeMetadataPacket chrome_metadata = 51; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 3540 | GpuCounterEvent gpu_counter_event = 52; |
| 3541 | GpuRenderStageEvent gpu_render_stage_event = 53; |
Oystein Eftevaag | cba5641 | 2019-06-13 10:32:01 -0700 | [diff] [blame] | 3542 | StreamingProfilePacket streaming_profile_packet = 54; |
Florian Mayer | 06264b4 | 2019-07-30 12:09:30 +0100 | [diff] [blame] | 3543 | HeapGraph heap_graph = 56; |
Mikael Pessa | 625a091 | 2019-07-24 15:28:16 -0700 | [diff] [blame] | 3544 | GraphicsFrameEvent graphics_frame_event = 57; |
Matthew Clarkson | 9a5dfa5 | 2019-10-03 09:54:04 +0100 | [diff] [blame] | 3545 | // removed field with id 62 |
Raymond Chiu | c612b7f | 2019-09-18 14:53:28 -0700 | [diff] [blame] | 3546 | GpuLog gpu_log = 63; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3547 | |
Siddhartha S | 06add2b | 2019-06-20 02:58:50 -0700 | [diff] [blame] | 3548 | // Only used in profile packets. |
| 3549 | ProfiledFrameSymbols profiled_frame_symbols = 55; |
Florian Mayer | 80de698 | 2019-09-20 15:10:37 +0100 | [diff] [blame] | 3550 | ModuleSymbols module_symbols = 61; |
Siddhartha S | 06add2b | 2019-06-20 02:58:50 -0700 | [diff] [blame] | 3551 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3552 | // Only used by TrackEvent. |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3553 | TrackDescriptor track_descriptor = 60; |
| 3554 | |
| 3555 | // Deprecated, use TrackDescriptor instead. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3556 | ProcessDescriptor process_descriptor = 43; |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3557 | |
| 3558 | // Deprecated, use TrackDescriptor instead. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3559 | ThreadDescriptor thread_descriptor = 44; |
| 3560 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3561 | // This field is emitted at periodic intervals (~10s) and |
| 3562 | // contains always the binary representation of the UUID |
| 3563 | // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to |
| 3564 | // efficiently partition long traces without having to fully parse them. |
| 3565 | bytes synchronization_marker = 36; |
| 3566 | |
Hector Dearman | 554627f | 2019-06-04 17:58:22 +0100 | [diff] [blame] | 3567 | // Zero or more proto encoded trace packets compressed using deflate. |
| 3568 | // Each compressed_packets TracePacket (including the two field ids and |
| 3569 | // sizes) should be less than 512KB. |
| 3570 | bytes compressed_packets = 50; |
| 3571 | |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3572 | // This field is only used for testing. |
Hector Dearman | 248241e | 2019-05-10 18:28:45 +0100 | [diff] [blame] | 3573 | // In previous versions of this proto this field had the id 268435455 |
| 3574 | // This caused many problems: |
| 3575 | // - protozero decoder does not handle field ids larger than 999. |
| 3576 | // - old versions of protoc produce Java bindings with syntax errors when |
| 3577 | // the field id is large enough. |
| 3578 | // removed field with id 900 |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3579 | } |
| 3580 | |
| 3581 | // Trusted user id of the producer which generated this packet. Keep in sync |
| 3582 | // with TrustedPacket.trusted_uid. |
Eric Seckler | d0ac7ca | 2019-02-06 09:13:45 +0000 | [diff] [blame] | 3583 | // |
| 3584 | // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message |
| 3585 | // instead. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3586 | oneof optional_trusted_uid { int32 trusted_uid = 3; }; |
Eric Seckler | d0ac7ca | 2019-02-06 09:13:45 +0000 | [diff] [blame] | 3587 | |
| 3588 | // Service-assigned identifier of the packet sequence this packet belongs to. |
| 3589 | // Uniquely identifies a producer + writer pair within the tracing session. A |
| 3590 | // value of zero denotes an invalid ID. Keep in sync with |
| 3591 | // TrustedPacket.trusted_packet_sequence_id. |
| 3592 | oneof optional_trusted_packet_sequence_id { |
| 3593 | uint32 trusted_packet_sequence_id = 10; |
| 3594 | } |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3595 | |
| 3596 | // Incrementally emitted interned data, valid only on the packet's sequence |
| 3597 | // (packets with the same |trusted_packet_sequence_id|). The writer will |
| 3598 | // usually emit new interned data in the same TracePacket that first refers to |
| 3599 | // it (since the last reset of interning state). It may also be emitted |
| 3600 | // proactively in advance of referring to them in later packets. |
| 3601 | optional InternedData interned_data = 12; |
| 3602 | |
Ioannis Ilkos | 6b8d591 | 2019-09-11 13:12:49 +0100 | [diff] [blame] | 3603 | |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3604 | enum SequenceFlags { |
| 3605 | SEQ_UNSPECIFIED = 0; |
| 3606 | |
| 3607 | // Set by the writer to indicate that it will re-emit any incremental data |
| 3608 | // for the packet's sequence before referring to it again. This includes |
| 3609 | // interned data as well as periodically emitted data like |
| 3610 | // Process/ThreadDescriptors. This flag only affects the current packet |
| 3611 | // sequence (see |trusted_packet_sequence_id|). |
| 3612 | // |
| 3613 | // When set, this TracePacket and subsequent TracePackets on the same |
| 3614 | // sequence will not refer to any incremental data emitted before this |
| 3615 | // TracePacket. For example, previously emitted interned data will be |
| 3616 | // re-emitted if it is referred to again. |
| 3617 | // |
| 3618 | // When the reader detects packet loss (|previous_packet_dropped|), it needs |
| 3619 | // to skip packets in the sequence until the next one with this flag set, to |
| 3620 | // ensure intact incremental data. |
| 3621 | SEQ_INCREMENTAL_STATE_CLEARED = 1; |
| 3622 | |
| 3623 | // This packet requires incremental state, such as TracePacketDefaults or |
| 3624 | // InternedData, to be parsed correctly. The trace reader should skip this |
| 3625 | // packet if incremental state is not valid on this sequence, i.e. if no |
| 3626 | // packet with the SEQ_INCREMENTAL_STATE_CLEARED flag has been seen on the |
| 3627 | // current |trusted_packet_sequence_id|. |
| 3628 | SEQ_NEEDS_INCREMENTAL_STATE = 2; |
| 3629 | }; |
| 3630 | optional uint32 sequence_flags = 13; |
| 3631 | |
| 3632 | // DEPRECATED. Moved to SequenceFlags::SEQ_INCREMENTAL_STATE_CLEARED. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3633 | optional bool incremental_state_cleared = 41; |
| 3634 | |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3635 | // Default values for fields of later TracePackets emitted on this packet's |
| 3636 | // sequence (TracePackets with the same |trusted_packet_sequence_id|). |
| 3637 | // It must be reemitted when incremental state is cleared (see |
| 3638 | // |incremental_state_cleared|). |
| 3639 | // Requires that any future packet emitted on the same sequence specifies |
| 3640 | // the SEQ_NEEDS_INCREMENTAL_STATE flag. |
| 3641 | // TracePacketDefaults always override the global defaults for any future |
| 3642 | // packet on this sequence (regardless of SEQ_NEEDS_INCREMENTAL_STATE). |
| 3643 | optional TracePacketDefaults trace_packet_defaults = 59; |
| 3644 | |
Ryan Savitski | a909781 | 2019-03-26 16:13:25 +0000 | [diff] [blame] | 3645 | // Flag set by the service if, for the current packet sequence (see |
| 3646 | // |trusted_packet_sequence_id|), either: |
| 3647 | // * this is the first packet, or |
| 3648 | // * one or multiple packets were dropped since the last packet that the |
| 3649 | // consumer read from the sequence. This can happen if chunks in the trace |
| 3650 | // buffer are overridden before the consumer could read them when the trace |
| 3651 | // is configured in ring buffer mode. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3652 | // |
| 3653 | // When packet loss occurs, incrementally emitted data (including interned |
| 3654 | // data) on the sequence should be considered invalid up until the next packet |
Primiano Tucci | d3f8d8e | 2019-08-12 19:00:55 +0200 | [diff] [blame] | 3655 | // with SEQ_INCREMENTAL_STATE_CLEARED set. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3656 | optional bool previous_packet_dropped = 42; |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 3657 | } |
| 3658 | |
| 3659 | // End of protos/perfetto/trace/trace_packet.proto |
Florian Mayer | 8411367 | 2019-01-21 14:48:27 +0000 | [diff] [blame] | 3660 | |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3661 | // Begin of protos/perfetto/trace/trace_packet_defaults.proto |
| 3662 | |
| 3663 | // Default values for TracePacket fields that hold for a particular TraceWriter |
| 3664 | // packet sequence. This message contains a subset of the TracePacket fields |
| 3665 | // with matching IDs. When provided, these fields define the default values |
| 3666 | // that should be applied, at import time, to all TracePacket(s) with the same |
| 3667 | // |trusted_packet_sequence_id|, unless otherwise specified in each packet. |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3668 | // |
| 3669 | // Should be reemitted whenever incremental state is cleared on the sequence. |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3670 | message TracePacketDefaults { |
| 3671 | optional uint32 timestamp_clock_id = 58; |
| 3672 | |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3673 | // Default values for TrackEvents (e.g. default track). |
Eric Seckler | 42f3e03 | 2019-09-05 15:36:54 +0100 | [diff] [blame] | 3674 | optional TrackEventDefaults track_event_defaults = 11; |
Primiano Tucci | 3e7ca4f | 2019-08-09 20:49:26 +0200 | [diff] [blame] | 3675 | } |
| 3676 | // End of protos/perfetto/trace/trace_packet_defaults.proto |
| 3677 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3678 | // Begin of protos/perfetto/trace/track_event/debug_annotation.proto |
| 3679 | |
| 3680 | // Key/value annotations provided in untyped TRACE_EVENT macros. These |
| 3681 | // annotations are intended for debug use and are not considered a stable API |
| 3682 | // surface. As such, they should not be relied upon to implement (new) metrics. |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3683 | // |
| 3684 | // Next ID: 10. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3685 | message DebugAnnotation { |
| 3686 | message NestedValue { |
| 3687 | enum NestedType { |
| 3688 | UNSPECIFIED = 0; // leaf value. |
| 3689 | DICT = 1; |
| 3690 | ARRAY = 2; |
| 3691 | } |
| 3692 | optional NestedType nested_type = 1; |
| 3693 | |
| 3694 | repeated string dict_keys = 2; |
| 3695 | repeated NestedValue dict_values = 3; |
| 3696 | repeated NestedValue array_values = 4; |
| 3697 | optional int64 int_value = 5; |
| 3698 | optional double double_value = 6; |
| 3699 | optional bool bool_value = 7; |
| 3700 | optional string string_value = 8; |
| 3701 | } |
| 3702 | |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3703 | oneof name_field { |
| 3704 | uint64 name_iid = 1; // interned DebugAnnotationName. |
| 3705 | string name = 10; // non-interned variant. |
| 3706 | } |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3707 | |
| 3708 | oneof value { |
| 3709 | bool bool_value = 2; |
| 3710 | uint64 uint_value = 3; |
| 3711 | int64 int_value = 4; |
| 3712 | double double_value = 5; |
| 3713 | string string_value = 6; |
| 3714 | // Pointers are stored in a separate type as the JSON output treats them |
| 3715 | // differently from other uint64 values. |
| 3716 | uint64 pointer_value = 7; |
| 3717 | NestedValue nested_value = 8; |
| 3718 | |
| 3719 | // Legacy instrumentation may not support conversion of nested data to |
| 3720 | // NestedValue yet. |
| 3721 | string legacy_json_value = 9; |
| 3722 | } |
| 3723 | } |
| 3724 | |
| 3725 | // -------------------- |
| 3726 | // Interned data types: |
| 3727 | // -------------------- |
| 3728 | |
| 3729 | message DebugAnnotationName { |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 3730 | optional uint64 iid = 1; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3731 | optional string name = 2; |
| 3732 | } |
| 3733 | |
| 3734 | // End of protos/perfetto/trace/track_event/debug_annotation.proto |
| 3735 | |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 3736 | // Begin of protos/perfetto/trace/track_event/log_message.proto |
| 3737 | |
| 3738 | message LogMessage { |
| 3739 | optional uint64 source_location_iid = 1; // interned SourceLocation. |
| 3740 | optional uint64 body_iid = 2; // interned LogMessageBody. |
| 3741 | } |
| 3742 | |
| 3743 | // -------------------- |
| 3744 | // Interned data types: |
| 3745 | // -------------------- |
| 3746 | |
| 3747 | message LogMessageBody { |
| 3748 | optional uint64 iid = 1; |
| 3749 | optional string body = 2; |
| 3750 | } |
| 3751 | // End of protos/perfetto/trace/track_event/log_message.proto |
| 3752 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3753 | // Begin of protos/perfetto/trace/track_event/process_descriptor.proto |
| 3754 | |
| 3755 | // Process-wide data that is periodically emitted by one thread per process. |
| 3756 | // Valid for all events in packet sequences emitted by the same process. |
| 3757 | // |
| 3758 | // Next id: 5. |
| 3759 | message ProcessDescriptor { |
| 3760 | optional int32 pid = 1; |
| 3761 | repeated string cmdline = 2; |
| 3762 | |
| 3763 | // To support old UI. New UI should determine default sorting by process_type. |
| 3764 | optional int32 legacy_sort_index = 3; |
| 3765 | |
| 3766 | // See chromium's content::ProcessType. |
| 3767 | enum ChromeProcessType { |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 3768 | PROCESS_UNSPECIFIED = 0; |
| 3769 | PROCESS_BROWSER = 1; |
| 3770 | PROCESS_RENDERER = 2; |
| 3771 | PROCESS_UTILITY = 3; |
| 3772 | PROCESS_ZYGOTE = 4; |
| 3773 | PROCESS_SANDBOX_HELPER = 5; |
| 3774 | PROCESS_GPU = 6; |
| 3775 | PROCESS_PPAPI_PLUGIN = 7; |
| 3776 | PROCESS_PPAPI_BROKER = 8; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3777 | } |
| 3778 | optional ChromeProcessType chrome_process_type = 4; |
Oystein Eftevaag | cba5641 | 2019-06-13 10:32:01 -0700 | [diff] [blame] | 3779 | optional int32 process_priority = 5; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3780 | } |
| 3781 | |
| 3782 | // End of protos/perfetto/trace/track_event/process_descriptor.proto |
| 3783 | |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 3784 | // Begin of protos/perfetto/trace/track_event/source_location.proto |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3785 | |
| 3786 | // -------------------- |
| 3787 | // Interned data types: |
| 3788 | // -------------------- |
| 3789 | |
| 3790 | message SourceLocation { |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 3791 | optional uint64 iid = 1; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3792 | |
| 3793 | // We intend to add a binary symbol version of this in the future. |
| 3794 | optional string file_name = 2; |
| 3795 | optional string function_name = 3; |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 3796 | optional uint32 line_number = 4; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3797 | } |
| 3798 | |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 3799 | // End of protos/perfetto/trace/track_event/source_location.proto |
| 3800 | |
| 3801 | // Begin of protos/perfetto/trace/track_event/task_execution.proto |
| 3802 | |
| 3803 | // TrackEvent arguments describing the execution of a task. |
| 3804 | message TaskExecution { |
| 3805 | // Source location that the task was posted from. |
| 3806 | optional uint64 posted_from_iid = 1; // interned SourceLocation. |
| 3807 | } |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3808 | // End of protos/perfetto/trace/track_event/task_execution.proto |
| 3809 | |
| 3810 | // Begin of protos/perfetto/trace/track_event/thread_descriptor.proto |
| 3811 | |
| 3812 | // Periodically emitted data that's common to all events emitted by the same |
| 3813 | // thread, i.e. all events in the same packet sequence. Valid for all subsequent |
| 3814 | // events in the same sequence. |
| 3815 | // |
Eric Seckler | 1fe18c9 | 2019-05-30 10:27:54 +0100 | [diff] [blame] | 3816 | // Next id: 9. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3817 | message ThreadDescriptor { |
| 3818 | optional int32 pid = 1; |
| 3819 | optional int32 tid = 2; |
| 3820 | |
| 3821 | // To support old UI. New UI should determine default sorting by thread_type. |
| 3822 | optional int32 legacy_sort_index = 3; |
| 3823 | |
| 3824 | enum ChromeThreadType { |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3825 | CHROME_THREAD_UNSPECIFIED = 0; |
Siddhartha S | 1e2582a | 2019-05-31 14:08:07 -0700 | [diff] [blame] | 3826 | |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3827 | CHROME_THREAD_MAIN = 1; |
| 3828 | CHROME_THREAD_IO = 2; |
Siddhartha S | 1e2582a | 2019-05-31 14:08:07 -0700 | [diff] [blame] | 3829 | |
| 3830 | // Scheduler: |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3831 | CHROME_THREAD_POOL_BG_WORKER = 3; |
| 3832 | CHROME_THREAD_POOL_FG_WORKER = 4; |
| 3833 | CHROME_THREAD_POOL_FB_BLOCKING = 5; |
| 3834 | CHROME_THREAD_POOL_BG_BLOCKING = 6; |
| 3835 | CHROME_THREAD_POOL_SERVICE = 7; |
Siddhartha S | 1e2582a | 2019-05-31 14:08:07 -0700 | [diff] [blame] | 3836 | |
| 3837 | // Compositor: |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3838 | CHROME_THREAD_COMPOSITOR = 8; |
| 3839 | CHROME_THREAD_VIZ_COMPOSITOR = 9; |
| 3840 | CHROME_THREAD_COMPOSITOR_WORKER = 10; |
Siddhartha S | 1e2582a | 2019-05-31 14:08:07 -0700 | [diff] [blame] | 3841 | |
| 3842 | // Renderer: |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3843 | CHROME_THREAD_SERVICE_WORKER = 11; |
Siddhartha S | 1e2582a | 2019-05-31 14:08:07 -0700 | [diff] [blame] | 3844 | |
| 3845 | // Tracing related threads: |
Siddhartha S | d892f88 | 2019-06-03 11:48:42 -0700 | [diff] [blame] | 3846 | CHROME_THREAD_MEMORY_INFRA = 50; |
| 3847 | CHROME_THREAD_SAMPLING_PROFILER = 51; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3848 | }; |
Eric Seckler | 1416785 | 2019-03-26 09:20:09 +0000 | [diff] [blame] | 3849 | optional ChromeThreadType chrome_thread_type = 4; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3850 | |
| 3851 | // TODO(eseckler): Replace this with ChromeThreadType where possible. |
| 3852 | optional string thread_name = 5; |
| 3853 | |
| 3854 | // Absolute reference values. Clock values in subsequent TrackEvents can be |
| 3855 | // encoded accumulatively and relative to these. This reduces their var-int |
| 3856 | // encoding size. |
| 3857 | optional int64 reference_timestamp_us = 6; |
| 3858 | optional int64 reference_thread_time_us = 7; |
Eric Seckler | 1fe18c9 | 2019-05-30 10:27:54 +0100 | [diff] [blame] | 3859 | optional int64 reference_thread_instruction_count = 8; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3860 | } |
| 3861 | |
| 3862 | // End of protos/perfetto/trace/track_event/thread_descriptor.proto |
| 3863 | |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3864 | // Begin of protos/perfetto/trace/track_event/track_descriptor.proto |
| 3865 | |
| 3866 | // Defines a track for TrackEvents. Slices and instant events on the same track |
| 3867 | // will be nested based on their timestamps, see TrackEvent::Type. |
| 3868 | // |
Eric Seckler | 42f3e03 | 2019-09-05 15:36:54 +0100 | [diff] [blame] | 3869 | // A packet sequence needs to emit a TrackDescriptor for every track on which it |
| 3870 | // emits TrackEvents. TrackDescriptors should be reemitted whenever incremental |
| 3871 | // state is cleared. |
| 3872 | // |
| 3873 | // As a fallback, TrackEvents emitted without an explicit track association will |
| 3874 | // be associated with an implicit trace-global track (uuid = 0), see also |
| 3875 | // |TrackEvent::track_uuid|. It is possible but not necessary to emit a |
| 3876 | // TrackDescriptor for this implicit track. |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3877 | // |
| 3878 | // Next id: 1. |
| 3879 | message TrackDescriptor { |
| 3880 | // Unique ID that identifies this track. This ID is global to the whole trace. |
| 3881 | // Producers should ensure that it is unlikely to clash with IDs emitted by |
Eric Seckler | 42f3e03 | 2019-09-05 15:36:54 +0100 | [diff] [blame] | 3882 | // other producers. A value of 0 denotes the implicit trace-global track. |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3883 | // |
| 3884 | // For example, legacy TRACE_EVENT macros may use a hash involving the async |
| 3885 | // event id + id_scope, pid, and/or tid to compute this ID. |
| 3886 | optional uint64 uuid = 1; |
| 3887 | |
| 3888 | // TODO(eseckler): Support track hierarchies. |
| 3889 | // uint64 parent_uuid = X; |
| 3890 | |
| 3891 | // Name of the track. |
| 3892 | optional string name = 2; |
| 3893 | |
| 3894 | // Optional arguments for specific types of tracks. |
| 3895 | optional ProcessDescriptor process = 3; |
| 3896 | optional ThreadDescriptor thread = 4; |
| 3897 | } |
| 3898 | |
| 3899 | // End of protos/perfetto/trace/track_event/track_descriptor.proto |
| 3900 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3901 | // Begin of protos/perfetto/trace/track_event/track_event.proto |
| 3902 | |
| 3903 | // Trace events emitted by client instrumentation library (TRACE_EVENT macros), |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3904 | // which describe activity on a track, such as a thread or asynchronous event |
| 3905 | // track. The track is specified using separate TrackDescriptor messages and |
| 3906 | // referred to via the track's UUID. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3907 | // |
| 3908 | // This message is optimized for writing and makes heavy use of data interning |
| 3909 | // and delta encoding (e.g. of timestamps) to reduce data repetition and encoded |
| 3910 | // data size. |
| 3911 | // |
| 3912 | // A TrackEvent exists in the context of its packet sequence (TracePackets |
| 3913 | // emitted by the same producer + writer) and refers to data in preceding |
| 3914 | // TracePackets emitted on the same sequence, both directly and indirectly. For |
| 3915 | // example, interned data entries are emitted as part of a TracePacket and |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3916 | // directly referred to from TrackEvents by their interning IDs. Default values |
| 3917 | // for attributes of events on the same sequence (e.g. their default track |
| 3918 | // association) can be emitted as part of a TrackEventDefaults message. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3919 | // |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 3920 | // Next reserved id: 12 (up to 15). |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3921 | // Next id: 24. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3922 | message TrackEvent { |
| 3923 | // Timestamp in microseconds (usually CLOCK_MONOTONIC). |
| 3924 | oneof timestamp { |
| 3925 | // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To |
| 3926 | // calculate the absolute timestamp value, sum up all delta values of the |
| 3927 | // preceding TrackEvents since the last ThreadDescriptor and add the sum to |
| 3928 | // the |reference_timestamp| in ThreadDescriptor. This value should always |
| 3929 | // be positive. |
| 3930 | int64 timestamp_delta_us = 1; |
| 3931 | // Absolute value (e.g. a manually specified timestamp in the macro). |
| 3932 | // This is a one-off value that does not affect delta timestamp computation |
| 3933 | // in subsequent TrackEvents. |
| 3934 | int64 timestamp_absolute_us = 16; |
| 3935 | } |
| 3936 | |
| 3937 | // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in |
| 3938 | // microseconds. |
| 3939 | oneof thread_time { |
| 3940 | // Same encoding as |timestamp| fields above. |
| 3941 | int64 thread_time_delta_us = 2; |
| 3942 | // TODO(eseckler): Consider removing absolute thread time support. It's |
| 3943 | // currently required to support writing PHASE_COMPLETE events out-of-order, |
| 3944 | // but shouldn't be required anymore when we split them into begin/end. |
| 3945 | int64 thread_time_absolute_us = 17; |
| 3946 | } |
| 3947 | |
Eric Seckler | 1fe18c9 | 2019-05-30 10:27:54 +0100 | [diff] [blame] | 3948 | // Value of the instruction counter for the current thread. |
| 3949 | oneof thread_instruction_count { |
| 3950 | // Same encoding as |timestamp| fields above. |
| 3951 | int64 thread_instruction_count_delta = 8; |
| 3952 | // TODO(eseckler): Consider removing absolute thread instruction count |
| 3953 | // support. It's currently required to support writing PHASE_COMPLETE events |
| 3954 | // out-of-order, but shouldn't be required anymore when we split them into |
| 3955 | // begin/end. |
| 3956 | int64 thread_instruction_count_absolute = 20; |
| 3957 | } |
Andrew Comminos | 195e935 | 2019-05-14 16:56:47 -0700 | [diff] [blame] | 3958 | |
Eric Seckler | 58fcbf1 | 2019-08-07 15:05:43 +0100 | [diff] [blame] | 3959 | // TODO(eseckler): Add a way to specify Tracks. |
| 3960 | |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3961 | // Names of categories of the event. In the client library, categories are a |
| 3962 | // way to turn groups of individual events on or off. |
| 3963 | // |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3964 | // We intend to add a binary symbol version of this in the future. |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 3965 | repeated uint64 category_iids = 3; // interned EventCategoryName. |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3966 | repeated string categories = 22; // non-interned variant. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3967 | |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 3968 | // Optional name of the event for its display in trace viewer. May be left |
| 3969 | // unspecified for events with typed arguments. |
| 3970 | // |
| 3971 | // Note that metrics should not rely on event names, as they are prone to |
| 3972 | // changing. Instead, they should use typed arguments to identify the events |
| 3973 | // they are interested in. |
| 3974 | // |
| 3975 | // We intend to add a binary symbol version of this in the future. |
| 3976 | oneof name_field { |
| 3977 | uint64 name_iid = 10; // interned EventName. |
| 3978 | string name = 23; // non-interned variant. |
| 3979 | } |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 3980 | |
Eric Seckler | 58fcbf1 | 2019-08-07 15:05:43 +0100 | [diff] [blame] | 3981 | // Type of the TrackEvent (required if |phase| in LegacyEvent is not set). |
| 3982 | enum Type { |
| 3983 | TYPE_UNSPECIFIED = 0; |
| 3984 | |
Eric Seckler | 361c10e | 2019-08-13 11:40:13 +0100 | [diff] [blame] | 3985 | // Slice events are events that have a begin and end timestamp, i.e. a |
| 3986 | // duration. They can be nested similar to a callstack: If, on the same |
| 3987 | // track, event B begins after event A, but before A ends, B is a child |
| 3988 | // event of A and will be drawn as a nested event underneath A in the UI. |
| 3989 | // Note that child events should always end before their parents (e.g. B |
| 3990 | // before A). |
Eric Seckler | 58fcbf1 | 2019-08-07 15:05:43 +0100 | [diff] [blame] | 3991 | // |
Eric Seckler | 361c10e | 2019-08-13 11:40:13 +0100 | [diff] [blame] | 3992 | // Each slice event is formed by a pair of BEGIN + END events. The END event |
| 3993 | // does not need to repeat any TrackEvent fields it has in common with its |
| 3994 | // corresponding BEGIN event. Arguments and debug annotations of the BEGIN + |
| 3995 | // END pair will be merged during trace import. |
| 3996 | // |
| 3997 | // Note that we deliberately chose not to support COMPLETE events (which |
| 3998 | // would specify a duration directly) since clients would need to delay |
| 3999 | // writing them until the slice is completed, which can result in reordered |
| 4000 | // events in the trace and loss of unfinished events at the end of a trace. |
Eric Seckler | 58fcbf1 | 2019-08-07 15:05:43 +0100 | [diff] [blame] | 4001 | TYPE_SLICE_BEGIN = 1; |
| 4002 | TYPE_SLICE_END = 2; |
| 4003 | |
Eric Seckler | 361c10e | 2019-08-13 11:40:13 +0100 | [diff] [blame] | 4004 | // Instant events are nestable events without duration. They can be children |
| 4005 | // of slice events on the same track. |
| 4006 | TYPE_INSTANT = 3; |
| 4007 | |
Eric Seckler | 58fcbf1 | 2019-08-07 15:05:43 +0100 | [diff] [blame] | 4008 | // TODO(eseckler): Add support for counters. |
| 4009 | } |
| 4010 | optional Type type = 9; |
| 4011 | |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 4012 | // Identifies the track of the event. The default value may be overridden |
| 4013 | // using TrackEventDefaults, e.g., to specify the track of the TraceWriter's |
| 4014 | // sequence (in most cases sequence = one thread). If no value is specified |
| 4015 | // here or in TrackEventDefaults, the TrackEvent will be associated with an |
Eric Seckler | 42f3e03 | 2019-09-05 15:36:54 +0100 | [diff] [blame] | 4016 | // implicit trace-global track (uuid 0). See TrackDescriptor::uuid. |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 4017 | optional uint64 track_uuid = 11; |
| 4018 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4019 | // Unstable key/value annotations shown in the trace viewer but not intended |
| 4020 | // for metrics use. |
| 4021 | repeated DebugAnnotation debug_annotations = 4; |
| 4022 | |
| 4023 | // Typed event arguments: |
| 4024 | optional TaskExecution task_execution = 5; |
Nicolò Mazzucato | 85940b7 | 2019-07-18 10:32:39 +0100 | [diff] [blame] | 4025 | optional LogMessage log_message = 21; |
| 4026 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4027 | // TODO(eseckler): New argument types go here :) |
| 4028 | |
| 4029 | // Apart from {category, time, thread time, tid, pid}, other legacy trace |
| 4030 | // event attributes are initially simply proxied for conversion to a JSON |
| 4031 | // trace. We intend to gradually transition these attributes to similar native |
| 4032 | // features in TrackEvent (e.g. async + flow events), or deprecate them |
| 4033 | // without replacement where transition is unsuitable. |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4034 | // |
Eric Seckler | 1fe18c9 | 2019-05-30 10:27:54 +0100 | [diff] [blame] | 4035 | // Next reserved id: 16 (up to 16). |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4036 | // Next id: 20. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4037 | message LegacyEvent { |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 4038 | // Deprecated, use TrackEvent::name(_iid) instead. |
| 4039 | optional uint64 name_iid = 1; // interned EventName. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4040 | optional int32 phase = 2; |
Eric Seckler | 7f2c5e4 | 2019-03-05 08:59:02 +0000 | [diff] [blame] | 4041 | optional int64 duration_us = 3; |
| 4042 | optional int64 thread_duration_us = 4; |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4043 | |
Eric Seckler | 1fe18c9 | 2019-05-30 10:27:54 +0100 | [diff] [blame] | 4044 | // Elapsed retired instruction count during the event. |
| 4045 | optional int64 thread_instruction_delta = 15; |
| 4046 | |
Eric Seckler | 7f2c5e4 | 2019-03-05 08:59:02 +0000 | [diff] [blame] | 4047 | reserved 5; // used to be |flags|. |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4048 | |
Eric Seckler | 7f2c5e4 | 2019-03-05 08:59:02 +0000 | [diff] [blame] | 4049 | oneof id { |
| 4050 | uint64 unscoped_id = 6; |
| 4051 | uint64 local_id = 10; |
| 4052 | uint64 global_id = 11; |
| 4053 | } |
| 4054 | // Additional optional scope for |id|. |
| 4055 | optional string id_scope = 7; |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4056 | |
| 4057 | // Consider the thread timestamps for async BEGIN/END event pairs as valid. |
| 4058 | optional bool use_async_tts = 9; |
| 4059 | |
Eric Seckler | 7f2c5e4 | 2019-03-05 08:59:02 +0000 | [diff] [blame] | 4060 | // Idenfifies a flow. Flow events with the same bind_id are connected. |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4061 | optional uint64 bind_id = 8; |
Eric Seckler | 7f2c5e4 | 2019-03-05 08:59:02 +0000 | [diff] [blame] | 4062 | // Use the enclosing slice as binding point for a flow end event instead of |
| 4063 | // the next slice. Flow start/step events always bind to the enclosing |
| 4064 | // slice. |
Eric Seckler | 5994576 | 2019-03-04 11:48:25 +0000 | [diff] [blame] | 4065 | optional bool bind_to_enclosing = 12; |
| 4066 | |
| 4067 | enum FlowDirection { |
| 4068 | FLOW_UNSPECIFIED = 0; |
| 4069 | FLOW_IN = 1; |
| 4070 | FLOW_OUT = 2; |
| 4071 | FLOW_INOUT = 3; |
| 4072 | } |
| 4073 | optional FlowDirection flow_direction = 13; |
| 4074 | |
| 4075 | enum InstantEventScope { |
| 4076 | SCOPE_UNSPECIFIED = 0; |
| 4077 | SCOPE_GLOBAL = 1; |
| 4078 | SCOPE_PROCESS = 2; |
| 4079 | SCOPE_THREAD = 3; |
| 4080 | } |
| 4081 | optional InstantEventScope instant_event_scope = 14; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4082 | |
| 4083 | // Override the pid/tid if the writer needs to emit events on behalf of |
| 4084 | // another process/thread. This should be the exception. Normally, the |
| 4085 | // pid+tid from ThreadDescriptor is used. |
| 4086 | optional int32 pid_override = 18; |
| 4087 | optional int32 tid_override = 19; |
| 4088 | } |
| 4089 | |
| 4090 | optional LegacyEvent legacy_event = 6; |
| 4091 | } |
| 4092 | |
Eric Seckler | 9ad16d5 | 2019-09-05 10:28:43 +0100 | [diff] [blame] | 4093 | // Default values for fields of all TrackEvents on the same packet sequence. |
| 4094 | // Should be emitted as part of TracePacketDefaults whenever incremental state |
| 4095 | // is cleared. It's defined here because field IDs should match those of the |
| 4096 | // corresponding fields in TrackEvent. |
| 4097 | message TrackEventDefaults { |
| 4098 | optional uint64 track_uuid = 10; |
| 4099 | |
| 4100 | // TODO(eseckler): Support default values for more TrackEvent fields. |
| 4101 | } |
| 4102 | |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4103 | // -------------------- |
| 4104 | // Interned data types: |
| 4105 | // -------------------- |
| 4106 | |
| 4107 | message EventCategory { |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 4108 | optional uint64 iid = 1; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4109 | optional string name = 2; |
| 4110 | } |
| 4111 | |
Eric Seckler | 0c460ef | 2019-08-14 15:42:36 +0100 | [diff] [blame] | 4112 | message EventName { |
Florian Mayer | 5716fc1 | 2019-06-24 11:50:51 -0700 | [diff] [blame] | 4113 | optional uint64 iid = 1; |
Eric Seckler | c73ef06 | 2019-02-25 12:30:35 +0000 | [diff] [blame] | 4114 | optional string name = 2; |
| 4115 | } |
| 4116 | |
| 4117 | // End of protos/perfetto/trace/track_event/track_event.proto |
| 4118 | |
Stephen Nusko | 70ea330 | 2019-04-01 19:44:40 +0100 | [diff] [blame] | 4119 | // Begin of protos/perfetto/trace/trigger.proto |
| 4120 | |
| 4121 | // When a TracingSession receives a trigger it records the boot time nanoseconds |
| 4122 | // in the TracePacket's timestamp field as well as the name of the producer that |
| 4123 | // triggered it. We emit this data so filtering can be done on triggers received |
| 4124 | // in the trace. |
| 4125 | message Trigger { |
| 4126 | // Name of the trigger which was received. |
| 4127 | optional string trigger_name = 1; |
| 4128 | // The actual producer that activated |trigger|. |
| 4129 | optional string producer_name = 2; |
| 4130 | // The verified UID of the producer. |
| 4131 | optional int32 trusted_producer_uid = 3; |
| 4132 | } |
| 4133 | |
| 4134 | // End of protos/perfetto/trace/trigger.proto |
| 4135 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4136 | // Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto |
| 4137 | |
| 4138 | message GpuCounterEvent { |
| 4139 | // The first trace packet of each session should include counter_spec. |
Florian Mayer | b575112 | 2019-07-02 14:07:03 +0100 | [diff] [blame] | 4140 | optional GpuCounterDescriptor counter_descriptor = 1; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4141 | |
| 4142 | message GpuCounter { |
| 4143 | // required. Identifier for counter. |
| 4144 | optional uint32 counter_id = 1; |
| 4145 | // required. Value of the counter. |
Florian Mayer | b575112 | 2019-07-02 14:07:03 +0100 | [diff] [blame] | 4146 | oneof value { |
| 4147 | int64 int_value = 2; |
| 4148 | double double_value = 3; |
| 4149 | } |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4150 | } |
| 4151 | repeated GpuCounter counters = 2; |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4152 | |
| 4153 | // optional. Identifier for GPU in a multi-gpu device. |
| 4154 | optional int32 gpu_id = 3; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4155 | } |
| 4156 | |
| 4157 | // End of protos/perfetto/trace/gpu/gpu_counter_event.proto |
| 4158 | |
Raymond Chiu | c612b7f | 2019-09-18 14:53:28 -0700 | [diff] [blame] | 4159 | // Begin of protos/perfetto/trace/gpu/gpu_log.proto |
| 4160 | |
| 4161 | // Message for logging events GPU data producer. |
| 4162 | message GpuLog { |
| 4163 | enum Severity { |
Eric Seckler | 4364315 | 2019-10-09 14:26:30 +0100 | [diff] [blame] | 4164 | LOG_SEVERITY_UNSPECIFIED = 0; |
| 4165 | LOG_SEVERITY_VERBOSE = 1; |
| 4166 | LOG_SEVERITY_DEBUG = 2; |
| 4167 | LOG_SEVERITY_INFO = 3; |
| 4168 | LOG_SEVERITY_WARNING = 4; |
| 4169 | LOG_SEVERITY_ERROR = 5; |
Raymond Chiu | c612b7f | 2019-09-18 14:53:28 -0700 | [diff] [blame] | 4170 | }; |
| 4171 | optional Severity severity = 1; |
| 4172 | |
| 4173 | optional string tag = 2; |
| 4174 | |
| 4175 | optional string log_message = 3; |
| 4176 | } |
| 4177 | |
| 4178 | // End of protos/perfetto/trace/gpu/gpu_log.proto |
| 4179 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4180 | // Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto |
| 4181 | |
Raymond Chiu | b872f97 | 2019-08-27 18:10:32 -0700 | [diff] [blame] | 4182 | // next id: 12 |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4183 | message GpuRenderStageEvent { |
| 4184 | // required. Unique ID for the event. |
| 4185 | optional uint64 event_id = 1; |
| 4186 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4187 | // optional. Duration of the event. This should be in the same clock domain as the timestamp of |
| 4188 | // the packet. If unset, this is a single time point event. |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4189 | optional uint64 duration = 2; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4190 | |
| 4191 | // required. ID to a hardware queue description in the specifications. |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4192 | optional int32 hw_queue_id = 3; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4193 | |
| 4194 | // required. ID to a render stage description in the specifications. |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4195 | optional int32 stage_id = 4; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4196 | |
| 4197 | // required. GL context/VK device. |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4198 | optional uint64 context = 5; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4199 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4200 | // optional. The render target for this event. |
| 4201 | optional uint64 render_target_handle = 8; |
Raymond Chiu | b872f97 | 2019-08-27 18:10:32 -0700 | [diff] [blame] | 4202 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4203 | // optional. The Vulkan render pass handle. |
Raymond Chiu | b872f97 | 2019-08-27 18:10:32 -0700 | [diff] [blame] | 4204 | optional uint64 render_pass_handle = 9; |
| 4205 | |
| 4206 | // optional. Submission ID generated by the UMD. |
| 4207 | optional uint32 submission_id = 10; |
| 4208 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4209 | // optional. Additional data for the user. This may include attribs for |
| 4210 | // the event like resource ids, shaders etc |
| 4211 | message ExtraData { |
| 4212 | optional string name = 1; |
| 4213 | optional string value = 2; |
| 4214 | } |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4215 | repeated ExtraData extra_data = 6; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4216 | |
| 4217 | // The first trace packet of each session should include a Specifications |
| 4218 | // to enumerate all IDs that will be used. |
| 4219 | message Specifications { |
| 4220 | message ContextSpec { |
| 4221 | optional uint64 context = 1; |
| 4222 | optional int32 pid = 2; |
| 4223 | } |
| 4224 | optional ContextSpec context_spec = 1; |
| 4225 | |
| 4226 | message Description { |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4227 | optional string name = 1; |
| 4228 | optional string description = 2; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4229 | } |
| 4230 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4231 | // Labels to categorize the hw Queue this event goes on. |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4232 | repeated Description hw_queue = 2; |
| 4233 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4234 | // Labels to categorize render stage(binning, render, compute etc). |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4235 | repeated Description stage = 3; |
| 4236 | } |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4237 | optional Specifications specifications = 7; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4238 | |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4239 | // optional. Identifier for GPU in a multi-gpu device. |
| 4240 | optional int32 gpu_id = 11; |
Raymond Chiu | b872f97 | 2019-08-27 18:10:32 -0700 | [diff] [blame] | 4241 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4242 | // Extension for vendor's custom proto. |
Raymond Chiu | 449d2fd | 2019-07-10 15:57:57 -0700 | [diff] [blame] | 4243 | extensions 100; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4244 | } |
| 4245 | |
| 4246 | // End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto |
| 4247 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4248 | // Begin of protos/perfetto/config/android/android_log_config.proto |
| 4249 | |
| 4250 | message AndroidLogConfig { |
| 4251 | repeated AndroidLogId log_ids = 1; |
| 4252 | |
| 4253 | reserved 2; // Was |poll_ms|, deprecated. |
| 4254 | |
| 4255 | // If set ignores all log messages whose prio is < the given value. |
| 4256 | optional AndroidLogPriority min_prio = 3; |
| 4257 | |
| 4258 | // If non-empty ignores all log messages whose tag doesn't match one of the |
| 4259 | // specified values. |
| 4260 | repeated string filter_tags = 4; |
| 4261 | } |
| 4262 | |
| 4263 | // End of protos/perfetto/config/android/android_log_config.proto |
| 4264 | |
| 4265 | // Begin of protos/perfetto/config/chrome/chrome_config.proto |
| 4266 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4267 | message ChromeConfig { |
| 4268 | optional string trace_config = 1; |
Siddhartha S | 305a501 | 2019-03-29 09:33:00 -0700 | [diff] [blame] | 4269 | |
| 4270 | // When enabled, the data source should only fill in fields in the output that |
| 4271 | // are not potentially privacy sensitive. |
| 4272 | optional bool privacy_filtering_enabled = 2; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4273 | } |
| 4274 | |
| 4275 | // End of protos/perfetto/config/chrome/chrome_config.proto |
| 4276 | |
| 4277 | // Begin of protos/perfetto/config/data_source_config.proto |
| 4278 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4279 | // The configuration that is passed to each data source when starting tracing. |
| 4280 | message DataSourceConfig { |
| 4281 | // Data source unique name, e.g., "linux.ftrace". This must match |
| 4282 | // the name passed by the data source when it registers (see |
| 4283 | // RegisterDataSource()). |
| 4284 | optional string name = 1; |
| 4285 | |
| 4286 | // The index of the logging buffer where TracePacket(s) will be stored. |
| 4287 | // This field doesn't make a major difference for the Producer(s). The final |
| 4288 | // logging buffers, in fact, are completely owned by the Service. We just ask |
| 4289 | // the Producer to copy this number into the chunk headers it emits, so that |
| 4290 | // the Service can quickly identify the buffer where to move the chunks into |
| 4291 | // without expensive lookups on its fastpath. |
| 4292 | optional uint32 target_buffer = 2; |
| 4293 | |
| 4294 | // Set by the service to indicate the duration of the trace. |
| 4295 | // DO NOT SET in consumer as this will be overridden by the service. |
| 4296 | optional uint32 trace_duration_ms = 3; |
| 4297 | |
Florian Mayer | 6e45e9a | 2019-07-25 14:18:24 +0100 | [diff] [blame] | 4298 | // Set by the service to indicate how long it waits after StopDataSource. |
| 4299 | // DO NOT SET in consumer as this will be overridden by the service. |
| 4300 | optional uint32 stop_timeout_ms = 7; |
| 4301 | |
Florian Mayer | fb87998 | 2019-03-29 10:45:32 +0000 | [diff] [blame] | 4302 | // Set by the service to indicate whether this tracing session has extra |
| 4303 | // guardrails. |
| 4304 | // DO NOT SET in consumer as this will be overridden by the service. |
| 4305 | optional bool enable_extra_guardrails = 6; |
| 4306 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4307 | // Set by the service to indicate which tracing session the data source |
| 4308 | // belongs to. The intended use case for this is checking if two data sources, |
| 4309 | // one of which produces metadata for the other one, belong to the same trace |
| 4310 | // session and hence should be linked together. |
| 4311 | // This field was introduced in Aug 2018 after Android P. |
| 4312 | optional uint64 tracing_session_id = 4; |
| 4313 | |
| 4314 | // Keeep the lower IDs (up to 99) for fields that are *not* specific to |
| 4315 | // data-sources and needs to be processed by the traced daemon. |
| 4316 | |
Primiano Tucci | 0f2f3b4 | 2019-05-21 19:37:01 +0100 | [diff] [blame] | 4317 | // All data source config fields must be marked as [lazy=true]. This prevents |
| 4318 | // the proto-to-cpp generator from recursing into those when generating the |
| 4319 | // cpp classes and polluting tracing/core with data-source-specific classes. |
| 4320 | // Instead they are treated as opaque strings containing raw proto bytes. |
| 4321 | |
| 4322 | optional FtraceConfig ftrace_config = 100 [lazy = true]; |
| 4323 | optional InodeFileConfig inode_file_config = 102 [lazy = true]; |
| 4324 | optional ProcessStatsConfig process_stats_config = 103 [lazy = true]; |
| 4325 | optional SysStatsConfig sys_stats_config = 104 [lazy = true]; |
| 4326 | optional HeapprofdConfig heapprofd_config = 105 [lazy = true]; |
Florian Mayer | 98965ba | 2019-09-13 15:32:36 +0100 | [diff] [blame] | 4327 | optional JavaHprofConfig java_hprof_config = 110 [lazy = true]; |
Primiano Tucci | 0f2f3b4 | 2019-05-21 19:37:01 +0100 | [diff] [blame] | 4328 | optional AndroidPowerConfig android_power_config = 106 [lazy = true]; |
| 4329 | optional AndroidLogConfig android_log_config = 107 [lazy = true]; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4330 | optional GpuCounterConfig gpu_counter_config = 108 [lazy = true]; |
Ryan Savitski | fde4ae6 | 2019-06-14 16:02:52 +0100 | [diff] [blame] | 4331 | optional PackagesListConfig packages_list_config = 109 [lazy = true]; |
Primiano Tucci | 0f2f3b4 | 2019-05-21 19:37:01 +0100 | [diff] [blame] | 4332 | |
Primiano Tucci | 0f9e022 | 2019-06-05 09:36:41 +0100 | [diff] [blame] | 4333 | // Chrome is special as it doesn't use the perfetto IPC layer. We want to |
| 4334 | // avoid proto serialization and de-serialization there because that would |
| 4335 | // just add extra hops on top of the Mojo ser/des. Instead we auto-generate a |
| 4336 | // C++ class for it so it can pass around plain C++ objets. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4337 | optional ChromeConfig chrome_config = 101; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4338 | |
| 4339 | // This is a fallback mechanism to send a free-form text config to the |
| 4340 | // producer. In theory this should never be needed. All the code that |
| 4341 | // is part of the platform (i.e. traced service) is supposed to *not* truncate |
| 4342 | // the trace config proto and propagate unknown fields. However, if anything |
| 4343 | // in the pipeline (client or backend) ends up breaking this forward compat |
| 4344 | // plan, this field will become the escape hatch to allow future data sources |
| 4345 | // to get some meaningful configuration. |
| 4346 | optional string legacy_config = 1000; |
| 4347 | |
| 4348 | // This field is only used for testing. |
Primiano Tucci | 0f9e022 | 2019-06-05 09:36:41 +0100 | [diff] [blame] | 4349 | optional TestConfig for_testing = 1001; |
| 4350 | |
| 4351 | reserved 268435455; // Was |for_testing|. Caused more problems then found. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4352 | } |
| 4353 | |
| 4354 | // End of protos/perfetto/config/data_source_config.proto |
| 4355 | |
| 4356 | // Begin of protos/perfetto/config/ftrace/ftrace_config.proto |
| 4357 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4358 | message FtraceConfig { |
| 4359 | repeated string ftrace_events = 1; |
| 4360 | repeated string atrace_categories = 2; |
| 4361 | repeated string atrace_apps = 3; |
| 4362 | // *Per-CPU* buffer size. |
| 4363 | optional uint32 buffer_size_kb = 10; |
| 4364 | optional uint32 drain_period_ms = 11; |
Ryan | bcc3456 | 2019-09-18 17:40:39 +0100 | [diff] [blame] | 4365 | |
| 4366 | // Configuration for compact encoding of scheduler events. If enabled, this |
| 4367 | // records a small subset of fields of selected scheduling events, and |
| 4368 | // encodes them in a denser proto format than normal. This is useful due to |
| 4369 | // scheduling events being abundant in a typical trace, and dominating its |
| 4370 | // size via a combination of unnecessary data being retained, and proto |
| 4371 | // format overheads. |
| 4372 | // TODO(rsavitski): unstable, do not use. |
| 4373 | message CompactSchedConfig { |
| 4374 | // If true, and sched_switch ftrace event is enabled, record those events |
| 4375 | // in the compact format. |
| 4376 | optional bool enabled = 1; |
| 4377 | } |
| 4378 | optional CompactSchedConfig compact_sched = 12; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4379 | } |
| 4380 | |
| 4381 | // End of protos/perfetto/config/ftrace/ftrace_config.proto |
| 4382 | |
| 4383 | // Begin of protos/perfetto/config/inode_file/inode_file_config.proto |
| 4384 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4385 | message InodeFileConfig { |
| 4386 | message MountPointMappingEntry { |
| 4387 | optional string mountpoint = 1; |
| 4388 | repeated string scan_roots = 2; |
| 4389 | } |
| 4390 | |
| 4391 | // How long to pause between batches. |
| 4392 | optional uint32 scan_interval_ms = 1; |
| 4393 | |
| 4394 | // How long to wait before the first scan in order to accumulate inodes. |
| 4395 | optional uint32 scan_delay_ms = 2; |
| 4396 | |
| 4397 | // How many inodes to scan in one batch. |
| 4398 | optional uint32 scan_batch_size = 3; |
| 4399 | |
| 4400 | // Do not scan for inodes not found in the static map. |
| 4401 | optional bool do_not_scan = 4; |
| 4402 | |
| 4403 | // If non-empty, only scan inodes corresponding to block devices named in |
| 4404 | // this list. |
| 4405 | repeated string scan_mount_points = 5; |
| 4406 | |
| 4407 | // When encountering an inode belonging to a block device corresponding |
| 4408 | // to one of the mount points in this map, scan its scan_roots instead. |
| 4409 | repeated MountPointMappingEntry mount_point_mapping = 6; |
| 4410 | } |
| 4411 | |
| 4412 | // End of protos/perfetto/config/inode_file/inode_file_config.proto |
| 4413 | |
| 4414 | // Begin of protos/perfetto/config/power/android_power_config.proto |
| 4415 | |
| 4416 | message AndroidPowerConfig { |
| 4417 | enum BatteryCounters { |
| 4418 | BATTERY_COUNTER_UNSPECIFIED = 0; |
| 4419 | BATTERY_COUNTER_CHARGE = 1; // Coulomb counter. |
| 4420 | BATTERY_COUNTER_CAPACITY_PERCENT = 2; // Charge (%). |
| 4421 | BATTERY_COUNTER_CURRENT = 3; // Instantaneous current. |
| 4422 | BATTERY_COUNTER_CURRENT_AVG = 4; // Avg current. |
| 4423 | } |
| 4424 | optional uint32 battery_poll_ms = 1; |
| 4425 | repeated BatteryCounters battery_counters = 2; |
| 4426 | |
| 4427 | // Where available enables per-power-rail measurements. |
| 4428 | optional bool collect_power_rails = 3; |
| 4429 | } |
| 4430 | |
| 4431 | // End of protos/perfetto/config/power/android_power_config.proto |
| 4432 | |
| 4433 | // Begin of protos/perfetto/config/process_stats/process_stats_config.proto |
| 4434 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4435 | message ProcessStatsConfig { |
| 4436 | enum Quirks { |
| 4437 | QUIRKS_UNSPECIFIED = 0; |
| 4438 | |
| 4439 | // This has been deprecated and ignored as per 2018-05-01. Full scan at |
| 4440 | // startup is now disabled by default and can be re-enabled using the |
| 4441 | // |scan_all_processes_on_start| arg. |
| 4442 | DISABLE_INITIAL_DUMP = 1 [deprecated = true]; |
| 4443 | |
| 4444 | DISABLE_ON_DEMAND = 2; |
| 4445 | } |
| 4446 | |
| 4447 | repeated Quirks quirks = 1; |
| 4448 | |
| 4449 | // If enabled all processes will be scanned and dumped when the trace starts. |
| 4450 | optional bool scan_all_processes_on_start = 2; |
| 4451 | |
| 4452 | // If enabled thread names are also recoded (this is redundant if sched_switch |
| 4453 | // is enabled). |
| 4454 | optional bool record_thread_names = 3; |
| 4455 | |
| 4456 | // If > 0 samples counters (see process_stats.proto) from |
| 4457 | // /proc/pid/status and oom_score_adj every X ms. |
| 4458 | // This is required to be > 100ms to avoid excessive CPU usage. |
| 4459 | // TODO(primiano): add CPU cost for change this value. |
| 4460 | optional uint32 proc_stats_poll_ms = 4; |
| 4461 | |
| 4462 | // If empty samples stats for all processes. If non empty samples stats only |
| 4463 | // for processes matching the given string in their argv0 (i.e. the first |
| 4464 | // entry of /proc/pid/cmdline). |
| 4465 | // TODO(primiano): implement this feature. |
| 4466 | // repeated string proc_stats_filter = 5; |
Lalit Maganti | 999355c | 2019-03-27 18:17:08 +0000 | [diff] [blame] | 4467 | |
| 4468 | // This is required to be either = 0 or a multiple of |proc_stats_poll_ms| |
| 4469 | // (default: |proc_stats_poll_ms|). If = 0, will be set to |
| 4470 | // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest |
| 4471 | // multiple. |
| 4472 | optional uint32 proc_stats_cache_ttl_ms = 6; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4473 | } |
| 4474 | |
| 4475 | // End of protos/perfetto/config/process_stats/process_stats_config.proto |
| 4476 | |
| 4477 | // Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto |
| 4478 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4479 | // This file defines the configuration for the Linux /proc poller data source, |
| 4480 | // which injects counters in the trace. |
| 4481 | // Counters that are needed in the trace must be explicitly listed in the |
| 4482 | // *_counters fields. This is to avoid spamming the trace with all counters |
| 4483 | // at all times. |
| 4484 | // The sampling rate is configurable. All polling rates (*_period_ms) need |
| 4485 | // to be integer multiples of each other. |
| 4486 | // OK: [10ms, 10ms, 10ms], [10ms, 20ms, 10ms], [10ms, 20ms, 60ms] |
| 4487 | // Not OK: [10ms, 10ms, 11ms], [10ms, 15ms, 20ms] |
| 4488 | message SysStatsConfig { |
| 4489 | // Polls /proc/meminfo every X ms, if non-zero. |
| 4490 | // This is required to be > 10ms to avoid excessive CPU usage. |
| 4491 | // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection] |
| 4492 | optional uint32 meminfo_period_ms = 1; |
| 4493 | |
Primiano Tucci | 1eb966d | 2019-06-06 15:40:09 +0100 | [diff] [blame] | 4494 | // If empty all known counters are reported. Otherwise, only the counters |
| 4495 | // specified below are reported. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4496 | repeated MeminfoCounters meminfo_counters = 2; |
| 4497 | |
| 4498 | // Polls /proc/vmstat every X ms, if non-zero. |
| 4499 | // This is required to be > 10ms to avoid excessive CPU usage. |
| 4500 | // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection] |
| 4501 | optional uint32 vmstat_period_ms = 3; |
| 4502 | repeated VmstatCounters vmstat_counters = 4; |
| 4503 | |
| 4504 | // Pols /proc/stat every X ms, if non-zero. |
| 4505 | // This is required to be > 10ms to avoid excessive CPU usage. |
| 4506 | // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection] |
| 4507 | optional uint32 stat_period_ms = 5; |
| 4508 | enum StatCounters { |
| 4509 | STAT_UNSPECIFIED = 0; |
| 4510 | STAT_CPU_TIMES = 1; |
| 4511 | STAT_IRQ_COUNTS = 2; |
| 4512 | STAT_SOFTIRQ_COUNTS = 3; |
| 4513 | STAT_FORK_COUNT = 4; |
| 4514 | } |
| 4515 | repeated StatCounters stat_counters = 6; |
| 4516 | } |
| 4517 | |
| 4518 | // End of protos/perfetto/config/sys_stats/sys_stats_config.proto |
| 4519 | |
| 4520 | // Begin of protos/perfetto/config/test_config.proto |
| 4521 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4522 | // The configuration for a fake producer used in tests. |
| 4523 | message TestConfig { |
| 4524 | message DummyFields { |
| 4525 | optional uint32 field_uint32 = 1; |
| 4526 | optional int32 field_int32 = 2; |
| 4527 | optional uint64 field_uint64 = 3; |
| 4528 | optional int64 field_int64 = 4; |
| 4529 | optional fixed64 field_fixed64 = 5; |
| 4530 | optional sfixed64 field_sfixed64 = 6; |
| 4531 | optional fixed32 field_fixed32 = 7; |
| 4532 | optional sfixed32 field_sfixed32 = 8; |
| 4533 | optional double field_double = 9; |
| 4534 | optional float field_float = 10; |
| 4535 | optional sint64 field_sint64 = 11; |
| 4536 | optional sint32 field_sint32 = 12; |
| 4537 | optional string field_string = 13; |
| 4538 | optional bytes field_bytes = 14; |
| 4539 | } |
| 4540 | |
| 4541 | // The number of messages the fake producer should send. |
| 4542 | optional uint32 message_count = 1; |
| 4543 | |
| 4544 | // The maximum number of messages which should be sent each second. |
| 4545 | // The actual obserced speed may be lower if the producer is unable to |
| 4546 | // work fast enough. |
| 4547 | // If this is zero or unset, the producer will send as fast as possible. |
| 4548 | optional uint32 max_messages_per_second = 2; |
| 4549 | |
| 4550 | // The seed value for a simple multiplicative congruential pseudo-random |
| 4551 | // number sequence. |
| 4552 | optional uint32 seed = 3; |
| 4553 | |
| 4554 | // The size of each message in bytes. Should be greater than or equal 5 to |
| 4555 | // account for the number of bytes needed to encode the random number and a |
| 4556 | // null byte for the string. |
| 4557 | optional uint32 message_size = 4; |
| 4558 | |
| 4559 | // Whether the producer should send a event batch when the data source is |
| 4560 | // is initially registered. |
| 4561 | optional bool send_batch_on_register = 5; |
| 4562 | |
| 4563 | optional DummyFields dummy_fields = 6; |
| 4564 | } |
| 4565 | |
| 4566 | // End of protos/perfetto/config/test_config.proto |
| 4567 | |
| 4568 | // Begin of protos/perfetto/config/trace_config.proto |
| 4569 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4570 | // The overall config that is used when starting a new tracing session through |
| 4571 | // ProducerPort::StartTracing(). |
| 4572 | // It contains the general config for the logging buffer(s) and the configs for |
| 4573 | // all the data source being enabled. |
| 4574 | // |
Hector Dearman | 2bdd2be | 2019-08-07 14:50:37 +0100 | [diff] [blame] | 4575 | // Next id: 27. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4576 | message TraceConfig { |
| 4577 | message BufferConfig { |
| 4578 | optional uint32 size_kb = 1; |
| 4579 | |
| 4580 | reserved 2; // |page_size|, now deprecated. |
| 4581 | reserved 3; // |optimize_for|, now deprecated. |
| 4582 | |
| 4583 | enum FillPolicy { |
| 4584 | UNSPECIFIED = 0; |
| 4585 | |
| 4586 | // Default behavior. The buffer operates as a conventional ring buffer. |
| 4587 | // If the writer is faster than the reader (or if the reader reads only |
| 4588 | // after tracing is stopped) newly written packets will overwrite old |
| 4589 | // packets. |
| 4590 | RING_BUFFER = 1; |
| 4591 | |
| 4592 | // Behaves like RING_BUFFER as long as there is space in the buffer or |
| 4593 | // the reader catches up with the writer. As soon as the writer hits |
| 4594 | // an unread chunk, it stops accepting new data in the buffer. |
| 4595 | DISCARD = 2; |
| 4596 | } |
| 4597 | optional FillPolicy fill_policy = 4; |
| 4598 | } |
| 4599 | repeated BufferConfig buffers = 1; |
| 4600 | |
| 4601 | message DataSource { |
| 4602 | // Filters and data-source specific config. It contains also the unique name |
| 4603 | // of the data source, the one passed in the DataSourceDescriptor when they |
| 4604 | // register on the service. |
| 4605 | optional protos.DataSourceConfig config = 1; |
| 4606 | |
| 4607 | // Optional. If multiple producers (~processes) expose the same data source |
| 4608 | // and |producer_name_filter| != "", the data source is enabled only for |
| 4609 | // producers whose names match any of the producer_name_filter below. |
| 4610 | // The |producer_name_filter| has to be an exact match. (TODO(primiano): |
| 4611 | // support wildcards or regex). |
| 4612 | // This allows to enable a data source only for specific processes. |
| 4613 | // The "repeated" field has OR sematics: specifying a filter ["foo", "bar"] |
| 4614 | // will enable data source on both "foo" and "bar" (if existent). |
| 4615 | repeated string producer_name_filter = 2; |
| 4616 | } |
| 4617 | repeated DataSource data_sources = 2; |
| 4618 | |
Siddhartha S | b63f61e | 2019-05-03 16:19:51 -0700 | [diff] [blame] | 4619 | // Config for builtin trace packets emitted by perfetto like trace stats, |
| 4620 | // system info, etc. |
| 4621 | message BuiltinDataSource { |
| 4622 | // Disable emitting clock timestamps into the trace. |
| 4623 | optional bool disable_clock_snapshotting = 1; |
| 4624 | |
| 4625 | optional bool disable_trace_config = 2; |
| 4626 | |
| 4627 | optional bool disable_system_info = 3; |
| 4628 | } |
| 4629 | optional BuiltinDataSource builtin_data_sources = 20; |
| 4630 | |
Stephen Nusko | f53f8ed | 2019-03-20 14:51:10 +0000 | [diff] [blame] | 4631 | // If specified, the trace will be stopped |duration_ms| after starting. |
| 4632 | // However in case of traces with triggers, see |
| 4633 | // TriggerConfig.trigger_timeout_ms instead. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4634 | optional uint32 duration_ms = 3; |
| 4635 | |
| 4636 | // This is set when --dropbox is passed to the Perfetto command line client |
| 4637 | // and enables guardrails that limit resource usage for traces requested |
| 4638 | // by statsd. |
| 4639 | optional bool enable_extra_guardrails = 4; |
| 4640 | |
| 4641 | enum LockdownModeOperation { |
| 4642 | LOCKDOWN_UNCHANGED = 0; |
| 4643 | LOCKDOWN_CLEAR = 1; |
| 4644 | LOCKDOWN_SET = 2; |
| 4645 | } |
| 4646 | // Reject producers that are not running under the same UID as the tracing |
| 4647 | // service. |
| 4648 | optional LockdownModeOperation lockdown_mode = 5; |
| 4649 | |
| 4650 | message ProducerConfig { |
| 4651 | // Identifies the producer for which this config is for. |
| 4652 | optional string producer_name = 1; |
| 4653 | |
| 4654 | // Specifies the preferred size of the shared memory buffer. If the size is |
| 4655 | // larger than the max size, the max will be used. If it is smaller than |
| 4656 | // the page size or doesn't fit pages evenly into it, it will fall back to |
| 4657 | // the size specified by the producer or finally the default shared memory |
| 4658 | // size. |
| 4659 | optional uint32 shm_size_kb = 2; |
| 4660 | |
| 4661 | // Specifies the preferred size of each page in the shared memory buffer. |
| 4662 | // Must be an integer multiple of 4K. |
| 4663 | optional uint32 page_size_kb = 3; |
| 4664 | } |
| 4665 | |
| 4666 | repeated ProducerConfig producers = 6; |
| 4667 | |
| 4668 | // Contains statsd-specific metadata about an alert associated with the trace. |
| 4669 | message StatsdMetadata { |
| 4670 | // The identifier of the alert which triggered this trace. |
| 4671 | optional int64 triggering_alert_id = 1; |
| 4672 | // The uid which registered the triggering configuration with statsd. |
| 4673 | optional int32 triggering_config_uid = 2; |
| 4674 | // The identifier of the config which triggered the alert. |
| 4675 | optional int64 triggering_config_id = 3; |
| 4676 | // The identifier of the subscription which triggered this trace. |
| 4677 | optional int64 triggering_subscription_id = 4; |
| 4678 | } |
| 4679 | |
| 4680 | // Statsd-specific metadata. |
| 4681 | optional StatsdMetadata statsd_metadata = 7; |
| 4682 | |
| 4683 | // When true, the EnableTracing() request must also provide a file descriptor. |
| 4684 | // The service will then periodically read packets out of the trace buffer and |
| 4685 | // store it into the passed file. |
| 4686 | optional bool write_into_file = 8; |
| 4687 | |
| 4688 | // Optional. If non-zero tunes the write period. A min value of 100ms is |
| 4689 | // enforced (i.e. smaller values are ignored). |
| 4690 | optional uint32 file_write_period_ms = 9; |
| 4691 | |
| 4692 | // Optional. When non zero the periodic write stops once at most X bytes |
| 4693 | // have been written into the file. Tracing is disabled when this limit is |
| 4694 | // reached, even if |duration_ms| has not been reached yet. |
| 4695 | optional uint64 max_file_size_bytes = 10; |
| 4696 | |
| 4697 | // Contains flags which override the default values of the guardrails inside |
| 4698 | // Perfetto. These values are only affect userdebug builds. |
| 4699 | message GuardrailOverrides { |
| 4700 | // Override the default limit (in bytes) for uploading data to server within |
| 4701 | // a 24 hour period. |
| 4702 | optional uint64 max_upload_per_day_bytes = 1; |
| 4703 | } |
| 4704 | |
| 4705 | optional GuardrailOverrides guardrail_overrides = 11; |
| 4706 | |
| 4707 | // When true, data sources are not started until an explicit call to |
| 4708 | // StartTracing() on the consumer port. This is to support early |
| 4709 | // initialization and fast trace triggering. This can be used only when the |
| 4710 | // Consumer explicitly triggers the StartTracing() method. |
| 4711 | // This should not be used in a remote trace config via statsd, doing so will |
| 4712 | // result in a hung trace session. |
| 4713 | optional bool deferred_start = 12; |
| 4714 | |
| 4715 | // When set, it periodically issues a Flush() to all data source, forcing them |
| 4716 | // to commit their data into the tracing service. This can be used for |
| 4717 | // quasi-real-time streaming mode and to guarantee some partial ordering of |
| 4718 | // events in the trace in windows of X ms. |
| 4719 | optional uint32 flush_period_ms = 13; |
| 4720 | |
| 4721 | // Wait for this long for producers to acknowledge flush requests. |
| 4722 | // Default 5s. |
| 4723 | optional uint32 flush_timeout_ms = 14; |
| 4724 | |
Florian Mayer | 990e6d7 | 2019-06-03 11:34:52 +0100 | [diff] [blame] | 4725 | // Wait for this long for producers to acknowledge stop requests. |
| 4726 | // Default 5s. |
| 4727 | optional uint32 data_source_stop_timeout_ms = 23; |
| 4728 | |
Siddhartha S | b63f61e | 2019-05-03 16:19:51 -0700 | [diff] [blame] | 4729 | reserved 15; // |disable_clock_snapshotting| moved. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4730 | |
| 4731 | // Android-only. If set, sends an intent to the Traceur system app when the |
| 4732 | // trace ends to notify it about the trace readiness. |
| 4733 | optional bool notify_traceur = 16; |
Stephen Nusko | f53f8ed | 2019-03-20 14:51:10 +0000 | [diff] [blame] | 4734 | |
| 4735 | // Triggers allow producers to start or stop the tracing session when an event |
| 4736 | // occurs. |
| 4737 | // |
| 4738 | // For example if we are tracing probabilistically, most traces will be |
| 4739 | // uninteresting. Triggers allow us to keep only the interesting ones such as |
| 4740 | // those traces during which the device temperature reached a certain |
| 4741 | // threshold. In this case the producer can activate a trigger to keep |
| 4742 | // (STOP_TRACING) the trace, otherwise it can also begin a trace |
| 4743 | // (START_TRACING) because it knows something is about to happen. |
| 4744 | message TriggerConfig { |
| 4745 | enum TriggerMode { |
| 4746 | UNSPECIFIED = 0; |
| 4747 | |
| 4748 | // When this mode is chosen, data sources are not started until one of the |
| 4749 | // |triggers| are received. This supports early initialization and fast |
| 4750 | // starting of the tracing system. On triggering, the session will then |
| 4751 | // record for |stop_delay_ms|. However if no trigger is seen |
| 4752 | // after |trigger_timeout_ms| the session will be stopped and no data will |
| 4753 | // be returned. |
| 4754 | START_TRACING = 1; |
| 4755 | |
| 4756 | // When this mode is chosen, the session will be started via the normal |
| 4757 | // EnableTracing() & StartTracing(). If no trigger is ever seen |
| 4758 | // the session will be stopped after |trigger_timeout_ms| and no data will |
| 4759 | // be returned. However if triggered the trace will stop after |
| 4760 | // |stop_delay_ms| and any data in the buffer will be returned to the |
| 4761 | // consumer. |
| 4762 | STOP_TRACING = 2; |
| 4763 | } |
| 4764 | optional TriggerMode trigger_mode = 1; |
| 4765 | |
| 4766 | message Trigger { |
| 4767 | // The producer must specify this name to activate the trigger. |
| 4768 | optional string name = 1; |
| 4769 | |
| 4770 | // The a std::regex that will match the producer that can activate this |
| 4771 | // trigger. This is optional. If unset any producers can activate this |
| 4772 | // trigger. |
| 4773 | optional string producer_name_regex = 2; |
| 4774 | |
| 4775 | // After a trigger is received either in START_TRACING or STOP_TRACING |
| 4776 | // mode then the trace will end |stop_delay_ms| after triggering. |
| 4777 | optional uint32 stop_delay_ms = 3; |
| 4778 | } |
| 4779 | // A list of triggers which are related to this configuration. If ANY |
| 4780 | // trigger is seen then an action will be performed based on |trigger_mode|. |
| 4781 | repeated Trigger triggers = 2; |
| 4782 | |
| 4783 | // Required and must be positive if a TriggerConfig is specified. This is |
| 4784 | // how long this TraceConfig should wait for a trigger to arrive. After this |
| 4785 | // period of time if no trigger is seen the TracingSession will be cleaned |
| 4786 | // up. |
| 4787 | optional uint32 trigger_timeout_ms = 3; |
| 4788 | } |
| 4789 | optional TriggerConfig trigger_config = 17; |
Stephen Nusko | 9fa59cb | 2019-04-15 04:19:16 +0100 | [diff] [blame] | 4790 | |
| 4791 | // When this is non-empty the perfetto command line tool will ignore the rest |
| 4792 | // of this TraceConfig and instead connect to the perfetto service as a |
| 4793 | // producer and send these triggers, potentially stopping or starting traces |
| 4794 | // that were previous configured to use a TriggerConfig. |
| 4795 | repeated string activate_triggers = 18; |
Hector Dearman | 085dc3c | 2019-04-23 11:48:10 +0100 | [diff] [blame] | 4796 | |
Ryan Savitski | ac6e0d4 | 2019-05-10 15:59:56 +0100 | [diff] [blame] | 4797 | // Configuration for trace contents that reference earlier trace data. For |
| 4798 | // example, a data source might intern strings, and emit packets containing |
| 4799 | // {interned id : string} pairs. Future packets from that data source can then |
| 4800 | // use the interned ids instead of duplicating the raw string contents. The |
| 4801 | // trace parser will then need to use that interning table to fully interpret |
| 4802 | // the rest of the trace. |
| 4803 | message IncrementalStateConfig { |
Ryan Savitski | 0b4008a | 2019-05-13 17:55:53 +0100 | [diff] [blame] | 4804 | // If nonzero, notify eligible data sources to clear their incremental state |
| 4805 | // periodically, with the given period. The notification is sent only to |
| 4806 | // data sources that have |handles_incremental_state_clear| set in their |
| 4807 | // DataSourceDescriptor. The notification requests that the data source |
| 4808 | // stops referring to past trace contents. This is particularly useful when |
| 4809 | // tracing in ring buffer mode, where it is not exceptional to overwrite old |
| 4810 | // trace data. |
Ryan Savitski | ac6e0d4 | 2019-05-10 15:59:56 +0100 | [diff] [blame] | 4811 | // |
| 4812 | // Warning: this time-based global clearing is likely to be removed in the |
Ryan Savitski | 0b4008a | 2019-05-13 17:55:53 +0100 | [diff] [blame] | 4813 | // future, to be replaced with a smarter way of sending the notifications |
| 4814 | // only when necessary. |
Ryan Savitski | ac6e0d4 | 2019-05-10 15:59:56 +0100 | [diff] [blame] | 4815 | optional uint32 clear_period_ms = 1; |
| 4816 | } |
| 4817 | optional IncrementalStateConfig incremental_state_config = 21; |
| 4818 | |
Hector Dearman | 085dc3c | 2019-04-23 11:48:10 +0100 | [diff] [blame] | 4819 | // Additional guardrail used by the Perfetto command line client. |
| 4820 | // On user builds when --dropbox is set perfetto will refuse to trace unless |
| 4821 | // this is also set. |
| 4822 | // Added in Q. |
| 4823 | optional bool allow_user_build_tracing = 19; |
Hector Dearman | fb4d073 | 2019-05-19 15:44:56 +0100 | [diff] [blame] | 4824 | |
| 4825 | // If set the tracing service will ensure there is at most one tracing session |
| 4826 | // with this key. |
| 4827 | optional string unique_session_name = 22; |
Hector Dearman | 554627f | 2019-06-04 17:58:22 +0100 | [diff] [blame] | 4828 | |
| 4829 | // Compress trace with the given method. Best effort. |
| 4830 | enum CompressionType { |
| 4831 | COMPRESSION_TYPE_UNSPECIFIED = 0; |
| 4832 | COMPRESSION_TYPE_DEFLATE = 1; |
| 4833 | }; |
| 4834 | optional CompressionType compression_type = 24; |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 4835 | |
| 4836 | // Android-only. Debug builds only. Not for general use. If set, saves a |
| 4837 | // Dropbox trace into an incident. This field is read by perfetto_cmd, rather |
| 4838 | // than the tracing service. All fields are mandatory. |
| 4839 | message IncidentReportConfig { |
| 4840 | optional string destination_package = 1; |
| 4841 | optional string destination_class = 2; |
| 4842 | // Level of filtering in the requested incident. See |Destination| in |
| 4843 | // frameworks/base/core/proto/android/privacy.proto. |
| 4844 | optional int32 privacy_level = 3; |
| 4845 | // If true, do not write the trace into dropbox (i.e. incident only). |
| 4846 | // Otherwise, write to both dropbox and incident. |
| 4847 | optional bool skip_dropbox = 4; |
| 4848 | } |
| 4849 | optional IncidentReportConfig incident_report_config = 25; |
Hector Dearman | 2bdd2be | 2019-08-07 14:50:37 +0100 | [diff] [blame] | 4850 | |
| 4851 | // An identifier clients can use to tie this trace to other logging. |
| 4852 | optional bytes trace_uuid = 26; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4853 | } |
| 4854 | |
| 4855 | // End of protos/perfetto/config/trace_config.proto |
| 4856 | |
| 4857 | // Begin of protos/perfetto/config/profiling/heapprofd_config.proto |
| 4858 | |
| 4859 | // Configuration for go/heapprofd. |
| 4860 | message HeapprofdConfig { |
| 4861 | message ContinuousDumpConfig { |
| 4862 | // ms to wait before first dump. |
| 4863 | optional uint32 dump_phase_ms = 5; |
| 4864 | // ms to wait between following dumps. |
| 4865 | optional uint32 dump_interval_ms = 6; |
| 4866 | }; |
| 4867 | |
| 4868 | // Set to 1 for perfect accuracy. |
| 4869 | // Otherwise, sample every sample_interval_bytes on average. |
Florian Mayer | 81df6cb | 2019-04-15 11:32:13 +0100 | [diff] [blame] | 4870 | // |
| 4871 | // See https://docs.perfetto.dev/#/heapprofd?id=sampling-interval for more |
| 4872 | // details. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4873 | optional uint64 sampling_interval_bytes = 1; |
| 4874 | |
| 4875 | // E.g. surfaceflinger, com.android.phone |
Florian Mayer | b524cbb | 2019-04-05 18:14:35 +0100 | [diff] [blame] | 4876 | // This input is normalized in the following way: if it contains slashes, |
| 4877 | // everything up to the last slash is discarded. If it contains "@", |
| 4878 | // everything after the first @ is discared. |
| 4879 | // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger. |
| 4880 | // This transformation is also applied to the processes' command lines when |
| 4881 | // matching. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4882 | repeated string process_cmdline = 2; |
Florian Mayer | b524cbb | 2019-04-05 18:14:35 +0100 | [diff] [blame] | 4883 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4884 | // For watermark based triggering or local debugging. |
| 4885 | repeated uint64 pid = 4; |
Florian Mayer | a774cb7 | 2019-04-29 14:20:43 +0100 | [diff] [blame] | 4886 | |
| 4887 | // Profile all processes eligible for profiling on the system. |
| 4888 | // See https://docs.perfetto.dev/#/heapprofd?id=target-processes for which |
| 4889 | // processes are eligible. |
| 4890 | // |
| 4891 | // On unmodified userdebug builds, this will lead to system crashes. Zygote |
| 4892 | // will crash when trying to launch a new process as it will have an |
| 4893 | // unexpected open socket to heapprofd. |
| 4894 | // |
| 4895 | // heapprofd will likely be overloaded by the amount of data for low |
| 4896 | // sampling intervals. |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4897 | optional bool all = 5; |
Florian Mayer | a774cb7 | 2019-04-29 14:20:43 +0100 | [diff] [blame] | 4898 | |
Florian Mayer | 9c6538d | 2019-03-07 14:32:05 +0000 | [diff] [blame] | 4899 | // Do not emit function names for mappings starting with this prefix. |
| 4900 | // E.g. /system to not emit symbols for any system libraries. |
| 4901 | repeated string skip_symbol_prefix = 7; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4902 | |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4903 | // Dump at a predefined interval. |
| 4904 | optional ContinuousDumpConfig continuous_dump_config = 6; |
Florian Mayer | 92e8bf9 | 2019-03-28 13:44:45 +0000 | [diff] [blame] | 4905 | |
| 4906 | // Size of the shared memory buffer between the profiled processes and |
| 4907 | // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500 |
| 4908 | // MiB. |
Florian Mayer | 91b3c6d | 2019-04-10 13:44:37 -0700 | [diff] [blame] | 4909 | // |
| 4910 | // Needs to be: |
| 4911 | // * at least 8192, |
| 4912 | // * a power of two, |
| 4913 | // * a multiple of 4096. |
Florian Mayer | 92e8bf9 | 2019-03-28 13:44:45 +0000 | [diff] [blame] | 4914 | optional uint64 shmem_size_bytes = 8; |
Florian Mayer | d6bdb6f | 2019-05-03 17:53:58 +0100 | [diff] [blame] | 4915 | |
| 4916 | // When the shmem buffer is full, block the client instead of ending the |
| 4917 | // trace. Use with caution as this will significantly slow down the target |
| 4918 | // process. |
| 4919 | optional bool block_client = 9; |
Florian Mayer | 225559a | 2019-05-09 14:28:26 +0100 | [diff] [blame] | 4920 | |
| 4921 | // Do not profile processes from startup, only match already running |
| 4922 | // processes. |
| 4923 | // |
| 4924 | // Can not be set at the same time as no_running. |
| 4925 | optional bool no_startup = 10; |
| 4926 | |
| 4927 | // Do not profile running processes. Only match processes on startup. |
| 4928 | // |
| 4929 | // Can not be set at the same time as no_startup. |
| 4930 | optional bool no_running = 11; |
Florian Mayer | 7142c7c | 2019-05-20 18:11:41 +0100 | [diff] [blame] | 4931 | |
| 4932 | // Gather information on how many bytes of allocations are on non-referenced |
| 4933 | // pages. The way to use this generally is: |
| 4934 | // 1. Start profile of app. |
| 4935 | // 2. Start app. |
Florian Mayer | 4c19b69 | 2019-07-15 16:58:38 +0100 | [diff] [blame] | 4936 | // 3. Trigger a dump by sending SIGUSR1 to heapprofd. |
Florian Mayer | 7142c7c | 2019-05-20 18:11:41 +0100 | [diff] [blame] | 4937 | // 4. Do operations. |
| 4938 | // 5. End profile. |
| 4939 | // |
| 4940 | // You can then find the allocations that were not used for the operations you |
| 4941 | // did in step 4. |
| 4942 | optional bool idle_allocations = 12; |
Florian Mayer | 8707d4d | 2019-07-16 11:17:46 +0100 | [diff] [blame] | 4943 | |
| 4944 | // Cause heapprofd to emit a single dump at the end, showing the memory usage |
| 4945 | // at the point in time when the sampled heap usage of the process was at its |
| 4946 | // maximum. This causes ProfilePacket.HeapSample.self_max to be set, and |
| 4947 | // self_allocated and self_freed to not be set. |
| 4948 | optional bool dump_at_max = 13; |
Isabelle Taylor | 80ec5f7 | 2019-02-27 11:27:41 +0000 | [diff] [blame] | 4949 | } |
| 4950 | |
| 4951 | // End of protos/perfetto/config/profiling/heapprofd_config.proto |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4952 | |
Florian Mayer | 98965ba | 2019-09-13 15:32:36 +0100 | [diff] [blame] | 4953 | // Begin of protos/perfetto/config/profiling/java_hprof_config.proto |
| 4954 | |
| 4955 | // Configuration for go/heapprofd. |
| 4956 | message JavaHprofConfig { |
| 4957 | // If dump_interval_ms != 0, the following configuration is used. |
| 4958 | message ContinuousDumpConfig { |
| 4959 | // ms to wait before first continuous dump. |
| 4960 | // A dump is always created at the beginning of the trace. |
| 4961 | optional uint32 dump_phase_ms = 1; |
| 4962 | // ms to wait between following dumps. |
| 4963 | optional uint32 dump_interval_ms = 2; |
| 4964 | }; |
| 4965 | |
| 4966 | // This input is normalized in the following way: if it contains slashes, |
| 4967 | // everything up to the last slash is discarded. If it contains "@", |
| 4968 | // everything after the first @ is discared. |
| 4969 | // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger. |
| 4970 | // This transformation is also applied to the processes' command lines when |
| 4971 | // matching. |
| 4972 | repeated string process_cmdline = 1; |
| 4973 | |
| 4974 | // For watermark based triggering or local debugging. |
| 4975 | repeated uint64 pid = 2; |
| 4976 | |
| 4977 | // Dump at a predefined interval. |
| 4978 | optional ContinuousDumpConfig continuous_dump_config = 3; |
| 4979 | } |
| 4980 | |
| 4981 | // End of protos/perfetto/config/profiling/java_hprof_config.proto |
| 4982 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4983 | // Begin of protos/perfetto/config/gpu/gpu_counter_config.proto |
| 4984 | |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4985 | message GpuCounterConfig { |
| 4986 | // Desired sampling interval for counters. |
| 4987 | optional uint64 counter_period_ns = 1; |
| 4988 | |
| 4989 | // List of counters to be sampled. Counter IDs correspond to the ones |
| 4990 | // described in GpuCounterSpec in the data source descriptor. |
| 4991 | repeated uint32 counter_ids = 2; |
Raymond Chiu | 3b03967 | 2019-09-06 17:51:40 -0700 | [diff] [blame] | 4992 | |
| 4993 | // Sample counters by instrumenting command buffers. |
| 4994 | optional bool instrumented_sampling = 3; |
| 4995 | |
| 4996 | // Fix gpu clock rate during trace session. |
| 4997 | optional bool fix_gpu_clock = 4; |
Ryan Savitski | 89bd922 | 2019-06-13 14:39:30 +0100 | [diff] [blame] | 4998 | } |
| 4999 | |
| 5000 | // End of protos/perfetto/config/gpu/gpu_counter_config.proto |
Ryan Savitski | fde4ae6 | 2019-06-14 16:02:52 +0100 | [diff] [blame] | 5001 | |
| 5002 | // Begin of protos/perfetto/config/android/packages_list_config.proto |
| 5003 | |
| 5004 | // Data source that lists details (such as version code) about packages on an |
| 5005 | // Android device. |
| 5006 | message PackagesListConfig { |
| 5007 | // If not empty, emit info about only the following list of package names |
| 5008 | // (exact match, no regex). Otherwise, emit info about all packages. |
| 5009 | repeated string package_name_filter = 1; |
| 5010 | } |
| 5011 | |
| 5012 | // End of protos/perfetto/config/android/packages_list_config.proto |