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