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