blob: 431c77e1895679cfd2b56cf31db6d97a27ff4e31 [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
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010041// Begin of protos/perfetto/common/sys_stats_counters.proto
42
43// When editing entries here remember also to update "sys_stats_counters.h" with
44// the corresponding string definitions for the actual /proc files parser.
45
46// Counter definitions for Linux's /proc/meminfo.
47enum MeminfoCounters {
48 MEMINFO_UNSPECIFIED = 0;
49 MEMINFO_MEM_TOTAL = 1;
50 MEMINFO_MEM_FREE = 2;
51 MEMINFO_MEM_AVAILABLE = 3;
52 MEMINFO_BUFFERS = 4;
53 MEMINFO_CACHED = 5;
54 MEMINFO_SWAP_CACHED = 6;
55 MEMINFO_ACTIVE = 7;
56 MEMINFO_INACTIVE = 8;
57 MEMINFO_ACTIVE_ANON = 9;
58 MEMINFO_INACTIVE_ANON = 10;
59 MEMINFO_ACTIVE_FILE = 11;
60 MEMINFO_INACTIVE_FILE = 12;
61 MEMINFO_UNEVICTABLE = 13;
62 MEMINFO_MLOCKED = 14;
63 MEMINFO_SWAP_TOTAL = 15;
64 MEMINFO_SWAP_FREE = 16;
65 MEMINFO_DIRTY = 17;
66 MEMINFO_WRITEBACK = 18;
67 MEMINFO_ANON_PAGES = 19;
68 MEMINFO_MAPPED = 20;
69 MEMINFO_SHMEM = 21;
70 MEMINFO_SLAB = 22;
71 MEMINFO_SLAB_RECLAIMABLE = 23;
72 MEMINFO_SLAB_UNRECLAIMABLE = 24;
73 MEMINFO_KERNEL_STACK = 25;
74 MEMINFO_PAGE_TABLES = 26;
75 MEMINFO_COMMIT_LIMIT = 27;
76 MEMINFO_COMMITED_AS = 28;
77 MEMINFO_VMALLOC_TOTAL = 29;
78 MEMINFO_VMALLOC_USED = 30;
79 MEMINFO_VMALLOC_CHUNK = 31;
80 MEMINFO_CMA_TOTAL = 32;
81 MEMINFO_CMA_FREE = 33;
82}
83
84// Counter definitions for Linux's /proc/vmstat.
85enum VmstatCounters {
86 VMSTAT_UNSPECIFIED = 0;
87 VMSTAT_NR_FREE_PAGES = 1;
88 VMSTAT_NR_ALLOC_BATCH = 2;
89 VMSTAT_NR_INACTIVE_ANON = 3;
90 VMSTAT_NR_ACTIVE_ANON = 4;
91 VMSTAT_NR_INACTIVE_FILE = 5;
92 VMSTAT_NR_ACTIVE_FILE = 6;
93 VMSTAT_NR_UNEVICTABLE = 7;
94 VMSTAT_NR_MLOCK = 8;
95 VMSTAT_NR_ANON_PAGES = 9;
96 VMSTAT_NR_MAPPED = 10;
97 VMSTAT_NR_FILE_PAGES = 11;
98 VMSTAT_NR_DIRTY = 12;
99 VMSTAT_NR_WRITEBACK = 13;
100 VMSTAT_NR_SLAB_RECLAIMABLE = 14;
101 VMSTAT_NR_SLAB_UNRECLAIMABLE = 15;
102 VMSTAT_NR_PAGE_TABLE_PAGES = 16;
103 VMSTAT_NR_KERNEL_STACK = 17;
104 VMSTAT_NR_OVERHEAD = 18;
105 VMSTAT_NR_UNSTABLE = 19;
106 VMSTAT_NR_BOUNCE = 20;
107 VMSTAT_NR_VMSCAN_WRITE = 21;
108 VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22;
109 VMSTAT_NR_WRITEBACK_TEMP = 23;
110 VMSTAT_NR_ISOLATED_ANON = 24;
111 VMSTAT_NR_ISOLATED_FILE = 25;
112 VMSTAT_NR_SHMEM = 26;
113 VMSTAT_NR_DIRTIED = 27;
114 VMSTAT_NR_WRITTEN = 28;
115 VMSTAT_NR_PAGES_SCANNED = 29;
116 VMSTAT_WORKINGSET_REFAULT = 30;
117 VMSTAT_WORKINGSET_ACTIVATE = 31;
118 VMSTAT_WORKINGSET_NODERECLAIM = 32;
119 VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33;
120 VMSTAT_NR_FREE_CMA = 34;
121 VMSTAT_NR_SWAPCACHE = 35;
122 VMSTAT_NR_DIRTY_THRESHOLD = 36;
123 VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37;
124 VMSTAT_PGPGIN = 38;
125 VMSTAT_PGPGOUT = 39;
126 VMSTAT_PGPGOUTCLEAN = 40;
127 VMSTAT_PSWPIN = 41;
128 VMSTAT_PSWPOUT = 42;
129 VMSTAT_PGALLOC_DMA = 43;
130 VMSTAT_PGALLOC_NORMAL = 44;
131 VMSTAT_PGALLOC_MOVABLE = 45;
132 VMSTAT_PGFREE = 46;
133 VMSTAT_PGACTIVATE = 47;
134 VMSTAT_PGDEACTIVATE = 48;
135 VMSTAT_PGFAULT = 49;
136 VMSTAT_PGMAJFAULT = 50;
137 VMSTAT_PGREFILL_DMA = 51;
138 VMSTAT_PGREFILL_NORMAL = 52;
139 VMSTAT_PGREFILL_MOVABLE = 53;
140 VMSTAT_PGSTEAL_KSWAPD_DMA = 54;
141 VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55;
142 VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56;
143 VMSTAT_PGSTEAL_DIRECT_DMA = 57;
144 VMSTAT_PGSTEAL_DIRECT_NORMAL = 58;
145 VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59;
146 VMSTAT_PGSCAN_KSWAPD_DMA = 60;
147 VMSTAT_PGSCAN_KSWAPD_NORMAL = 61;
148 VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62;
149 VMSTAT_PGSCAN_DIRECT_DMA = 63;
150 VMSTAT_PGSCAN_DIRECT_NORMAL = 64;
151 VMSTAT_PGSCAN_DIRECT_MOVABLE = 65;
152 VMSTAT_PGSCAN_DIRECT_THROTTLE = 66;
153 VMSTAT_PGINODESTEAL = 67;
154 VMSTAT_SLABS_SCANNED = 68;
155 VMSTAT_KSWAPD_INODESTEAL = 69;
156 VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70;
157 VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71;
158 VMSTAT_PAGEOUTRUN = 72;
159 VMSTAT_ALLOCSTALL = 73;
160 VMSTAT_PGROTATED = 74;
161 VMSTAT_DROP_PAGECACHE = 75;
162 VMSTAT_DROP_SLAB = 76;
163 VMSTAT_PGMIGRATE_SUCCESS = 77;
164 VMSTAT_PGMIGRATE_FAIL = 78;
165 VMSTAT_COMPACT_MIGRATE_SCANNED = 79;
166 VMSTAT_COMPACT_FREE_SCANNED = 80;
167 VMSTAT_COMPACT_ISOLATED = 81;
168 VMSTAT_COMPACT_STALL = 82;
169 VMSTAT_COMPACT_FAIL = 83;
170 VMSTAT_COMPACT_SUCCESS = 84;
171 VMSTAT_COMPACT_DAEMON_WAKE = 85;
172 VMSTAT_UNEVICTABLE_PGS_CULLED = 86;
173 VMSTAT_UNEVICTABLE_PGS_SCANNED = 87;
174 VMSTAT_UNEVICTABLE_PGS_RESCUED = 88;
175 VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89;
176 VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90;
177 VMSTAT_UNEVICTABLE_PGS_CLEARED = 91;
178 VMSTAT_UNEVICTABLE_PGS_STRANDED = 92;
179}
180// End of protos/perfetto/common/sys_stats_counters.proto
181
Ryan Savitski41ce4592019-05-02 14:43:59 +0100182// Begin of protos/perfetto/common/trace_stats.proto
183
184// Statistics for the internals of the tracing service.
185//
186// Next id: 10.
187message TraceStats {
188 // From TraceBuffer::Stats.
189 //
190 // Next id: 19.
191 message BufferStats {
192 // Size of the circular buffer in bytes.
193 optional uint64 buffer_size = 12;
194
195 // Num. bytes written into the circular buffer, including chunk headers.
196 optional uint64 bytes_written = 1;
197
198 // Num. bytes overwritten before they have been read (i.e. loss of data).
199 optional uint64 bytes_overwritten = 13;
200
201 // Total size of chunks that were fully read from the circular buffer by the
202 // consumer. This may not be equal to |bytes_written| either in the middle
203 // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the
204 // size of the chunks read from the buffer, including chunk headers, which
205 // will be different from the total size of packets returned to the
206 // consumer.
207 //
208 // The current utilization of the trace buffer (mid-tracing) can be obtained
209 // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|,
210 // adding the difference of |padding_bytes_written| and
211 // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|.
212 // Note that this represents the total size of buffered data in the buffer,
213 // yet this data may be spread non-contiguously through the buffer and may
214 // be overridden before the utilization reaches 100%.
215 optional uint64 bytes_read = 14;
216
217 // Num. bytes that were allocated as padding between chunks in the circular
218 // buffer.
219 optional uint64 padding_bytes_written = 15;
220
221 // Num. of padding bytes that were removed from the circular buffer when
222 // they were overwritten.
223 //
224 // The difference between |padding_bytes_written| and
225 // |padding_bytes_cleared| denotes the total size of padding currently
226 // present in the buffer.
227 optional uint64 padding_bytes_cleared = 16;
228
229 // Num. chunks (!= packets) written into the buffer.
230 optional uint64 chunks_written = 2;
231
232 // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote
233 // the same chunk with additional packets appended to the end.
234 optional uint64 chunks_rewritten = 10;
235
236 // Num. chunks overwritten before they have been read (i.e. loss of data).
237 optional uint64 chunks_overwritten = 3;
238
239 // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer
240 // is configured with FillPolicy == DISCARD.
241 optional uint64 chunks_discarded = 18;
242
243 // Num. chunks (!= packets) that were fully read from the circular buffer by
244 // the consumer. This may not be equal to |chunks_written| either in the
245 // middle of tracing, or if |chunks_overwritten| is non-zero.
246 optional uint64 chunks_read = 17;
247
248 // Num. chunks that were committed out of order.
249 optional uint64 chunks_committed_out_of_order = 11;
250
251 // Num. times the ring buffer wrapped around.
252 optional uint64 write_wrap_count = 4;
253
254 // Num. out-of-band (OOB) patches that succeeded.
255 optional uint64 patches_succeeded = 5;
256
257 // Num. OOB patches that failed (e.g., the chunk to patch was gone).
258 optional uint64 patches_failed = 6;
259
260 // Num. readaheads (for large multi-chunk packet reads) that ended up in a
261 // successful packet read.
262 optional uint64 readaheads_succeeded = 7;
263
264 // Num. readaheads aborted because of missing chunks in the sequence stream.
265 // Note that a small number > 0 is totally expected: occasionally, when
266 // issuing a read, the very last packet in a sequence might be incomplete
267 // (because the producer is still writing it while we read). The read will
268 // stop at that point, for that sequence, increasing this counter.
269 optional uint64 readaheads_failed = 8;
270
271 // Num. of violations of the SharedMemoryABI found while writing or reading
272 // the buffer. This is an indication of either a bug in the producer(s) or
273 // malicious producer(s).
274 optional uint64 abi_violations = 9;
275 }
276
277 // Stats for the TraceBuffer(s) of the current trace session.
278 repeated BufferStats buffer_stats = 1;
279
280 // Num. producers connected (whether they are involved in the current tracing
281 // session or not).
282 optional uint32 producers_connected = 2;
283
284 // Num. producers ever seen for all trace sessions since startup (it's a good
285 // proxy for inferring num. producers crashed / killed).
286 optional uint64 producers_seen = 3;
287
288 // Num. data sources registered for all trace sessions.
289 optional uint32 data_sources_registered = 4;
290
291 // Num. data sources ever seen for all trace sessions since startup.
292 optional uint64 data_sources_seen = 5;
293
294 // Num. concurrently active tracing sessions.
295 optional uint32 tracing_sessions = 6;
296
297 // Num. buffers for all tracing session (not just the current one). This will
298 // be >= buffer_stats.size(), because the latter is only about the current
299 // session.
300 optional uint32 total_buffers = 7;
301
302 // The fields below have been introduced in Android Q.
303
304 // Num. chunks that were discarded by the service before attempting to commit
305 // them to a buffer, e.g. because the producer specified an invalid buffer ID.
306 optional uint64 chunks_discarded = 8;
307
308 // Num. patches that were discarded by the service before attempting to apply
309 // them to a buffer, e.g. because the producer specified an invalid buffer ID.
310 optional uint64 patches_discarded = 9;
311}
312
313// End of protos/perfetto/common/trace_stats.proto
314
Primiano Tucci64df2ca2019-01-03 22:26:47 +0000315// Begin of protos/perfetto/trace/android/android_log.proto
316
317message AndroidLogPacket {
318 message LogEvent {
319 // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
320 optional AndroidLogId log_id = 1;
321
322 // PID (TGID), TID and UID of the task that emitted the event.
323 optional int32 pid = 2;
324 optional int32 tid = 3;
325 optional int32 uid = 4;
326
327 // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
328 // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
329 // processor will take care of realigning clocks using the ClockSnapshot(s).
330 optional uint64 timestamp = 5;
331
332 // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
333 // the second column of /system/etc/event-log-tags. For all other events,
334 // |tag| is the app-specified argument passed to __android_log_write().
335 optional string tag = 6;
336
337 // Empty when log_id == LID_EVENTS.
338 optional AndroidLogPriority prio = 7;
339
340 // Empty when log_id == LID_EVENTS.
341 optional string message = 8;
342
343 message Arg {
344 optional string name = 1;
345 oneof value {
346 int64 int_value = 2;
347 float float_value = 3;
348 string string_value = 4;
349 }
350 }
351 // Only populated when log_id == LID_EVENTS.
352 repeated Arg args = 9;
353 }
354
355 repeated LogEvent events = 1;
356
357 // Stats are emitted only upon Flush() and are monotonic (i.e. they are
358 // absolute counters since the beginning of the lifetime of the tracing
359 // session and NOT relative to the previous Stats snapshot).
360 message Stats {
361 // Total number of log events seen, including errors and skipped entries
362 // (num of events stored in the trace = total - failed - skipped).
363 optional uint64 num_total = 1;
364
365 // Parser failures.
366 optional uint64 num_failed = 2;
367
368 // Messages skipped due to filters.
369 optional uint64 num_skipped = 3;
370 }
371 optional Stats stats = 2;
372}
373
374// End of protos/perfetto/trace/android/android_log.proto
375
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100376// Begin of protos/perfetto/trace/android/packages_list.proto
377
378message PackagesList {
Florian Mayere7647412019-04-04 11:00:51 +0100379 message PackageInfo {
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100380 optional string name = 1;
381 optional uint64 uid = 2;
382 optional bool debuggable = 3;
383 optional bool profileable_from_shell = 4;
384 optional int64 version_code = 5;
385 }
386
Florian Mayere7647412019-04-04 11:00:51 +0100387 repeated PackageInfo packages = 1;
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100388
Florian Mayer03918af2019-04-04 10:44:26 +0100389 // At least one error occurred parsing the packages.list.
Florian Mayere7647412019-04-04 11:00:51 +0100390 optional bool parse_error = 2;
391
392 // Failed to open / read packages.list.
393 optional bool read_error = 3;
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100394}
395
396// End of protos/perfetto/trace/android/packages_list.proto
397
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +0100398// Begin of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
399
400// This message is not intended to be written by the chrome on the device.
401// It's emitted on the host by the telemetry benchmark infrastructure (it's a
402// part of the trace that's written by the telemetry tracing agent).
403message ChromeBenchmarkMetadata {
404 // Time when the benchmark execution started (host unixtime in microseconds).
405 optional int64 benchmark_start_time_us = 1;
406
407 // Time when this particular story was run (host unixtime in microseconds).
408 optional int64 story_run_time_us = 2;
409
410 // Name of benchmark.
411 optional string benchmark_name = 3;
412
413 // Description of benchmark.
414 optional string benchmark_description = 4;
415
416 // Optional label.
417 optional string label = 5;
418
419 // Name of story.
420 optional string story_name = 6;
421
422 // List of story tags.
423 repeated string story_tags = 7;
424
425 // Index of the story run (>0 if the same story was run several times).
426 optional int32 story_run_index = 8;
427
428 // Whether this run failed.
429 optional bool had_failures = 9;
430}
431
432// End of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
433
Hector Dearmane92c6742018-11-22 21:42:39 +0000434// Begin of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100435
Hector Dearmane92c6742018-11-22 21:42:39 +0000436// A snapshot of clock readings to allow for trace alignment.
437message ClockSnapshot {
438 message Clock {
439 enum Type {
440 UNKNOWN = 0;
441 REALTIME = 1;
442 REALTIME_COARSE = 2;
443 MONOTONIC = 3;
444 MONOTONIC_COARSE = 4;
445 MONOTONIC_RAW = 5;
446 BOOTTIME = 6;
447 PROCESS_CPUTIME = 7;
448 THREAD_CPUTIME = 8;
449 }
450 optional Type type = 1;
451 optional uint64 timestamp = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100452 }
Hector Dearmane92c6742018-11-22 21:42:39 +0000453 repeated Clock clocks = 1;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100454}
455
Hector Dearmane92c6742018-11-22 21:42:39 +0000456// End of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100457
Florian Mayerbeba7262018-04-17 19:05:43 +0100458// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto
459
460// Represents the mapping between inode numbers in a block device and their path
461// on the filesystem
462message InodeFileMap {
463 // Representation of Entry
464 message Entry {
465 optional uint64 inode_number = 1;
466
467 // The path to the file, e.g. "etc/file.xml"
468 // List of strings for multiple hardlinks
469 repeated string paths = 2;
470
471 // The file type
472 enum Type {
473 UNKNOWN = 0;
474 FILE = 1;
475 DIRECTORY = 2;
476 }
477 optional Type type = 3;
478 }
479
480 optional uint64 block_device_id = 1;
481
482 // The mount points of the block device, e.g. ["system"].
483 repeated string mount_points = 2;
484
485 // The list of all the entries from the block device
486 repeated Entry entries = 3;
487}
488
489// End of protos/perfetto/trace/filesystem/inode_file_map.proto
490
Hector Dearmane0e57802018-11-21 16:09:56 +0000491// Begin of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100492
493message BinderTransactionFtraceEvent {
494 optional int32 debug_id = 1;
495 optional int32 target_node = 2;
496 optional int32 to_proc = 3;
497 optional int32 to_thread = 4;
498 optional int32 reply = 5;
499 optional uint32 code = 6;
500 optional uint32 flags = 7;
501}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100502message BinderTransactionReceivedFtraceEvent {
503 optional int32 debug_id = 1;
504}
Hector Dearmane0e57802018-11-21 16:09:56 +0000505message BinderSetPriorityFtraceEvent {
506 optional int32 proc = 1;
507 optional int32 thread = 2;
508 optional uint32 old_prio = 3;
509 optional uint32 new_prio = 4;
510 optional uint32 desired_prio = 5;
511}
512message BinderLockFtraceEvent {
513 optional string tag = 1;
514}
515message BinderLockedFtraceEvent {
516 optional string tag = 1;
517}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100518message BinderUnlockFtraceEvent {
519 optional string tag = 1;
520}
Hector Dearmane0e57802018-11-21 16:09:56 +0000521message BinderTransactionAllocBufFtraceEvent {
522 optional uint64 data_size = 1;
523 optional int32 debug_id = 2;
524 optional uint64 offsets_size = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100525}
526
Hector Dearmane0e57802018-11-21 16:09:56 +0000527// End of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100528
Hector Dearmane0e57802018-11-21 16:09:56 +0000529// Begin of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100530
531message BlockRqIssueFtraceEvent {
532 optional uint64 dev = 1;
533 optional uint64 sector = 2;
534 optional uint32 nr_sector = 3;
535 optional uint32 bytes = 4;
536 optional string rwbs = 5;
537 optional string comm = 6;
538 optional string cmd = 7;
539}
Hector Dearmane0e57802018-11-21 16:09:56 +0000540message BlockBioBackmergeFtraceEvent {
541 optional uint64 dev = 1;
542 optional uint64 sector = 2;
543 optional uint32 nr_sector = 3;
544 optional string rwbs = 4;
545 optional string comm = 5;
546}
547message BlockBioBounceFtraceEvent {
548 optional uint64 dev = 1;
549 optional uint64 sector = 2;
550 optional uint32 nr_sector = 3;
551 optional string rwbs = 4;
552 optional string comm = 5;
553}
554message BlockBioCompleteFtraceEvent {
555 optional uint64 dev = 1;
556 optional uint64 sector = 2;
557 optional uint32 nr_sector = 3;
558 optional int32 error = 4;
559 optional string rwbs = 5;
560}
561message BlockBioFrontmergeFtraceEvent {
562 optional uint64 dev = 1;
563 optional uint64 sector = 2;
564 optional uint32 nr_sector = 3;
565 optional string rwbs = 4;
566 optional string comm = 5;
567}
568message BlockBioQueueFtraceEvent {
569 optional uint64 dev = 1;
570 optional uint64 sector = 2;
571 optional uint32 nr_sector = 3;
572 optional string rwbs = 4;
573 optional string comm = 5;
574}
575message BlockBioRemapFtraceEvent {
576 optional uint64 dev = 1;
577 optional uint64 sector = 2;
578 optional uint32 nr_sector = 3;
579 optional uint64 old_dev = 4;
580 optional uint64 old_sector = 5;
581 optional string rwbs = 6;
582}
583message BlockDirtyBufferFtraceEvent {
584 optional uint64 dev = 1;
585 optional uint64 sector = 2;
586 optional uint64 size = 3;
587}
588message BlockGetrqFtraceEvent {
589 optional uint64 dev = 1;
590 optional uint64 sector = 2;
591 optional uint32 nr_sector = 3;
592 optional string rwbs = 4;
593 optional string comm = 5;
594}
595message BlockPlugFtraceEvent {
596 optional string comm = 1;
597}
598message BlockRqAbortFtraceEvent {
599 optional uint64 dev = 1;
600 optional uint64 sector = 2;
601 optional uint32 nr_sector = 3;
602 optional int32 errors = 4;
603 optional string rwbs = 5;
604 optional string cmd = 6;
605}
606message BlockRqCompleteFtraceEvent {
607 optional uint64 dev = 1;
608 optional uint64 sector = 2;
609 optional uint32 nr_sector = 3;
610 optional int32 errors = 4;
611 optional string rwbs = 5;
612 optional string cmd = 6;
613}
614message BlockRqInsertFtraceEvent {
615 optional uint64 dev = 1;
616 optional uint64 sector = 2;
617 optional uint32 nr_sector = 3;
618 optional uint32 bytes = 4;
619 optional string rwbs = 5;
620 optional string comm = 6;
621 optional string cmd = 7;
622}
623message BlockRqRemapFtraceEvent {
624 optional uint64 dev = 1;
625 optional uint64 sector = 2;
626 optional uint32 nr_sector = 3;
627 optional uint64 old_dev = 4;
628 optional uint64 old_sector = 5;
629 optional uint32 nr_bios = 6;
630 optional string rwbs = 7;
631}
632message BlockRqRequeueFtraceEvent {
633 optional uint64 dev = 1;
634 optional uint64 sector = 2;
635 optional uint32 nr_sector = 3;
636 optional int32 errors = 4;
637 optional string rwbs = 5;
638 optional string cmd = 6;
639}
640message BlockSleeprqFtraceEvent {
641 optional uint64 dev = 1;
642 optional uint64 sector = 2;
643 optional uint32 nr_sector = 3;
644 optional string rwbs = 4;
645 optional string comm = 5;
646}
647message BlockSplitFtraceEvent {
648 optional uint64 dev = 1;
649 optional uint64 sector = 2;
650 optional uint64 new_sector = 3;
651 optional string rwbs = 4;
652 optional string comm = 5;
653}
654message BlockTouchBufferFtraceEvent {
655 optional uint64 dev = 1;
656 optional uint64 sector = 2;
657 optional uint64 size = 3;
658}
659message BlockUnplugFtraceEvent {
660 optional int32 nr_rq = 1;
661 optional string comm = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100662}
663
Hector Dearmane0e57802018-11-21 16:09:56 +0000664// End of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100665
Hector Dearmane0e57802018-11-21 16:09:56 +0000666// Begin of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100667
Hector Dearmane0e57802018-11-21 16:09:56 +0000668message ClkEnableFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +0100669 optional string name = 1;
Hector Dearmane0e57802018-11-21 16:09:56 +0000670}
671message ClkDisableFtraceEvent {
672 optional string name = 1;
673}
674message ClkSetRateFtraceEvent {
675 optional string name = 1;
676 optional uint64 rate = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100677}
678
Hector Dearmane0e57802018-11-21 16:09:56 +0000679// End of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100680
Hector Dearmane0e57802018-11-21 16:09:56 +0000681// Begin of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100682
683message Ext4DaWriteBeginFtraceEvent {
684 optional uint64 dev = 1;
685 optional uint64 ino = 2;
686 optional int64 pos = 3;
687 optional uint32 len = 4;
688 optional uint32 flags = 5;
689}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100690message Ext4DaWriteEndFtraceEvent {
691 optional uint64 dev = 1;
692 optional uint64 ino = 2;
693 optional int64 pos = 3;
694 optional uint32 len = 4;
695 optional uint32 copied = 5;
696}
Hector Dearmane0e57802018-11-21 16:09:56 +0000697message Ext4SyncFileEnterFtraceEvent {
698 optional uint64 dev = 1;
699 optional uint64 ino = 2;
700 optional uint64 parent = 3;
701 optional int32 datasync = 4;
702}
703message Ext4SyncFileExitFtraceEvent {
704 optional uint64 dev = 1;
705 optional uint64 ino = 2;
706 optional int32 ret = 3;
707}
708message Ext4AllocDaBlocksFtraceEvent {
709 optional uint64 dev = 1;
710 optional uint64 ino = 2;
711 optional uint32 data_blocks = 3;
712 optional uint32 meta_blocks = 4;
713}
714message Ext4AllocateBlocksFtraceEvent {
715 optional uint64 dev = 1;
716 optional uint64 ino = 2;
717 optional uint64 block = 3;
718 optional uint32 len = 4;
719 optional uint32 logical = 5;
720 optional uint32 lleft = 6;
721 optional uint32 lright = 7;
722 optional uint64 goal = 8;
723 optional uint64 pleft = 9;
724 optional uint64 pright = 10;
725 optional uint32 flags = 11;
726}
727message Ext4AllocateInodeFtraceEvent {
728 optional uint64 dev = 1;
729 optional uint64 ino = 2;
730 optional uint64 dir = 3;
731 optional uint32 mode = 4;
732}
733message Ext4BeginOrderedTruncateFtraceEvent {
734 optional uint64 dev = 1;
735 optional uint64 ino = 2;
736 optional int64 new_size = 3;
737}
738message Ext4CollapseRangeFtraceEvent {
739 optional uint64 dev = 1;
740 optional uint64 ino = 2;
741 optional int64 offset = 3;
742 optional int64 len = 4;
743}
744message Ext4DaReleaseSpaceFtraceEvent {
745 optional uint64 dev = 1;
746 optional uint64 ino = 2;
747 optional uint64 i_blocks = 3;
748 optional int32 freed_blocks = 4;
749 optional int32 reserved_data_blocks = 5;
750 optional int32 reserved_meta_blocks = 6;
751 optional int32 allocated_meta_blocks = 7;
752 optional uint32 mode = 8;
753}
754message Ext4DaReserveSpaceFtraceEvent {
755 optional uint64 dev = 1;
756 optional uint64 ino = 2;
757 optional uint64 i_blocks = 3;
758 optional int32 reserved_data_blocks = 4;
759 optional int32 reserved_meta_blocks = 5;
760 optional uint32 mode = 6;
761 optional int32 md_needed = 7;
762}
763message Ext4DaUpdateReserveSpaceFtraceEvent {
764 optional uint64 dev = 1;
765 optional uint64 ino = 2;
766 optional uint64 i_blocks = 3;
767 optional int32 used_blocks = 4;
768 optional int32 reserved_data_blocks = 5;
769 optional int32 reserved_meta_blocks = 6;
770 optional int32 allocated_meta_blocks = 7;
771 optional int32 quota_claim = 8;
772 optional uint32 mode = 9;
773}
774message Ext4DaWritePagesFtraceEvent {
775 optional uint64 dev = 1;
776 optional uint64 ino = 2;
777 optional uint64 first_page = 3;
778 optional int64 nr_to_write = 4;
779 optional int32 sync_mode = 5;
780 optional uint64 b_blocknr = 6;
781 optional uint32 b_size = 7;
782 optional uint32 b_state = 8;
783 optional int32 io_done = 9;
784 optional int32 pages_written = 10;
785}
786message Ext4DaWritePagesExtentFtraceEvent {
787 optional uint64 dev = 1;
788 optional uint64 ino = 2;
789 optional uint64 lblk = 3;
790 optional uint32 len = 4;
791 optional uint32 flags = 5;
792}
793message Ext4DirectIOEnterFtraceEvent {
794 optional uint64 dev = 1;
795 optional uint64 ino = 2;
796 optional int64 pos = 3;
797 optional uint64 len = 4;
798 optional int32 rw = 5;
799}
800message Ext4DirectIOExitFtraceEvent {
801 optional uint64 dev = 1;
802 optional uint64 ino = 2;
803 optional int64 pos = 3;
804 optional uint64 len = 4;
805 optional int32 rw = 5;
806 optional int32 ret = 6;
807}
808message Ext4DiscardBlocksFtraceEvent {
809 optional uint64 dev = 1;
810 optional uint64 blk = 2;
811 optional uint64 count = 3;
812}
813message Ext4DiscardPreallocationsFtraceEvent {
814 optional uint64 dev = 1;
815 optional uint64 ino = 2;
816}
817message Ext4DropInodeFtraceEvent {
818 optional uint64 dev = 1;
819 optional uint64 ino = 2;
820 optional int32 drop = 3;
821}
822message Ext4EsCacheExtentFtraceEvent {
823 optional uint64 dev = 1;
824 optional uint64 ino = 2;
825 optional uint32 lblk = 3;
826 optional uint32 len = 4;
827 optional uint64 pblk = 5;
828 optional uint32 status = 6;
829}
830message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
831 optional uint64 dev = 1;
832 optional uint64 ino = 2;
833 optional uint32 lblk = 3;
834}
835message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
836 optional uint64 dev = 1;
837 optional uint64 ino = 2;
838 optional uint32 lblk = 3;
839 optional uint32 len = 4;
840 optional uint64 pblk = 5;
841 optional uint64 status = 6;
842}
843message Ext4EsInsertExtentFtraceEvent {
844 optional uint64 dev = 1;
845 optional uint64 ino = 2;
846 optional uint32 lblk = 3;
847 optional uint32 len = 4;
848 optional uint64 pblk = 5;
849 optional uint64 status = 6;
850}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100851message Ext4EsLookupExtentEnterFtraceEvent {
852 optional uint64 dev = 1;
853 optional uint64 ino = 2;
854 optional uint32 lblk = 3;
855}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100856message Ext4EsLookupExtentExitFtraceEvent {
857 optional uint64 dev = 1;
858 optional uint64 ino = 2;
859 optional uint32 lblk = 3;
860 optional uint32 len = 4;
861 optional uint64 pblk = 5;
Florian Mayer7c9e3b22018-04-26 11:55:15 +0100862 optional uint64 status = 6;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100863 optional int32 found = 7;
864}
Hector Dearmane0e57802018-11-21 16:09:56 +0000865message Ext4EsRemoveExtentFtraceEvent {
866 optional uint64 dev = 1;
867 optional uint64 ino = 2;
868 optional int64 lblk = 3;
869 optional int64 len = 4;
870}
871message Ext4EsShrinkFtraceEvent {
872 optional uint64 dev = 1;
873 optional int32 nr_shrunk = 2;
874 optional uint64 scan_time = 3;
875 optional int32 nr_skipped = 4;
876 optional int32 retried = 5;
877}
878message Ext4EsShrinkCountFtraceEvent {
879 optional uint64 dev = 1;
880 optional int32 nr_to_scan = 2;
881 optional int32 cache_cnt = 3;
882}
883message Ext4EsShrinkScanEnterFtraceEvent {
884 optional uint64 dev = 1;
885 optional int32 nr_to_scan = 2;
886 optional int32 cache_cnt = 3;
887}
888message Ext4EsShrinkScanExitFtraceEvent {
889 optional uint64 dev = 1;
890 optional int32 nr_shrunk = 2;
891 optional int32 cache_cnt = 3;
892}
893message Ext4EvictInodeFtraceEvent {
894 optional uint64 dev = 1;
895 optional uint64 ino = 2;
896 optional int32 nlink = 3;
897}
898message Ext4ExtConvertToInitializedEnterFtraceEvent {
899 optional uint64 dev = 1;
900 optional uint64 ino = 2;
901 optional uint32 m_lblk = 3;
902 optional uint32 m_len = 4;
903 optional uint32 u_lblk = 5;
904 optional uint32 u_len = 6;
905 optional uint64 u_pblk = 7;
906}
907message Ext4ExtConvertToInitializedFastpathFtraceEvent {
908 optional uint64 dev = 1;
909 optional uint64 ino = 2;
910 optional uint32 m_lblk = 3;
911 optional uint32 m_len = 4;
912 optional uint32 u_lblk = 5;
913 optional uint32 u_len = 6;
914 optional uint64 u_pblk = 7;
915 optional uint32 i_lblk = 8;
916 optional uint32 i_len = 9;
917 optional uint64 i_pblk = 10;
918}
919message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
920 optional uint64 dev = 1;
921 optional uint64 ino = 2;
922 optional int32 flags = 3;
923 optional uint32 lblk = 4;
924 optional uint64 pblk = 5;
925 optional uint32 len = 6;
926 optional uint32 allocated = 7;
927 optional uint64 newblk = 8;
928}
929message Ext4ExtInCacheFtraceEvent {
930 optional uint64 dev = 1;
931 optional uint64 ino = 2;
932 optional uint32 lblk = 3;
933 optional int32 ret = 4;
934}
935message Ext4ExtLoadExtentFtraceEvent {
936 optional uint64 dev = 1;
937 optional uint64 ino = 2;
938 optional uint64 pblk = 3;
939 optional uint32 lblk = 4;
940}
941message Ext4ExtMapBlocksEnterFtraceEvent {
942 optional uint64 dev = 1;
943 optional uint64 ino = 2;
944 optional uint32 lblk = 3;
945 optional uint32 len = 4;
946 optional uint32 flags = 5;
947}
948message Ext4ExtMapBlocksExitFtraceEvent {
949 optional uint64 dev = 1;
950 optional uint64 ino = 2;
951 optional uint32 flags = 3;
952 optional uint64 pblk = 4;
953 optional uint32 lblk = 5;
954 optional uint32 len = 6;
955 optional uint32 mflags = 7;
956 optional int32 ret = 8;
957}
958message Ext4ExtPutInCacheFtraceEvent {
959 optional uint64 dev = 1;
960 optional uint64 ino = 2;
961 optional uint32 lblk = 3;
962 optional uint32 len = 4;
963 optional uint64 start = 5;
964}
965message Ext4ExtRemoveSpaceFtraceEvent {
966 optional uint64 dev = 1;
967 optional uint64 ino = 2;
968 optional uint32 start = 3;
969 optional uint32 end = 4;
970 optional int32 depth = 5;
971}
972message Ext4ExtRemoveSpaceDoneFtraceEvent {
973 optional uint64 dev = 1;
974 optional uint64 ino = 2;
975 optional uint32 start = 3;
976 optional uint32 end = 4;
977 optional int32 depth = 5;
978 optional int64 partial = 6;
979 optional uint32 eh_entries = 7;
980}
981message Ext4ExtRmIdxFtraceEvent {
982 optional uint64 dev = 1;
983 optional uint64 ino = 2;
984 optional uint64 pblk = 3;
985}
986message Ext4ExtRmLeafFtraceEvent {
987 optional uint64 dev = 1;
988 optional uint64 ino = 2;
989 optional int64 partial = 3;
990 optional uint32 start = 4;
991 optional uint32 ee_lblk = 5;
992 optional uint64 ee_pblk = 6;
993 optional int32 ee_len = 7;
994}
995message Ext4ExtShowExtentFtraceEvent {
996 optional uint64 dev = 1;
997 optional uint64 ino = 2;
998 optional uint64 pblk = 3;
999 optional uint32 lblk = 4;
1000 optional uint32 len = 5;
1001}
1002message Ext4FallocateEnterFtraceEvent {
1003 optional uint64 dev = 1;
1004 optional uint64 ino = 2;
1005 optional int64 offset = 3;
1006 optional int64 len = 4;
1007 optional int32 mode = 5;
1008 optional int64 pos = 6;
1009}
1010message Ext4FallocateExitFtraceEvent {
1011 optional uint64 dev = 1;
1012 optional uint64 ino = 2;
1013 optional int64 pos = 3;
1014 optional uint32 blocks = 4;
1015 optional int32 ret = 5;
1016}
1017message Ext4FindDelallocRangeFtraceEvent {
1018 optional uint64 dev = 1;
1019 optional uint64 ino = 2;
1020 optional uint32 from = 3;
1021 optional uint32 to = 4;
1022 optional int32 reverse = 5;
1023 optional int32 found = 6;
1024 optional uint32 found_blk = 7;
1025}
1026message Ext4ForgetFtraceEvent {
1027 optional uint64 dev = 1;
1028 optional uint64 ino = 2;
1029 optional uint64 block = 3;
1030 optional int32 is_metadata = 4;
1031 optional uint32 mode = 5;
1032}
1033message Ext4FreeBlocksFtraceEvent {
1034 optional uint64 dev = 1;
1035 optional uint64 ino = 2;
1036 optional uint64 block = 3;
1037 optional uint64 count = 4;
1038 optional int32 flags = 5;
1039 optional uint32 mode = 6;
1040}
1041message Ext4FreeInodeFtraceEvent {
1042 optional uint64 dev = 1;
1043 optional uint64 ino = 2;
1044 optional uint32 uid = 3;
1045 optional uint32 gid = 4;
1046 optional uint64 blocks = 5;
1047 optional uint32 mode = 6;
1048}
1049message Ext4GetImpliedClusterAllocExitFtraceEvent {
1050 optional uint64 dev = 1;
1051 optional uint32 flags = 2;
1052 optional uint32 lblk = 3;
1053 optional uint64 pblk = 4;
1054 optional uint32 len = 5;
1055 optional int32 ret = 6;
1056}
1057message Ext4GetReservedClusterAllocFtraceEvent {
1058 optional uint64 dev = 1;
1059 optional uint64 ino = 2;
1060 optional uint32 lblk = 3;
1061 optional uint32 len = 4;
1062}
1063message Ext4IndMapBlocksEnterFtraceEvent {
1064 optional uint64 dev = 1;
1065 optional uint64 ino = 2;
1066 optional uint32 lblk = 3;
1067 optional uint32 len = 4;
1068 optional uint32 flags = 5;
1069}
1070message Ext4IndMapBlocksExitFtraceEvent {
1071 optional uint64 dev = 1;
1072 optional uint64 ino = 2;
1073 optional uint32 flags = 3;
1074 optional uint64 pblk = 4;
1075 optional uint32 lblk = 5;
1076 optional uint32 len = 6;
1077 optional uint32 mflags = 7;
1078 optional int32 ret = 8;
1079}
1080message Ext4InsertRangeFtraceEvent {
1081 optional uint64 dev = 1;
1082 optional uint64 ino = 2;
1083 optional int64 offset = 3;
1084 optional int64 len = 4;
1085}
1086message Ext4InvalidatepageFtraceEvent {
1087 optional uint64 dev = 1;
1088 optional uint64 ino = 2;
1089 optional uint64 index = 3;
1090 optional uint64 offset = 4;
1091 optional uint32 length = 5;
1092}
1093message Ext4JournalStartFtraceEvent {
1094 optional uint64 dev = 1;
1095 optional uint64 ip = 2;
1096 optional int32 blocks = 3;
1097 optional int32 rsv_blocks = 4;
1098 optional int32 nblocks = 5;
1099}
1100message Ext4JournalStartReservedFtraceEvent {
1101 optional uint64 dev = 1;
1102 optional uint64 ip = 2;
1103 optional int32 blocks = 3;
1104}
1105message Ext4JournalledInvalidatepageFtraceEvent {
1106 optional uint64 dev = 1;
1107 optional uint64 ino = 2;
1108 optional uint64 index = 3;
1109 optional uint64 offset = 4;
1110 optional uint32 length = 5;
1111}
1112message Ext4JournalledWriteEndFtraceEvent {
1113 optional uint64 dev = 1;
1114 optional uint64 ino = 2;
1115 optional int64 pos = 3;
1116 optional uint32 len = 4;
1117 optional uint32 copied = 5;
1118}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001119message Ext4LoadInodeFtraceEvent {
1120 optional uint64 dev = 1;
1121 optional uint64 ino = 2;
1122}
Hector Dearmane0e57802018-11-21 16:09:56 +00001123message Ext4LoadInodeBitmapFtraceEvent {
1124 optional uint64 dev = 1;
1125 optional uint32 group = 2;
1126}
1127message Ext4MarkInodeDirtyFtraceEvent {
1128 optional uint64 dev = 1;
1129 optional uint64 ino = 2;
1130 optional uint64 ip = 3;
1131}
1132message Ext4MbBitmapLoadFtraceEvent {
1133 optional uint64 dev = 1;
1134 optional uint32 group = 2;
1135}
1136message Ext4MbBuddyBitmapLoadFtraceEvent {
1137 optional uint64 dev = 1;
1138 optional uint32 group = 2;
1139}
1140message Ext4MbDiscardPreallocationsFtraceEvent {
1141 optional uint64 dev = 1;
1142 optional int32 needed = 2;
1143}
1144message Ext4MbNewGroupPaFtraceEvent {
1145 optional uint64 dev = 1;
1146 optional uint64 ino = 2;
1147 optional uint64 pa_pstart = 3;
1148 optional uint64 pa_lstart = 4;
1149 optional uint32 pa_len = 5;
1150}
1151message Ext4MbNewInodePaFtraceEvent {
1152 optional uint64 dev = 1;
1153 optional uint64 ino = 2;
1154 optional uint64 pa_pstart = 3;
1155 optional uint64 pa_lstart = 4;
1156 optional uint32 pa_len = 5;
1157}
1158message Ext4MbReleaseGroupPaFtraceEvent {
1159 optional uint64 dev = 1;
1160 optional uint64 pa_pstart = 2;
1161 optional uint32 pa_len = 3;
1162}
1163message Ext4MbReleaseInodePaFtraceEvent {
1164 optional uint64 dev = 1;
1165 optional uint64 ino = 2;
1166 optional uint64 block = 3;
1167 optional uint32 count = 4;
1168}
1169message Ext4MballocAllocFtraceEvent {
1170 optional uint64 dev = 1;
1171 optional uint64 ino = 2;
1172 optional uint32 orig_logical = 3;
1173 optional int32 orig_start = 4;
1174 optional uint32 orig_group = 5;
1175 optional int32 orig_len = 6;
1176 optional uint32 goal_logical = 7;
1177 optional int32 goal_start = 8;
1178 optional uint32 goal_group = 9;
1179 optional int32 goal_len = 10;
1180 optional uint32 result_logical = 11;
1181 optional int32 result_start = 12;
1182 optional uint32 result_group = 13;
1183 optional int32 result_len = 14;
1184 optional uint32 found = 15;
1185 optional uint32 groups = 16;
1186 optional uint32 buddy = 17;
1187 optional uint32 flags = 18;
1188 optional uint32 tail = 19;
1189 optional uint32 cr = 20;
1190}
1191message Ext4MballocDiscardFtraceEvent {
1192 optional uint64 dev = 1;
1193 optional uint64 ino = 2;
1194 optional int32 result_start = 3;
1195 optional uint32 result_group = 4;
1196 optional int32 result_len = 5;
1197}
1198message Ext4MballocFreeFtraceEvent {
1199 optional uint64 dev = 1;
1200 optional uint64 ino = 2;
1201 optional int32 result_start = 3;
1202 optional uint32 result_group = 4;
1203 optional int32 result_len = 5;
1204}
1205message Ext4MballocPreallocFtraceEvent {
1206 optional uint64 dev = 1;
1207 optional uint64 ino = 2;
1208 optional uint32 orig_logical = 3;
1209 optional int32 orig_start = 4;
1210 optional uint32 orig_group = 5;
1211 optional int32 orig_len = 6;
1212 optional uint32 result_logical = 7;
1213 optional int32 result_start = 8;
1214 optional uint32 result_group = 9;
1215 optional int32 result_len = 10;
1216}
1217message Ext4OtherInodeUpdateTimeFtraceEvent {
1218 optional uint64 dev = 1;
1219 optional uint64 ino = 2;
1220 optional uint64 orig_ino = 3;
1221 optional uint32 uid = 4;
1222 optional uint32 gid = 5;
1223 optional uint32 mode = 6;
1224}
1225message Ext4PunchHoleFtraceEvent {
1226 optional uint64 dev = 1;
1227 optional uint64 ino = 2;
1228 optional int64 offset = 3;
1229 optional int64 len = 4;
1230 optional int32 mode = 5;
1231}
1232message Ext4ReadBlockBitmapLoadFtraceEvent {
1233 optional uint64 dev = 1;
1234 optional uint32 group = 2;
1235}
1236message Ext4ReadpageFtraceEvent {
1237 optional uint64 dev = 1;
1238 optional uint64 ino = 2;
1239 optional uint64 index = 3;
1240}
1241message Ext4ReleasepageFtraceEvent {
1242 optional uint64 dev = 1;
1243 optional uint64 ino = 2;
1244 optional uint64 index = 3;
1245}
1246message Ext4RemoveBlocksFtraceEvent {
1247 optional uint64 dev = 1;
1248 optional uint64 ino = 2;
1249 optional uint32 from = 3;
1250 optional uint32 to = 4;
1251 optional int64 partial = 5;
1252 optional uint64 ee_pblk = 6;
1253 optional uint32 ee_lblk = 7;
1254 optional uint32 ee_len = 8;
1255}
1256message Ext4RequestBlocksFtraceEvent {
1257 optional uint64 dev = 1;
1258 optional uint64 ino = 2;
1259 optional uint32 len = 3;
1260 optional uint32 logical = 4;
1261 optional uint32 lleft = 5;
1262 optional uint32 lright = 6;
1263 optional uint64 goal = 7;
1264 optional uint64 pleft = 8;
1265 optional uint64 pright = 9;
1266 optional uint32 flags = 10;
1267}
1268message Ext4RequestInodeFtraceEvent {
1269 optional uint64 dev = 1;
1270 optional uint64 dir = 2;
1271 optional uint32 mode = 3;
1272}
1273message Ext4SyncFsFtraceEvent {
1274 optional uint64 dev = 1;
1275 optional int32 wait = 2;
1276}
1277message Ext4TrimAllFreeFtraceEvent {
1278 optional int32 dev_major = 1;
1279 optional int32 dev_minor = 2;
1280 optional uint32 group = 3;
1281 optional int32 start = 4;
1282 optional int32 len = 5;
1283}
1284message Ext4TrimExtentFtraceEvent {
1285 optional int32 dev_major = 1;
1286 optional int32 dev_minor = 2;
1287 optional uint32 group = 3;
1288 optional int32 start = 4;
1289 optional int32 len = 5;
1290}
1291message Ext4TruncateEnterFtraceEvent {
1292 optional uint64 dev = 1;
1293 optional uint64 ino = 2;
1294 optional uint64 blocks = 3;
1295}
1296message Ext4TruncateExitFtraceEvent {
1297 optional uint64 dev = 1;
1298 optional uint64 ino = 2;
1299 optional uint64 blocks = 3;
1300}
1301message Ext4UnlinkEnterFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001302 optional uint64 dev = 1;
1303 optional uint64 ino = 2;
1304 optional uint64 parent = 3;
Hector Dearmane0e57802018-11-21 16:09:56 +00001305 optional int64 size = 4;
Hector Dearman55ef3e02018-04-11 17:28:55 +01001306}
Hector Dearmane0e57802018-11-21 16:09:56 +00001307message Ext4UnlinkExitFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001308 optional uint64 dev = 1;
1309 optional uint64 ino = 2;
1310 optional int32 ret = 3;
1311}
Hector Dearmane0e57802018-11-21 16:09:56 +00001312message Ext4WriteBeginFtraceEvent {
1313 optional uint64 dev = 1;
1314 optional uint64 ino = 2;
1315 optional int64 pos = 3;
1316 optional uint32 len = 4;
1317 optional uint32 flags = 5;
1318}
1319message Ext4WriteEndFtraceEvent {
1320 optional uint64 dev = 1;
1321 optional uint64 ino = 2;
1322 optional int64 pos = 3;
1323 optional uint32 len = 4;
1324 optional uint32 copied = 5;
1325}
1326message Ext4WritepageFtraceEvent {
1327 optional uint64 dev = 1;
1328 optional uint64 ino = 2;
1329 optional uint64 index = 3;
1330}
1331message Ext4WritepagesFtraceEvent {
1332 optional uint64 dev = 1;
1333 optional uint64 ino = 2;
1334 optional int64 nr_to_write = 3;
1335 optional int64 pages_skipped = 4;
1336 optional int64 range_start = 5;
1337 optional int64 range_end = 6;
1338 optional uint64 writeback_index = 7;
1339 optional int32 sync_mode = 8;
1340 optional uint32 for_kupdate = 9;
1341 optional uint32 range_cyclic = 10;
1342}
1343message Ext4WritepagesResultFtraceEvent {
1344 optional uint64 dev = 1;
1345 optional uint64 ino = 2;
1346 optional int32 ret = 3;
1347 optional int32 pages_written = 4;
1348 optional int64 pages_skipped = 5;
1349 optional uint64 writeback_index = 6;
1350 optional int32 sync_mode = 7;
1351}
1352message Ext4ZeroRangeFtraceEvent {
1353 optional uint64 dev = 1;
1354 optional uint64 ino = 2;
1355 optional int64 offset = 3;
1356 optional int64 len = 4;
1357 optional int32 mode = 5;
1358}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001359
Hector Dearmane0e57802018-11-21 16:09:56 +00001360// End of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001361
Hector Dearmane0e57802018-11-21 16:09:56 +00001362// Begin of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001363
Hector Dearmane0e57802018-11-21 16:09:56 +00001364message F2fsDoSubmitBioFtraceEvent {
1365 optional uint64 dev = 1;
1366 optional int32 btype = 2;
1367 optional uint32 sync = 3;
1368 optional uint64 sector = 4;
1369 optional uint32 size = 5;
1370}
1371message F2fsEvictInodeFtraceEvent {
1372 optional uint64 dev = 1;
1373 optional uint64 ino = 2;
1374 optional uint64 pino = 3;
1375 optional uint32 mode = 4;
1376 optional int64 size = 5;
1377 optional uint32 nlink = 6;
1378 optional uint64 blocks = 7;
1379 optional uint32 advise = 8;
1380}
1381message F2fsFallocateFtraceEvent {
1382 optional uint64 dev = 1;
1383 optional uint64 ino = 2;
1384 optional int32 mode = 3;
1385 optional int64 offset = 4;
1386 optional int64 len = 5;
1387 optional int64 size = 6;
1388 optional uint64 blocks = 7;
1389 optional int32 ret = 8;
1390}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001391message F2fsGetDataBlockFtraceEvent {
1392 optional uint64 dev = 1;
1393 optional uint64 ino = 2;
1394 optional uint64 iblock = 3;
1395 optional uint64 bh_start = 4;
1396 optional uint64 bh_size = 5;
1397 optional int32 ret = 6;
1398}
Hector Dearmane0e57802018-11-21 16:09:56 +00001399message F2fsGetVictimFtraceEvent {
1400 optional uint64 dev = 1;
1401 optional int32 type = 2;
1402 optional int32 gc_type = 3;
1403 optional int32 alloc_mode = 4;
1404 optional int32 gc_mode = 5;
1405 optional uint32 victim = 6;
1406 optional uint32 ofs_unit = 7;
1407 optional uint32 pre_victim = 8;
1408 optional uint32 prefree = 9;
1409 optional uint32 free = 10;
1410}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001411message F2fsIgetFtraceEvent {
1412 optional uint64 dev = 1;
1413 optional uint64 ino = 2;
1414 optional uint64 pino = 3;
1415 optional uint32 mode = 4;
1416 optional int64 size = 5;
1417 optional uint32 nlink = 6;
1418 optional uint64 blocks = 7;
1419 optional uint32 advise = 8;
1420}
Hector Dearmane0e57802018-11-21 16:09:56 +00001421message F2fsIgetExitFtraceEvent {
1422 optional uint64 dev = 1;
1423 optional uint64 ino = 2;
1424 optional int32 ret = 3;
1425}
1426message F2fsNewInodeFtraceEvent {
1427 optional uint64 dev = 1;
1428 optional uint64 ino = 2;
1429 optional int32 ret = 3;
1430}
1431message F2fsReadpageFtraceEvent {
1432 optional uint64 dev = 1;
1433 optional uint64 ino = 2;
1434 optional uint64 index = 3;
1435 optional uint64 blkaddr = 4;
1436 optional int32 type = 5;
1437}
1438message F2fsReserveNewBlockFtraceEvent {
1439 optional uint64 dev = 1;
1440 optional uint32 nid = 2;
1441 optional uint32 ofs_in_node = 3;
1442}
1443message F2fsSetPageDirtyFtraceEvent {
1444 optional uint64 dev = 1;
1445 optional uint64 ino = 2;
1446 optional int32 type = 3;
1447 optional int32 dir = 4;
1448 optional uint64 index = 5;
1449 optional int32 dirty = 6;
1450}
1451message F2fsSubmitWritePageFtraceEvent {
1452 optional uint64 dev = 1;
1453 optional uint64 ino = 2;
1454 optional int32 type = 3;
1455 optional uint64 index = 4;
1456 optional uint32 block = 5;
1457}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001458message F2fsSyncFileEnterFtraceEvent {
1459 optional uint64 dev = 1;
1460 optional uint64 ino = 2;
1461 optional uint64 pino = 3;
1462 optional uint32 mode = 4;
1463 optional int64 size = 5;
1464 optional uint32 nlink = 6;
1465 optional uint64 blocks = 7;
1466 optional uint32 advise = 8;
1467}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001468message F2fsSyncFileExitFtraceEvent {
1469 optional uint64 dev = 1;
1470 optional uint64 ino = 2;
1471 optional uint32 need_cp = 3;
1472 optional int32 datasync = 4;
1473 optional int32 ret = 5;
1474}
Hector Dearmane0e57802018-11-21 16:09:56 +00001475message F2fsSyncFsFtraceEvent {
1476 optional uint64 dev = 1;
1477 optional int32 dirty = 2;
1478 optional int32 wait = 3;
1479}
1480message F2fsTruncateFtraceEvent {
1481 optional uint64 dev = 1;
1482 optional uint64 ino = 2;
1483 optional uint64 pino = 3;
1484 optional uint32 mode = 4;
1485 optional int64 size = 5;
1486 optional uint32 nlink = 6;
1487 optional uint64 blocks = 7;
1488 optional uint32 advise = 8;
1489}
1490message F2fsTruncateBlocksEnterFtraceEvent {
1491 optional uint64 dev = 1;
1492 optional uint64 ino = 2;
1493 optional int64 size = 3;
1494 optional uint64 blocks = 4;
1495 optional uint64 from = 5;
1496}
1497message F2fsTruncateBlocksExitFtraceEvent {
1498 optional uint64 dev = 1;
1499 optional uint64 ino = 2;
1500 optional int32 ret = 3;
1501}
1502message F2fsTruncateDataBlocksRangeFtraceEvent {
1503 optional uint64 dev = 1;
1504 optional uint64 ino = 2;
1505 optional uint32 nid = 3;
1506 optional uint32 ofs = 4;
1507 optional int32 free = 5;
1508}
1509message F2fsTruncateInodeBlocksEnterFtraceEvent {
1510 optional uint64 dev = 1;
1511 optional uint64 ino = 2;
1512 optional int64 size = 3;
1513 optional uint64 blocks = 4;
1514 optional uint64 from = 5;
1515}
1516message F2fsTruncateInodeBlocksExitFtraceEvent {
1517 optional uint64 dev = 1;
1518 optional uint64 ino = 2;
1519 optional int32 ret = 3;
1520}
1521message F2fsTruncateNodeFtraceEvent {
1522 optional uint64 dev = 1;
1523 optional uint64 ino = 2;
1524 optional uint32 nid = 3;
1525 optional uint32 blk_addr = 4;
1526}
1527message F2fsTruncateNodesEnterFtraceEvent {
1528 optional uint64 dev = 1;
1529 optional uint64 ino = 2;
1530 optional uint32 nid = 3;
1531 optional uint32 blk_addr = 4;
1532}
1533message F2fsTruncateNodesExitFtraceEvent {
1534 optional uint64 dev = 1;
1535 optional uint64 ino = 2;
1536 optional int32 ret = 3;
1537}
1538message F2fsTruncatePartialNodesFtraceEvent {
1539 optional uint64 dev = 1;
1540 optional uint64 ino = 2;
1541 optional uint32 nid = 3;
1542 optional int32 depth = 4;
1543 optional int32 err = 5;
1544}
1545message F2fsUnlinkEnterFtraceEvent {
1546 optional uint64 dev = 1;
1547 optional uint64 ino = 2;
1548 optional int64 size = 3;
1549 optional uint64 blocks = 4;
1550 optional string name = 5;
1551}
1552message F2fsUnlinkExitFtraceEvent {
1553 optional uint64 dev = 1;
1554 optional uint64 ino = 2;
1555 optional int32 ret = 3;
1556}
1557message F2fsVmPageMkwriteFtraceEvent {
1558 optional uint64 dev = 1;
1559 optional uint64 ino = 2;
1560 optional int32 type = 3;
1561 optional int32 dir = 4;
1562 optional uint64 index = 5;
1563 optional int32 dirty = 6;
1564}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001565message F2fsWriteBeginFtraceEvent {
1566 optional uint64 dev = 1;
1567 optional uint64 ino = 2;
1568 optional int64 pos = 3;
1569 optional uint32 len = 4;
1570 optional uint32 flags = 5;
1571}
Hector Dearmane0e57802018-11-21 16:09:56 +00001572message F2fsWriteCheckpointFtraceEvent {
1573 optional uint64 dev = 1;
1574 optional uint32 is_umount = 2;
1575 optional string msg = 3;
1576}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001577message F2fsWriteEndFtraceEvent {
1578 optional uint64 dev = 1;
1579 optional uint64 ino = 2;
1580 optional int64 pos = 3;
1581 optional uint32 len = 4;
1582 optional uint32 copied = 5;
1583}
1584
Hector Dearmane0e57802018-11-21 16:09:56 +00001585// End of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001586
Hector Dearmane0e57802018-11-21 16:09:56 +00001587// Begin of protos/perfetto/trace/ftrace/filemap.proto
1588
1589message MmFilemapAddToPageCacheFtraceEvent {
1590 optional uint64 pfn = 1;
1591 optional uint64 i_ino = 2;
1592 optional uint64 index = 3;
1593 optional uint64 s_dev = 4;
1594 optional uint64 page = 5;
1595}
1596message MmFilemapDeleteFromPageCacheFtraceEvent {
1597 optional uint64 pfn = 1;
1598 optional uint64 i_ino = 2;
1599 optional uint64 index = 3;
1600 optional uint64 s_dev = 4;
1601 optional uint64 page = 5;
1602}
1603
1604// End of protos/perfetto/trace/ftrace/filemap.proto
1605
1606// Begin of protos/perfetto/trace/ftrace/ftrace.proto
1607
1608message PrintFtraceEvent {
1609 optional uint64 ip = 1;
1610 optional string buf = 2;
1611}
1612
1613// End of protos/perfetto/trace/ftrace/ftrace.proto
1614
1615// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto
1616
1617message FtraceEvent {
1618 // Nanoseconds since an epoch.
1619 // Epoch is configurable by writing into trace_clock.
1620 // By default this timestamp is CPU local.
1621 // TODO: Figure out a story for reconciling the various clocks.
1622 optional uint64 timestamp = 1;
1623
1624 // Kernel pid (do not confuse with userspace pid aka tgid)
1625 optional uint32 pid = 2;
1626
1627 oneof event {
1628 PrintFtraceEvent print = 3;
1629 SchedSwitchFtraceEvent sched_switch = 4;
1630 // removed field with id 5;
1631 // removed field with id 6;
1632 // removed field with id 7;
1633 // removed field with id 8;
1634 // removed field with id 9;
1635 // removed field with id 10;
1636 CpuFrequencyFtraceEvent cpu_frequency = 11;
1637 CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
1638 CpuIdleFtraceEvent cpu_idle = 13;
1639 ClockEnableFtraceEvent clock_enable = 14;
1640 ClockDisableFtraceEvent clock_disable = 15;
1641 ClockSetRateFtraceEvent clock_set_rate = 16;
1642 SchedWakeupFtraceEvent sched_wakeup = 17;
1643 SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
1644 SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
1645 SchedWakingFtraceEvent sched_waking = 20;
1646 // removed field with id 21
1647 // removed field with id 22
1648 // removed field with id 23
1649 // removed field with id 24
1650 // removed field with id 25
1651 // removed field with id 26
1652 // removed field with id 27
1653 // removed field with id 28
1654 // removed field with id 29
1655 // removed field with id 30
1656 // removed field with id 31
1657 // removed field with id 32
1658 // removed field with id 33
1659 // removed field with id 34
1660 LowmemoryKillFtraceEvent lowmemory_kill = 35;
1661 // removed field with id 36
1662 // removed field with id 37
1663 // removed field with id 38
1664 // removed field with id 39
1665 // removed field with id 40
1666 Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
1667 Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
1668 Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
1669 Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
1670 BlockRqIssueFtraceEvent block_rq_issue = 45;
1671 MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
1672 MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
1673 MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
1674 MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
1675 BinderTransactionFtraceEvent binder_transaction = 50;
1676 BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
1677 BinderSetPriorityFtraceEvent binder_set_priority = 52;
1678 BinderLockFtraceEvent binder_lock = 53;
1679 BinderLockedFtraceEvent binder_locked = 54;
1680 BinderUnlockFtraceEvent binder_unlock = 55;
1681 // removed field with id 56
1682 // removed field with id 57
1683 // removed field with id 58
1684 // removed field with id 59
1685 // removed field with id 60
1686 // removed field with id 61
1687 // removed field with id 62
1688 // removed field with id 63
1689 // removed field with id 64
1690 // removed field with id 65
1691 // removed field with id 66
1692 // removed field with id 67
1693 // removed field with id 68
1694 // removed field with id 69
1695 // removed field with id 70
1696 // removed field with id 71
1697 // removed field with id 72
1698 // removed field with id 73
1699 // removed field with id 74
1700 // removed field with id 75
1701 // removed field with id 76
1702 // removed field with id 77
1703 // removed field with id 78
1704 // removed field with id 79
1705 // removed field with id 80
1706 // removed field with id 81
1707 // removed field with id 82
1708 // removed field with id 83
1709 // removed field with id 84
1710 // removed field with id 85
1711 // removed field with id 86
1712 // removed field with id 87
1713 // removed field with id 88
1714 // removed field with id 89
1715 // removed field with id 90
1716 // removed field with id 91
1717 // removed field with id 92
1718 // removed field with id 93
1719 // removed field with id 94
1720 // removed field with id 95
1721 // removed field with id 96
1722 MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
1723 MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
1724 98;
1725 // removed field with id 99
1726 // removed field with id 100
1727 // removed field with id 101
1728 // removed field with id 102
1729 // removed field with id 103
1730 // removed field with id 104
1731 // removed field with id 105
1732 // removed field with id 106
1733 // removed field with id 107
1734 // removed field with id 108
1735 // removed field with id 109
1736 // removed field with id 110
1737 // removed field with id 111
1738 // removed field with id 112
1739 SuspendResumeFtraceEvent suspend_resume = 113;
1740 SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
1741 BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
1742 BlockBioBounceFtraceEvent block_bio_bounce = 116;
1743 BlockBioCompleteFtraceEvent block_bio_complete = 117;
1744 BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
1745 BlockBioQueueFtraceEvent block_bio_queue = 119;
1746 BlockBioRemapFtraceEvent block_bio_remap = 120;
1747 BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
1748 BlockGetrqFtraceEvent block_getrq = 122;
1749 BlockPlugFtraceEvent block_plug = 123;
1750 BlockRqAbortFtraceEvent block_rq_abort = 124;
1751 BlockRqCompleteFtraceEvent block_rq_complete = 125;
1752 BlockRqInsertFtraceEvent block_rq_insert = 126;
1753 // removed field with id 127;
1754 BlockRqRemapFtraceEvent block_rq_remap = 128;
1755 BlockRqRequeueFtraceEvent block_rq_requeue = 129;
1756 BlockSleeprqFtraceEvent block_sleeprq = 130;
1757 BlockSplitFtraceEvent block_split = 131;
1758 BlockTouchBufferFtraceEvent block_touch_buffer = 132;
1759 BlockUnplugFtraceEvent block_unplug = 133;
1760 Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
1761 Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
1762 Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
1763 Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
1764 Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
1765 Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
1766 Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
1767 Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
1768 Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
1769 Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
1770 Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
1771 Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
1772 Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
1773 Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
1774 Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
1775 Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
1776 Ext4EsFindDelayedExtentRangeEnterFtraceEvent
1777 ext4_es_find_delayed_extent_range_enter = 150;
1778 Ext4EsFindDelayedExtentRangeExitFtraceEvent
1779 ext4_es_find_delayed_extent_range_exit = 151;
1780 Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
1781 Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
1782 Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
1783 Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
1784 Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
1785 Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
1786 Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
1787 Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
1788 Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
1789 Ext4ExtConvertToInitializedEnterFtraceEvent
1790 ext4_ext_convert_to_initialized_enter = 161;
1791 Ext4ExtConvertToInitializedFastpathFtraceEvent
1792 ext4_ext_convert_to_initialized_fastpath = 162;
1793 Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
1794 163;
1795 Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
1796 Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
1797 Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
1798 Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
1799 Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
1800 Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
1801 Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
1802 Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
1803 Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
1804 Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
1805 Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
1806 Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
1807 Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
1808 Ext4ForgetFtraceEvent ext4_forget = 177;
1809 Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
1810 Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
1811 Ext4GetImpliedClusterAllocExitFtraceEvent
1812 ext4_get_implied_cluster_alloc_exit = 180;
1813 Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
1814 181;
1815 Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
1816 Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
1817 Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
1818 Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
1819 Ext4JournalStartFtraceEvent ext4_journal_start = 186;
1820 Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
1821 Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
1822 188;
1823 Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
1824 Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
1825 Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
1826 Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
1827 Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
1828 Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
1829 Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
1830 Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
1831 Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
1832 Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
1833 Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
1834 Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
1835 Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
1836 Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
1837 Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
1838 Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
1839 Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
1840 Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
1841 Ext4ReadpageFtraceEvent ext4_readpage = 207;
1842 Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
1843 Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
1844 Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
1845 Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
1846 Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
1847 Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
1848 Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
1849 Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
1850 Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
1851 Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
1852 Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
1853 Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
1854 // removed field with id 220;
1855 // removed field with id 221;
1856 // removed field with id 222;
1857 // removed field with id 223;
1858 // removed field with id 224;
1859 // removed field with id 225;
1860 // removed field with id 226;
1861 // removed field with id 227;
1862 // removed field with id 228;
1863 // removed field with id 229;
1864 Ext4WriteEndFtraceEvent ext4_write_end = 230;
1865 Ext4WritepageFtraceEvent ext4_writepage = 231;
1866 Ext4WritepagesFtraceEvent ext4_writepages = 232;
1867 Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
1868 Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
1869 TaskNewtaskFtraceEvent task_newtask = 235;
1870 TaskRenameFtraceEvent task_rename = 236;
1871 SchedProcessExecFtraceEvent sched_process_exec = 237;
1872 SchedProcessExitFtraceEvent sched_process_exit = 238;
1873 SchedProcessForkFtraceEvent sched_process_fork = 239;
1874 SchedProcessFreeFtraceEvent sched_process_free = 240;
1875 SchedProcessHangFtraceEvent sched_process_hang = 241;
1876 SchedProcessWaitFtraceEvent sched_process_wait = 242;
1877 F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
1878 F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
1879 F2fsFallocateFtraceEvent f2fs_fallocate = 245;
1880 F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
1881 F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
1882 F2fsIgetFtraceEvent f2fs_iget = 248;
1883 F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
1884 F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
1885 F2fsReadpageFtraceEvent f2fs_readpage = 251;
1886 F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
1887 F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
1888 F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
1889 F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
1890 F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
1891 F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
1892 F2fsTruncateFtraceEvent f2fs_truncate = 258;
1893 F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
1894 F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
1895 F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
1896 261;
1897 F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
1898 262;
1899 F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
1900 263;
1901 F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
1902 F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
1903 F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
1904 F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
1905 F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
1906 F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
1907 F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
1908 F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
1909 F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
1910 F2fsWriteEndFtraceEvent f2fs_write_end = 273;
1911 AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
1912 AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
1913 AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
1914 AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
1915 AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
1916 AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
1917 DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
1918 IommuMapRangeFtraceEvent iommu_map_range = 281;
1919 IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
1920 IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
1921 IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
1922 IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
1923 IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
1924 IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
1925 IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
1926 IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
1927 IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
1928 IonPrefetchingFtraceEvent ion_prefetching = 291;
1929 IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
1930 IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
1931 293;
1932 IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
1933 IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
1934 IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
1935 IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
1936 297;
1937 KfreeFtraceEvent kfree = 298;
1938 KmallocFtraceEvent kmalloc = 299;
1939 KmallocNodeFtraceEvent kmalloc_node = 300;
1940 KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
1941 KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
1942 KmemCacheFreeFtraceEvent kmem_cache_free = 303;
1943 MigratePagesEndFtraceEvent migrate_pages_end = 304;
1944 MigratePagesStartFtraceEvent migrate_pages_start = 305;
1945 MigrateRetryFtraceEvent migrate_retry = 306;
1946 MmPageAllocFtraceEvent mm_page_alloc = 307;
1947 MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
1948 MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
1949 MmPageFreeFtraceEvent mm_page_free = 310;
1950 MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
1951 MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
1952 RssStatFtraceEvent rss_stat = 313;
1953 IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
1954 IonHeapGrowFtraceEvent ion_heap_grow = 315;
1955 // removed field with id 316
1956 // removed field with id 317
1957 // removed field with id 318
1958 // removed field with id 319
1959 ClkEnableFtraceEvent clk_enable = 320;
1960 ClkDisableFtraceEvent clk_disable = 321;
1961 ClkSetRateFtraceEvent clk_set_rate = 322;
1962 BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
1963 SignalDeliverFtraceEvent signal_deliver = 324;
1964 SignalGenerateFtraceEvent signal_generate = 325;
1965 // removed field with id 326
Isabelle Taylor98e560d2018-11-22 11:59:12 +00001966 GenericFtraceEvent generic = 327;
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00001967 MmEventRecordFtraceEvent mm_event_record = 328;
Lalit Magantia73a7252019-01-25 10:32:40 +00001968 SysEnterFtraceEvent sys_enter = 329;
1969 SysExitFtraceEvent sys_exit = 330;
Hector Dearmane0e57802018-11-21 16:09:56 +00001970 }
1971}
1972
1973// End of protos/perfetto/trace/ftrace/ftrace_event.proto
1974
1975// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
1976
1977message FtraceEventBundle {
1978 optional uint32 cpu = 1;
1979 repeated FtraceEvent event = 2;
1980 // Total of all overwrite fields from the headers of all kernel
1981 // ftrace pages we parsed into this FtraceEventBundle. Zero if
1982 // no overwriting occurred, a number larger than zero if some overwriting
1983 // occurred.
1984 optional uint32 overwrite_count = 3;
1985}
1986
1987// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
1988
1989// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto
1990
1991// Per-CPU stats for the ftrace data source gathered from the kernel from
1992// /sys/kernel/debug/tracing/per_cpu/cpuX/stats.
1993message FtraceCpuStats {
1994 // CPU index.
1995 optional uint64 cpu = 1;
1996
1997 // Number of entries still in the kernel buffer. Ideally this should be close
1998 // to zero, as events are consumed regularly and moved into the userspace
1999 // buffers (or file).
2000 optional uint64 entries = 2;
2001
2002 // Number of events lost in kernel buffers due to overwriting of old events
2003 // before userspace had a chance to drain them.
2004 optional uint64 overrun = 3;
2005
2006 // This should always be zero. If not the buffer size is way too small or
2007 // something went wrong with the tracer.
2008 optional uint64 commit_overrun = 4;
2009
2010 // Bytes actually read (not overwritten).
2011 optional uint64 bytes_read = 5;
2012
2013 // The timestamp for the oldest event still in the ring buffer.
2014 optional double oldest_event_ts = 6;
2015
2016 // The current timestamp.
2017 optional double now_ts = 7;
2018
2019 // If the kernel buffer has overwrite mode disabled, this will show the number
2020 // of new events that were lost because the buffer was full. This is similar
2021 // to |overrun| but only for the overwrite=false case.
2022 optional uint64 dropped_events = 8;
2023
2024 // The number of events read.
2025 optional uint64 read_events = 9;
2026}
2027
2028// Ftrace stats for all CPUs.
2029message FtraceStats {
2030 enum Phase {
2031 UNSPECIFIED = 0;
2032 START_OF_TRACE = 1;
2033 END_OF_TRACE = 2;
2034 }
2035
2036 // Tells when stats were sampled. There should be one sample at the beginning
2037 // of the trace and one sample at the end.
2038 optional Phase phase = 1;
2039
2040 // Per-CPU stats (one entry for each CPU).
2041 repeated FtraceCpuStats cpu_stats = 2;
2042}
2043
2044// End of protos/perfetto/trace/ftrace/ftrace_stats.proto
2045
Hector Dearmane92c6742018-11-22 21:42:39 +00002046// Begin of protos/perfetto/trace/ftrace/generic.proto
2047
2048// This generic proto is used to output events in the trace
2049// when a specific proto for that event does not exist.
2050message GenericFtraceEvent {
2051 message Field {
2052 optional string name = 1;
2053 oneof value {
2054 string str_value = 3;
2055 int64 int_value = 4;
2056 uint64 uint_value = 5;
2057 }
2058 }
2059
2060 optional string event_name = 1;
2061 repeated Field field = 2;
2062}
2063
2064// End of protos/perfetto/trace/ftrace/generic.proto
2065
Hector Dearmane0e57802018-11-21 16:09:56 +00002066// Begin of protos/perfetto/trace/ftrace/kmem.proto
2067
2068message AllocPagesIommuEndFtraceEvent {
2069 optional uint32 gfp_flags = 1;
2070 optional uint32 order = 2;
2071}
2072message AllocPagesIommuFailFtraceEvent {
2073 optional uint32 gfp_flags = 1;
2074 optional uint32 order = 2;
2075}
2076message AllocPagesIommuStartFtraceEvent {
2077 optional uint32 gfp_flags = 1;
2078 optional uint32 order = 2;
2079}
2080message AllocPagesSysEndFtraceEvent {
2081 optional uint32 gfp_flags = 1;
2082 optional uint32 order = 2;
2083}
2084message AllocPagesSysFailFtraceEvent {
2085 optional uint32 gfp_flags = 1;
2086 optional uint32 order = 2;
2087}
2088message AllocPagesSysStartFtraceEvent {
2089 optional uint32 gfp_flags = 1;
2090 optional uint32 order = 2;
2091}
2092message DmaAllocContiguousRetryFtraceEvent {
2093 optional int32 tries = 1;
2094}
2095message IommuMapRangeFtraceEvent {
2096 optional uint64 chunk_size = 1;
2097 optional uint64 len = 2;
2098 optional uint64 pa = 3;
2099 optional uint64 va = 4;
2100}
2101message IommuSecPtblMapRangeEndFtraceEvent {
2102 optional uint64 len = 1;
2103 optional int32 num = 2;
2104 optional uint32 pa = 3;
2105 optional int32 sec_id = 4;
2106 optional uint64 va = 5;
2107}
2108message IommuSecPtblMapRangeStartFtraceEvent {
2109 optional uint64 len = 1;
2110 optional int32 num = 2;
2111 optional uint32 pa = 3;
2112 optional int32 sec_id = 4;
2113 optional uint64 va = 5;
2114}
2115message IonAllocBufferEndFtraceEvent {
2116 optional string client_name = 1;
2117 optional uint32 flags = 2;
2118 optional string heap_name = 3;
2119 optional uint64 len = 4;
2120 optional uint32 mask = 5;
2121}
2122message IonAllocBufferFailFtraceEvent {
2123 optional string client_name = 1;
2124 optional int64 error = 2;
2125 optional uint32 flags = 3;
2126 optional string heap_name = 4;
2127 optional uint64 len = 5;
2128 optional uint32 mask = 6;
2129}
2130message IonAllocBufferFallbackFtraceEvent {
2131 optional string client_name = 1;
2132 optional int64 error = 2;
2133 optional uint32 flags = 3;
2134 optional string heap_name = 4;
2135 optional uint64 len = 5;
2136 optional uint32 mask = 6;
2137}
2138message IonAllocBufferStartFtraceEvent {
2139 optional string client_name = 1;
2140 optional uint32 flags = 2;
2141 optional string heap_name = 3;
2142 optional uint64 len = 4;
2143 optional uint32 mask = 5;
2144}
2145message IonCpAllocRetryFtraceEvent {
2146 optional int32 tries = 1;
2147}
2148message IonCpSecureBufferEndFtraceEvent {
2149 optional uint64 align = 1;
2150 optional uint64 flags = 2;
2151 optional string heap_name = 3;
2152 optional uint64 len = 4;
2153}
2154message IonCpSecureBufferStartFtraceEvent {
2155 optional uint64 align = 1;
2156 optional uint64 flags = 2;
2157 optional string heap_name = 3;
2158 optional uint64 len = 4;
2159}
2160message IonPrefetchingFtraceEvent {
2161 optional uint64 len = 1;
2162}
2163message IonSecureCmaAddToPoolEndFtraceEvent {
2164 optional uint32 is_prefetch = 1;
2165 optional uint64 len = 2;
2166 optional int32 pool_total = 3;
2167}
2168message IonSecureCmaAddToPoolStartFtraceEvent {
2169 optional uint32 is_prefetch = 1;
2170 optional uint64 len = 2;
2171 optional int32 pool_total = 3;
2172}
2173message IonSecureCmaAllocateEndFtraceEvent {
2174 optional uint64 align = 1;
2175 optional uint64 flags = 2;
2176 optional string heap_name = 3;
2177 optional uint64 len = 4;
2178}
2179message IonSecureCmaAllocateStartFtraceEvent {
2180 optional uint64 align = 1;
2181 optional uint64 flags = 2;
2182 optional string heap_name = 3;
2183 optional uint64 len = 4;
2184}
2185message IonSecureCmaShrinkPoolEndFtraceEvent {
2186 optional uint64 drained_size = 1;
2187 optional uint64 skipped_size = 2;
2188}
2189message IonSecureCmaShrinkPoolStartFtraceEvent {
2190 optional uint64 drained_size = 1;
2191 optional uint64 skipped_size = 2;
2192}
2193message KfreeFtraceEvent {
2194 optional uint64 call_site = 1;
2195 optional uint64 ptr = 2;
2196}
2197message KmallocFtraceEvent {
2198 optional uint64 bytes_alloc = 1;
2199 optional uint64 bytes_req = 2;
2200 optional uint64 call_site = 3;
2201 optional uint32 gfp_flags = 4;
2202 optional uint64 ptr = 5;
2203}
2204message KmallocNodeFtraceEvent {
2205 optional uint64 bytes_alloc = 1;
2206 optional uint64 bytes_req = 2;
2207 optional uint64 call_site = 3;
2208 optional uint32 gfp_flags = 4;
2209 optional int32 node = 5;
2210 optional uint64 ptr = 6;
2211}
2212message KmemCacheAllocFtraceEvent {
2213 optional uint64 bytes_alloc = 1;
2214 optional uint64 bytes_req = 2;
2215 optional uint64 call_site = 3;
2216 optional uint32 gfp_flags = 4;
2217 optional uint64 ptr = 5;
2218}
2219message KmemCacheAllocNodeFtraceEvent {
2220 optional uint64 bytes_alloc = 1;
2221 optional uint64 bytes_req = 2;
2222 optional uint64 call_site = 3;
2223 optional uint32 gfp_flags = 4;
2224 optional int32 node = 5;
2225 optional uint64 ptr = 6;
2226}
2227message KmemCacheFreeFtraceEvent {
2228 optional uint64 call_site = 1;
2229 optional uint64 ptr = 2;
2230}
2231message MigratePagesEndFtraceEvent {
2232 optional int32 mode = 1;
2233}
2234message MigratePagesStartFtraceEvent {
2235 optional int32 mode = 1;
2236}
2237message MigrateRetryFtraceEvent {
2238 optional int32 tries = 1;
2239}
2240message MmPageAllocFtraceEvent {
2241 optional uint32 gfp_flags = 1;
2242 optional int32 migratetype = 2;
2243 optional uint32 order = 3;
2244 optional uint64 page = 4;
2245 optional uint64 pfn = 5;
2246}
2247message MmPageAllocExtfragFtraceEvent {
2248 optional int32 alloc_migratetype = 1;
2249 optional int32 alloc_order = 2;
2250 optional int32 fallback_migratetype = 3;
2251 optional int32 fallback_order = 4;
2252 optional uint64 page = 5;
2253 optional int32 change_ownership = 6;
2254 optional uint64 pfn = 7;
2255}
2256message MmPageAllocZoneLockedFtraceEvent {
2257 optional int32 migratetype = 1;
2258 optional uint32 order = 2;
2259 optional uint64 page = 3;
2260 optional uint64 pfn = 4;
2261}
2262message MmPageFreeFtraceEvent {
2263 optional uint32 order = 1;
2264 optional uint64 page = 2;
2265 optional uint64 pfn = 3;
2266}
2267message MmPageFreeBatchedFtraceEvent {
2268 optional int32 cold = 1;
2269 optional uint64 page = 2;
2270 optional uint64 pfn = 3;
2271}
2272message MmPagePcpuDrainFtraceEvent {
2273 optional int32 migratetype = 1;
2274 optional uint32 order = 2;
2275 optional uint64 page = 3;
2276 optional uint64 pfn = 4;
2277}
2278message RssStatFtraceEvent {
2279 optional int32 member = 1;
2280 optional int64 size = 2;
2281}
2282message IonHeapShrinkFtraceEvent {
2283 optional string heap_name = 1;
2284 optional uint64 len = 2;
2285 optional int64 total_allocated = 3;
2286}
2287message IonHeapGrowFtraceEvent {
2288 optional string heap_name = 1;
2289 optional uint64 len = 2;
2290 optional int64 total_allocated = 3;
2291}
2292
2293// End of protos/perfetto/trace/ftrace/kmem.proto
2294
2295// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002296
2297message LowmemoryKillFtraceEvent {
2298 optional string comm = 1;
2299 optional int32 pid = 2;
2300 optional int64 pagecache_size = 3;
2301 optional int64 pagecache_limit = 4;
2302 optional int64 free = 5;
2303}
2304
Hector Dearmane0e57802018-11-21 16:09:56 +00002305// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002306
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00002307// Begin of protos/perfetto/trace/ftrace/mm_event.proto
2308
2309message MmEventRecordFtraceEvent {
2310 optional uint32 avg_lat = 1;
2311 optional uint32 count = 2;
2312 optional uint32 max_lat = 3;
2313 optional uint32 type = 4;
2314}
2315
2316// End of protos/perfetto/trace/ftrace/mm_event.proto
2317
Hector Dearmane0e57802018-11-21 16:09:56 +00002318// Begin of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002319
Hector Dearmane0e57802018-11-21 16:09:56 +00002320message CpuFrequencyFtraceEvent {
2321 optional uint32 state = 1;
2322 optional uint32 cpu_id = 2;
2323}
2324message CpuFrequencyLimitsFtraceEvent {
2325 optional uint32 min_freq = 1;
2326 optional uint32 max_freq = 2;
2327 optional uint32 cpu_id = 3;
2328}
2329message CpuIdleFtraceEvent {
2330 optional uint32 state = 1;
2331 optional uint32 cpu_id = 2;
2332}
2333message ClockEnableFtraceEvent {
2334 optional string name = 1;
2335 optional uint64 state = 2;
2336 optional uint64 cpu_id = 3;
2337}
2338message ClockDisableFtraceEvent {
2339 optional string name = 1;
2340 optional uint64 state = 2;
2341 optional uint64 cpu_id = 3;
2342}
2343message ClockSetRateFtraceEvent {
2344 optional string name = 1;
2345 optional uint64 state = 2;
2346 optional uint64 cpu_id = 3;
2347}
2348message SuspendResumeFtraceEvent {
2349 optional string action = 1;
2350 optional int32 val = 2;
2351 optional uint32 start = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +01002352}
2353
Hector Dearmane0e57802018-11-21 16:09:56 +00002354// End of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002355
Lalit Magantia73a7252019-01-25 10:32:40 +00002356// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto
2357
2358message SysEnterFtraceEvent {
2359 optional int64 id = 1;
2360}
2361message SysExitFtraceEvent {
2362 optional int64 id = 1;
2363 optional int64 ret = 2;
2364}
2365
2366// End of protos/perfetto/trace/ftrace/raw_syscalls.proto
2367
Hector Dearmane0e57802018-11-21 16:09:56 +00002368// Begin of protos/perfetto/trace/ftrace/sched.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002369
2370message SchedSwitchFtraceEvent {
2371 optional string prev_comm = 1;
2372 optional int32 prev_pid = 2;
2373 optional int32 prev_prio = 3;
2374 optional int64 prev_state = 4;
2375 optional string next_comm = 5;
2376 optional int32 next_pid = 6;
2377 optional int32 next_prio = 7;
2378}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002379message SchedWakeupFtraceEvent {
2380 optional string comm = 1;
2381 optional int32 pid = 2;
2382 optional int32 prio = 3;
2383 optional int32 success = 4;
2384 optional int32 target_cpu = 5;
2385}
Hector Dearmane0e57802018-11-21 16:09:56 +00002386message SchedBlockedReasonFtraceEvent {
2387 optional int32 pid = 1;
2388 optional uint64 caller = 2;
2389 optional uint32 io_wait = 3;
2390}
2391message SchedCpuHotplugFtraceEvent {
2392 optional int32 affected_cpu = 1;
2393 optional int32 error = 2;
2394 optional int32 status = 3;
2395}
2396message SchedWakingFtraceEvent {
2397 optional string comm = 1;
2398 optional int32 pid = 2;
2399 optional int32 prio = 3;
2400 optional int32 success = 4;
2401 optional int32 target_cpu = 5;
2402}
2403message SchedWakeupNewFtraceEvent {
2404 optional string comm = 1;
2405 optional int32 pid = 2;
2406 optional int32 prio = 3;
2407 optional int32 success = 4;
2408 optional int32 target_cpu = 5;
2409}
2410message SchedProcessExecFtraceEvent {
2411 optional string filename = 1;
2412 optional int32 pid = 2;
2413 optional int32 old_pid = 3;
2414}
2415message SchedProcessExitFtraceEvent {
2416 optional string comm = 1;
2417 optional int32 pid = 2;
2418 optional int32 tgid = 3;
2419 optional int32 prio = 4;
2420}
2421message SchedProcessForkFtraceEvent {
2422 optional string parent_comm = 1;
2423 optional int32 parent_pid = 2;
2424 optional string child_comm = 3;
2425 optional int32 child_pid = 4;
2426}
2427message SchedProcessFreeFtraceEvent {
2428 optional string comm = 1;
2429 optional int32 pid = 2;
2430 optional int32 prio = 3;
2431}
2432message SchedProcessHangFtraceEvent {
2433 optional string comm = 1;
2434 optional int32 pid = 2;
2435}
2436message SchedProcessWaitFtraceEvent {
2437 optional string comm = 1;
2438 optional int32 pid = 2;
2439 optional int32 prio = 3;
2440}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002441
Hector Dearmane0e57802018-11-21 16:09:56 +00002442// End of protos/perfetto/trace/ftrace/sched.proto
2443
2444// Begin of protos/perfetto/trace/ftrace/signal.proto
2445
2446message SignalDeliverFtraceEvent {
2447 optional int32 code = 1;
2448 optional uint64 sa_flags = 2;
2449 optional int32 sig = 3;
2450}
2451message SignalGenerateFtraceEvent {
2452 optional int32 code = 1;
2453 optional string comm = 2;
2454 optional int32 group = 3;
2455 optional int32 pid = 4;
2456 optional int32 result = 5;
2457 optional int32 sig = 6;
2458}
2459
2460// End of protos/perfetto/trace/ftrace/signal.proto
2461
2462// Begin of protos/perfetto/trace/ftrace/task.proto
2463
2464message TaskNewtaskFtraceEvent {
2465 optional int32 pid = 1;
2466 optional string comm = 2;
2467 optional uint64 clone_flags = 3;
2468 optional int32 oom_score_adj = 4;
2469}
2470message TaskRenameFtraceEvent {
2471 optional int32 pid = 1;
2472 optional string oldcomm = 2;
2473 optional string newcomm = 3;
2474 optional int32 oom_score_adj = 4;
2475}
2476
2477// End of protos/perfetto/trace/ftrace/task.proto
2478
2479// Begin of protos/perfetto/trace/ftrace/vmscan.proto
2480
2481message MmVmscanDirectReclaimBeginFtraceEvent {
2482 optional int32 order = 1;
2483 optional int32 may_writepage = 2;
2484 optional uint32 gfp_flags = 3;
2485}
2486message MmVmscanDirectReclaimEndFtraceEvent {
2487 optional uint64 nr_reclaimed = 1;
2488}
2489message MmVmscanKswapdWakeFtraceEvent {
2490 optional int32 nid = 1;
2491 optional int32 order = 2;
2492}
2493message MmVmscanKswapdSleepFtraceEvent {
2494 optional int32 nid = 1;
2495}
2496
2497// End of protos/perfetto/trace/ftrace/vmscan.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002498
Eric Secklerc73ef062019-02-25 12:30:35 +00002499// Begin of protos/perfetto/trace/interned_data/interned_data.proto
2500
2501// ------------------------------ DATA INTERNING: ------------------------------
2502// Interning indexes are built up gradually by adding the entries contained in
2503// each TracePacket of the same packet sequence (packets emitted by the same
2504// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
2505// can only refer to interned data from other packets in the same sequence.
2506//
2507// The writer will emit new entries when it encounters new internable values
2508// that aren't yet in the index. Data in current and subsequent TracePackets can
2509// then refer to the entry by its position (interning ID, abbreviated "iid") in
Eric Seckler612d1d02019-05-01 15:04:02 +01002510// its index. An interning ID with value 0 is considered invalid (not set).
Eric Secklerc73ef062019-02-25 12:30:35 +00002511//
2512// Because of the incremental build-up, the interning index will miss data when
2513// TracePackets are lost, e.g. because a chunk was overridden in the central
2514// ring buffer. To avoid invalidation of the whole trace in such a case, the
2515// index is periodically reset (see |incremental_state_cleared| in TracePacket).
2516// When packet loss occurs, the reader will only lose interning data up to the
2517// next reset.
2518// -----------------------------------------------------------------------------
2519
2520// Message that contains new entries for the interning indices of a packet
2521// sequence.
2522//
2523// The writer will usually emit new entries in the same TracePacket that first
2524// refers to them (since the last reset of interning state). They may also be
2525// emitted proactively in advance of referring to them in later packets.
2526//
2527// Next id: 5.
2528message InternedData {
2529 // Each field's message type needs to specify an |iid| field, which is the ID
2530 // of the entry in the field's interning index. Each field constructs its own
2531 // index, thus interning IDs are scoped to the tracing session and field
2532 // (usually as a counter for efficient var-int encoding). It is illegal to
2533 // override entries in an index (using the same iid for two different values)
2534 // within the same tracing session, even after a reset of the emitted
2535 // interning state.
2536 repeated EventCategory event_categories = 1;
2537 repeated LegacyEventName legacy_event_names = 2;
2538 repeated DebugAnnotationName debug_annotation_names = 3;
2539 repeated SourceLocation source_locations = 4;
2540 // Note: field IDs up to 15 should be used for frequent data only.
2541}
2542
2543// End of protos/perfetto/trace/interned_data/interned_data.proto
2544
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01002545// Begin of protos/perfetto/trace/power/battery_counters.proto
2546
2547message BatteryCounters {
2548 // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
2549 optional int64 charge_counter_uah = 1;
2550
2551 // Remaining battery capacity percentage of total capacity
2552 optional float capacity_percent = 2;
2553
2554 // Instantaneous battery current in microamperes(µA).
2555 // Positive values indicate net current entering the battery from a charge
2556 // source, negative values indicate net current discharging from the battery.
2557 optional int64 current_ua = 3;
2558
2559 // Instantaneous battery current in microamperes(µA).
2560 optional int64 current_avg_ua = 4;
2561}
2562
2563// End of protos/perfetto/trace/power/battery_counters.proto
2564
Esteban Talavera7714cec2019-01-31 15:53:34 +00002565// Begin of protos/perfetto/trace/power/power_rails.proto
2566
2567message PowerRails {
2568
2569 message RailDescriptor {
2570 // Index corresponding to the rail
2571 optional uint32 index = 1;
2572 // Name of the rail
2573 optional string rail_name = 2;
2574 // Name of the subsystem to which this rail belongs
2575 optional string subsys_name = 3;
2576 // Hardware sampling rate
2577 optional uint32 sampling_rate = 4;
2578 }
2579
2580 // This is only emitted at the beginning of the trace.
2581 repeated RailDescriptor rail_descriptor = 1;
2582
2583 message EnergyData {
2584 // Index corresponding to RailDescriptor.index
2585 optional uint32 index = 1;
2586 // Time since device boot(CLOCK_BOOTTIME) in milli-seconds
2587 optional uint64 timestamp_ms = 2;
2588 // Accumulated energy since device boot in microwatt-seconds (uWs)
2589 optional uint64 energy = 3;
2590 }
2591
2592 repeated EnergyData energy_data = 2;
2593}
2594
2595// End of protos/perfetto/trace/power/power_rails.proto
2596
Hector Dearman685f7522019-03-12 14:28:56 +00002597// Begin of protos/perfetto/trace/profiling/profile_packet.proto
2598
2599message ProfilePacket {
Hector Dearman685f7522019-03-12 14:28:56 +00002600 repeated InternedString strings = 1;
2601 message InternedString {
2602 optional uint64 id = 1;
2603 optional bytes str = 2;
2604 }
2605
Florian Mayerdc642fa2019-04-16 20:20:12 +01002606 repeated Mapping mappings = 4;
2607 message Mapping {
2608 optional uint64 id = 1; // Interning key.
2609 optional uint64 build_id = 2; // Interning key.
2610 optional uint64 offset = 3;
2611 optional uint64 start = 4;
2612 optional uint64 end = 5;
2613 optional uint64 load_bias = 6;
2614 // E.g. ["system", "lib64", "libc.so"]
2615 repeated uint64 path_string_ids = 7; // id of string.
2616 }
2617
Hector Dearman685f7522019-03-12 14:28:56 +00002618 repeated Frame frames = 2;
2619 message Frame {
2620 optional uint64 id = 1; // Interning key
2621 // E.g. "fopen"
2622 optional uint64 function_name_id = 2; // id of string.
2623 optional uint64 mapping_id = 3;
2624 optional uint64 rel_pc = 4;
2625 }
2626
2627 repeated Callstack callstacks = 3;
2628 message Callstack {
2629 optional uint64 id = 1;
2630 // Frames of this callstack. Bottom frame first.
2631 repeated uint64 frame_ids = 2;
2632 }
2633
Hector Dearman685f7522019-03-12 14:28:56 +00002634 message HeapSample {
2635 optional uint64 callstack_id = 1;
Florian Mayer78760f22019-05-15 18:05:53 +01002636 // bytes allocated at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002637 optional uint64 self_allocated = 2;
Florian Mayer78760f22019-05-15 18:05:53 +01002638 // bytes allocated at this callstack that have been freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002639 optional uint64 self_freed = 3;
Florian Mayer7142c7c2019-05-20 18:11:41 +01002640 // bytes allocated at this callstack but not used since the last
2641 // clear_refs.
2642 // See documentation of idle_allocations in HeapprofdConfig for more
2643 // details.
2644 optional uint64 self_idle = 7;
Hector Dearman685f7522019-03-12 14:28:56 +00002645 optional uint64 timestamp = 4; // timestamp [opt]
Florian Mayer78760f22019-05-15 18:05:53 +01002646 // Number of allocations that were sampled at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002647 optional uint64 alloc_count = 5;
Florian Mayer78760f22019-05-15 18:05:53 +01002648 // Number of allocations that were sampled at this callstack that have been
2649 // freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002650 optional uint64 free_count = 6;
2651 }
2652
Florian Mayer096bbe32019-04-03 12:10:53 +01002653 message Histogram {
2654 message Bucket {
2655 // This bucket counts values from the previous bucket's (or -infinity if
2656 // this is the first bucket) upper_limit (inclusive) to this upper_limit
2657 // (exclusive).
2658 optional uint64 upper_limit = 1;
2659 // This is the highest bucket. This is set instead of the upper_limit. Any
2660 // values larger or equal to the previous bucket's upper_limit are counted
2661 // in this bucket.
2662 optional bool max_bucket = 2;
2663 // Number of values that fall into this range.
2664 optional uint64 count = 3;
2665 }
2666 repeated Bucket buckets = 1;
2667 }
Florian Mayerdc642fa2019-04-16 20:20:12 +01002668
Florian Mayerdba63f72019-03-27 10:20:46 +00002669 message ProcessStats {
2670 optional uint64 unwinding_errors = 1;
2671 optional uint64 heap_samples = 2;
2672 optional uint64 map_reparses = 3;
Florian Mayer096bbe32019-04-03 12:10:53 +01002673 optional Histogram unwinding_time_us = 4;
Florian Mayer9fe278d2019-04-04 19:20:41 +01002674 optional uint64 total_unwinding_time_us = 5;
Florian Mayerdba63f72019-03-27 10:20:46 +00002675 }
Florian Mayerd0335fe2019-03-27 10:20:22 +00002676
Florian Mayerdc642fa2019-04-16 20:20:12 +01002677 repeated ProcessHeapSamples process_dumps = 5;
Hector Dearman685f7522019-03-12 14:28:56 +00002678 message ProcessHeapSamples {
2679 optional uint64 pid = 1;
Florian Mayerd0335fe2019-03-27 10:20:22 +00002680
2681 // This process was profiled from startup.
2682 // If false, this process was already running when profiling started.
2683 optional bool from_startup = 3;
2684
2685 // This process was not profiled because a concurrent session was active.
2686 // If this is true, samples will be empty.
2687 optional bool rejected_concurrent = 4;
Florian Mayer22e08dc2019-03-28 11:36:02 +00002688
2689 // This process disconnected while it was profiled.
2690 // If false, the process outlived the profiling session.
2691 optional bool disconnected = 6;
2692
Florian Mayerf6680532019-04-10 17:39:31 +01002693 // If disconnected, this disconnect was caused by the client overrunning
2694 // the buffer.
2695 optional bool buffer_overran = 7;
2696
Florian Mayere32b4fd2019-04-15 14:37:52 +01002697 // If disconnected, this disconnected was caused by the shared memory
2698 // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT
2699 // MEMORY CORRUPTION.
2700 optional bool buffer_corrupted = 8;
2701
Florian Mayer5bd65f42019-05-02 16:20:38 +01002702 // Timestamp of the state of the target process that this dump represents.
2703 // This can be different to the timestamp of the TracePackets for various
2704 // reasons:
2705 // * If disconnected is set above, this is the timestamp of last state
2706 // heapprofd had of the process before it disconnected.
2707 // * Otherwise, if the rate of events produced by the process is high,
2708 // heapprofd might be behind.
2709 //
2710 // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock
2711 // to have a type enum that we can reuse here.
2712 optional uint64 timestamp = 9;
2713
Florian Mayerd0335fe2019-03-27 10:20:22 +00002714 optional ProcessStats stats = 5;
2715
Hector Dearman685f7522019-03-12 14:28:56 +00002716 repeated HeapSample samples = 2;
2717 }
2718
2719 optional bool continued = 6;
2720 optional uint64 index = 7;
2721}
2722
2723// End of protos/perfetto/trace/profiling/profile_packet.proto
2724
Hector Dearmane92c6742018-11-22 21:42:39 +00002725// Begin of protos/perfetto/trace/ps/process_stats.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002726
Hector Dearmane92c6742018-11-22 21:42:39 +00002727// Per-process periodically sampled stats. These samples are wrapped in a
2728// dedicated message (as opposite to be fields in process_tree.proto) because
2729// they are dumped at a different rate than cmdline and thread list.
Lalit Maganti999355c2019-03-27 18:17:08 +00002730// Note: not all of these stats will be present in every ProcessStats message
2731// and sometimes processes may be missing . This is because counters are
2732// cached to reduce emission of counters which do not change.
Hector Dearmane92c6742018-11-22 21:42:39 +00002733message ProcessStats {
Lalit Maganti6820abc2019-01-21 11:12:23 +00002734 message Process {
Hector Dearmane92c6742018-11-22 21:42:39 +00002735 optional int32 pid = 1;
Lalit Maganti6820abc2019-01-21 11:12:23 +00002736
2737 // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
Hector Dearmane92c6742018-11-22 21:42:39 +00002738 optional uint64 vm_size_kb = 2;
2739 optional uint64 vm_rss_kb = 3;
2740 optional uint64 rss_anon_kb = 4;
2741 optional uint64 rss_file_kb = 5;
2742 optional uint64 rss_shmem_kb = 6;
2743 optional uint64 vm_swap_kb = 7;
2744 optional uint64 vm_locked_kb = 8;
2745 optional uint64 vm_hwm_kb = 9;
2746 // When adding a new field remember to update kProcMemCounterSize in
2747 // the trace processor.
Lalit Maganti6820abc2019-01-21 11:12:23 +00002748
2749 optional int64 oom_score_adj = 10;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002750 }
Lalit Maganti6820abc2019-01-21 11:12:23 +00002751 repeated Process processes = 1;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002752}
2753
Hector Dearmane92c6742018-11-22 21:42:39 +00002754// End of protos/perfetto/trace/ps/process_stats.proto
2755
2756// Begin of protos/perfetto/trace/ps/process_tree.proto
2757
2758message ProcessTree {
2759 // Representation of a thread.
2760 message Thread {
2761 // The thread id (as per gettid())
2762 optional int32 tid = 1;
2763
2764 // Thread group id (i.e. the PID of the process, == TID of the main thread)
2765 optional int32 tgid = 3;
2766
2767 // The name of the thread.
2768 optional string name = 2;
2769 }
2770
2771 // Representation of a process.
2772 message Process {
2773 // The UNIX process ID, aka thread group ID (as per getpid()).
2774 optional int32 pid = 1;
2775
2776 // The parent process ID, as per getppid().
2777 optional int32 ppid = 2;
2778
2779 // The command line for the process, as per /proc/pid/cmdline.
2780 // If it is a kernel thread there will only be one cmdline field
2781 // and it will contain /proc/pid/comm.
2782 repeated string cmdline = 3;
2783
2784 // No longer used as of Apr 2018, when the dedicated |threads| field was
2785 // introduced in ProcessTree.
2786 repeated Thread threads_deprecated = 4 [deprecated = true];
2787 }
2788
2789 // List of processes and threads in the client. These lists are incremental
2790 // and not exhaustive. A process and its threads might show up separately in
2791 // different ProcessTree messages. A thread might event not show up at all, if
2792 // no sched_switch activity was detected, for instance:
2793 // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
2794 // #1 { threads: [{pid: 12, tgid: 10}] }
2795 // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
2796 repeated Process processes = 1;
2797 repeated Thread threads = 2;
2798}
2799
2800// End of protos/perfetto/trace/ps/process_tree.proto
2801
2802// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
2803
2804// Various Linux system stat counters from /proc.
2805// The fields in this message can be reported at different rates and with
2806// different granularity. See sys_stats_config.proto.
2807message SysStats {
2808 // Counters from /proc/meminfo. Values are in KB.
2809 message MeminfoValue {
2810 optional MeminfoCounters key = 1;
2811 optional uint64 value = 2;
2812 };
2813 repeated MeminfoValue meminfo = 1;
2814
2815 // Counter from /proc/vmstat. Units are often pages, not KB.
2816 message VmstatValue {
2817 optional VmstatCounters key = 1;
2818 optional uint64 value = 2;
2819 };
2820 repeated VmstatValue vmstat = 2;
2821
2822 // Times in each mode, since boot. Unit: nanoseconds.
2823 message CpuTimes {
2824 optional uint32 cpu_id = 1;
2825 optional uint64 user_ns = 2; // Time spent in user mode.
2826 optional uint64 user_ice_ns = 3; // Time spent in user mode (low prio).
2827 optional uint64 system_mode_ns = 4; // Time spent in system mode.
2828 optional uint64 idle_ns = 5; // Time spent in the idle task.
2829 optional uint64 io_wait_ns = 6; // Time spent waiting for I/O.
2830 optional uint64 irq_ns = 7; // Time spent servicing interrupts.
2831 optional uint64 softirq_ns = 8; // Time spent servicing softirqs.
2832 }
2833 repeated CpuTimes cpu_stat = 3; // One entry per cpu.
2834
2835 // Num processes forked since boot.
2836 // Populated only if FORK_COUNT in config.stat_counters.
2837 optional uint64 num_forks = 4;
2838
2839 message InterruptCount {
2840 optional int32 irq = 1;
2841 optional uint64 count = 2;
2842 }
2843
2844 // Number of interrupts, broken by IRQ number.
2845 // Populated only if IRQ_COUNTS in config.stat_counters.
2846 optional uint64 num_irq_total = 5; // Total num of irqs serviced since boot.
2847 repeated InterruptCount num_irq = 6;
2848
2849 // Number of softirqs, broken by softirq number.
2850 // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
2851 optional uint64 num_softirq_total = 7; // Total num of softirqs since boot.
2852 repeated InterruptCount num_softirq = 8; // Per-softirq count.
2853}
2854
2855// End of protos/perfetto/trace/sys_stats/sys_stats.proto
2856
Hector Dearman685f7522019-03-12 14:28:56 +00002857// Begin of protos/perfetto/trace/system_info.proto
2858
2859message Utsname {
2860 optional string sysname = 1;
2861 optional string version = 2;
2862 optional string release = 3;
2863 optional string machine = 4;
2864}
2865
2866message SystemInfo {
2867 optional Utsname utsname = 1;
2868}
2869
2870// End of protos/perfetto/trace/system_info.proto
2871
Hector Dearmane92c6742018-11-22 21:42:39 +00002872// Begin of protos/perfetto/trace/trace.proto
2873
2874message Trace {
2875 repeated TracePacket packet = 1;
2876
2877 // Do NOT add any other field here. This is just a convenience wrapper for
2878 // the use case of a trace being saved to a file. There are other cases
2879 // (streaming) where TracePacket are directly streamed without being wrapped
2880 // in a Trace proto. Nothing should ever rely on the full trace, all the
2881 // logic should be based on TracePacket(s).
2882}
2883
2884// End of protos/perfetto/trace/trace.proto
2885
2886// Begin of protos/perfetto/trace/trace_packet.proto
2887
2888// The root object emitted by Perfetto. A perfetto trace is just a stream of
2889// TracePacket(s).
2890//
Eric Secklerc73ef062019-02-25 12:30:35 +00002891// Next reserved id: 13 (up to 15).
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +01002892// Next id: 49.
Hector Dearmane92c6742018-11-22 21:42:39 +00002893message TracePacket {
Lalit Maganti64bcc242018-12-05 13:35:08 +00002894 // TODO(primiano): in future we should add a timestamp_clock_domain field to
Hector Dearmane92c6742018-11-22 21:42:39 +00002895 // allow mixing timestamps from different clock domains.
2896 optional uint64 timestamp = 8; // Timestamp [ns].
2897
2898 oneof data {
2899 FtraceEventBundle ftrace_events = 1;
2900 ProcessTree process_tree = 2;
2901 ProcessStats process_stats = 9;
2902 InodeFileMap inode_file_map = 4;
2903 // removed field with id 5
2904 ClockSnapshot clock_snapshot = 6;
2905 SysStats sys_stats = 7;
Eric Secklerc73ef062019-02-25 12:30:35 +00002906 TrackEvent track_event = 11;
Hector Dearmane92c6742018-11-22 21:42:39 +00002907
Eric Secklerc73ef062019-02-25 12:30:35 +00002908 // IDs up to 15 are reserved. They take only one byte to encode their
2909 // preamble so should be used for freqeuent events.
Hector Dearmane92c6742018-11-22 21:42:39 +00002910
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00002911 TraceConfig trace_config = 33;
Hector Dearmane92c6742018-11-22 21:42:39 +00002912 FtraceStats ftrace_stats = 34;
Ryan Savitski41ce4592019-05-02 14:43:59 +01002913 TraceStats trace_stats = 35;
Florian Mayer84113672019-01-21 14:48:27 +00002914 ProfilePacket profile_packet = 37;
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01002915 BatteryCounters battery = 38;
Esteban Talavera7714cec2019-01-31 15:53:34 +00002916 PowerRails power_rails = 40;
Primiano Tucci64df2ca2019-01-03 22:26:47 +00002917 AndroidLogPacket android_log = 39;
Hector Dearman685f7522019-03-12 14:28:56 +00002918 SystemInfo system_info = 45;
Stephen Nusko70ea3302019-04-01 19:44:40 +01002919 Trigger trigger = 46;
Florian Mayer12f0f8e2019-04-02 12:31:13 +01002920 PackagesList packages_list = 47;
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +01002921 ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
Hector Dearmane92c6742018-11-22 21:42:39 +00002922
Eric Secklerc73ef062019-02-25 12:30:35 +00002923 // Only used by TrackEvent.
2924 ProcessDescriptor process_descriptor = 43;
2925 ThreadDescriptor thread_descriptor = 44;
2926
Hector Dearmane92c6742018-11-22 21:42:39 +00002927 // This field is emitted at periodic intervals (~10s) and
2928 // contains always the binary representation of the UUID
2929 // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
2930 // efficiently partition long traces without having to fully parse them.
2931 bytes synchronization_marker = 36;
2932
2933 // This field is only used for testing.
Hector Dearman248241e2019-05-10 18:28:45 +01002934 // In previous versions of this proto this field had the id 268435455
2935 // This caused many problems:
2936 // - protozero decoder does not handle field ids larger than 999.
2937 // - old versions of protoc produce Java bindings with syntax errors when
2938 // the field id is large enough.
2939 // removed field with id 900
Hector Dearmane92c6742018-11-22 21:42:39 +00002940 }
2941
2942 // Trusted user id of the producer which generated this packet. Keep in sync
2943 // with TrustedPacket.trusted_uid.
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00002944 //
2945 // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
2946 // instead.
Hector Dearmane92c6742018-11-22 21:42:39 +00002947 oneof optional_trusted_uid { int32 trusted_uid = 3; };
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00002948
2949 // Service-assigned identifier of the packet sequence this packet belongs to.
2950 // Uniquely identifies a producer + writer pair within the tracing session. A
2951 // value of zero denotes an invalid ID. Keep in sync with
2952 // TrustedPacket.trusted_packet_sequence_id.
2953 oneof optional_trusted_packet_sequence_id {
2954 uint32 trusted_packet_sequence_id = 10;
2955 }
Eric Secklerc73ef062019-02-25 12:30:35 +00002956
2957 // Incrementally emitted interned data, valid only on the packet's sequence
2958 // (packets with the same |trusted_packet_sequence_id|). The writer will
2959 // usually emit new interned data in the same TracePacket that first refers to
2960 // it (since the last reset of interning state). It may also be emitted
2961 // proactively in advance of referring to them in later packets.
2962 optional InternedData interned_data = 12;
2963
2964 // Set to true by the writer to indicate that it will re-emit any incremental
2965 // data for the packet's sequence before referring to it again. This includes
2966 // interned data as well as periodically emitted data like
2967 // Process/ThreadDescriptors. This flag only affects the current packet
2968 // sequence (see |trusted_packet_sequence_id|).
2969 //
2970 // When set to true, this TracePacket and subsequent TracePackets on the same
2971 // sequence will not refer to any incremental data emitted before this
2972 // TracePacket. For example, previously emitted interned data will be
2973 // re-emitted if it is referred to again.
2974 //
2975 // When the reader detects packet loss (|previous_packet_dropped|), it needs
2976 // to skip packets in the sequence until the next one with this flag set, to
2977 // ensure intact incremental data.
2978 optional bool incremental_state_cleared = 41;
2979
Ryan Savitskia9097812019-03-26 16:13:25 +00002980 // Flag set by the service if, for the current packet sequence (see
2981 // |trusted_packet_sequence_id|), either:
2982 // * this is the first packet, or
2983 // * one or multiple packets were dropped since the last packet that the
2984 // consumer read from the sequence. This can happen if chunks in the trace
2985 // buffer are overridden before the consumer could read them when the trace
2986 // is configured in ring buffer mode.
Eric Secklerc73ef062019-02-25 12:30:35 +00002987 //
2988 // When packet loss occurs, incrementally emitted data (including interned
2989 // data) on the sequence should be considered invalid up until the next packet
Ryan Savitskia9097812019-03-26 16:13:25 +00002990 // with |incremental_state_cleared| set.
Eric Secklerc73ef062019-02-25 12:30:35 +00002991 optional bool previous_packet_dropped = 42;
Hector Dearmane92c6742018-11-22 21:42:39 +00002992}
2993
2994// End of protos/perfetto/trace/trace_packet.proto
Florian Mayer84113672019-01-21 14:48:27 +00002995
Eric Secklerc73ef062019-02-25 12:30:35 +00002996// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
2997
2998// Key/value annotations provided in untyped TRACE_EVENT macros. These
2999// annotations are intended for debug use and are not considered a stable API
3000// surface. As such, they should not be relied upon to implement (new) metrics.
3001message DebugAnnotation {
3002 message NestedValue {
3003 enum NestedType {
3004 UNSPECIFIED = 0; // leaf value.
3005 DICT = 1;
3006 ARRAY = 2;
3007 }
3008 optional NestedType nested_type = 1;
3009
3010 repeated string dict_keys = 2;
3011 repeated NestedValue dict_values = 3;
3012 repeated NestedValue array_values = 4;
3013 optional int64 int_value = 5;
3014 optional double double_value = 6;
3015 optional bool bool_value = 7;
3016 optional string string_value = 8;
3017 }
3018
3019 optional uint32 name_iid = 1; // interned DebugAnnotationName.
3020
3021 oneof value {
3022 bool bool_value = 2;
3023 uint64 uint_value = 3;
3024 int64 int_value = 4;
3025 double double_value = 5;
3026 string string_value = 6;
3027 // Pointers are stored in a separate type as the JSON output treats them
3028 // differently from other uint64 values.
3029 uint64 pointer_value = 7;
3030 NestedValue nested_value = 8;
3031
3032 // Legacy instrumentation may not support conversion of nested data to
3033 // NestedValue yet.
3034 string legacy_json_value = 9;
3035 }
3036}
3037
3038// --------------------
3039// Interned data types:
3040// --------------------
3041
3042message DebugAnnotationName {
3043 optional uint32 iid = 1;
3044 optional string name = 2;
3045}
3046
3047// End of protos/perfetto/trace/track_event/debug_annotation.proto
3048
3049// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
3050
3051// Process-wide data that is periodically emitted by one thread per process.
3052// Valid for all events in packet sequences emitted by the same process.
3053//
3054// Next id: 5.
3055message ProcessDescriptor {
3056 optional int32 pid = 1;
3057 repeated string cmdline = 2;
3058
3059 // To support old UI. New UI should determine default sorting by process_type.
3060 optional int32 legacy_sort_index = 3;
3061
3062 // See chromium's content::ProcessType.
3063 enum ChromeProcessType {
Eric Seckler59945762019-03-04 11:48:25 +00003064 PROCESS_UNSPECIFIED = 0;
3065 PROCESS_BROWSER = 1;
3066 PROCESS_RENDERER = 2;
3067 PROCESS_UTILITY = 3;
3068 PROCESS_ZYGOTE = 4;
3069 PROCESS_SANDBOX_HELPER = 5;
3070 PROCESS_GPU = 6;
3071 PROCESS_PPAPI_PLUGIN = 7;
3072 PROCESS_PPAPI_BROKER = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00003073 }
3074 optional ChromeProcessType chrome_process_type = 4;
3075}
3076
3077// End of protos/perfetto/trace/track_event/process_descriptor.proto
3078
3079// Begin of protos/perfetto/trace/track_event/task_execution.proto
3080
3081// TrackEvent arguments describing the execution of a task.
3082message TaskExecution {
3083 // Source location that the task was posted from.
3084 optional uint32 posted_from_iid = 1; // interned SourceLocation.
3085}
3086
3087// --------------------
3088// Interned data types:
3089// --------------------
3090
3091message SourceLocation {
3092 optional uint32 iid = 1;
3093
3094 // We intend to add a binary symbol version of this in the future.
3095 optional string file_name = 2;
3096 optional string function_name = 3;
3097}
3098
3099// End of protos/perfetto/trace/track_event/task_execution.proto
3100
3101// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
3102
3103// Periodically emitted data that's common to all events emitted by the same
3104// thread, i.e. all events in the same packet sequence. Valid for all subsequent
3105// events in the same sequence.
3106//
3107// Next id: 8.
3108message ThreadDescriptor {
3109 optional int32 pid = 1;
3110 optional int32 tid = 2;
3111
3112 // To support old UI. New UI should determine default sorting by thread_type.
3113 optional int32 legacy_sort_index = 3;
3114
3115 enum ChromeThreadType {
Siddhartha S1e2582a2019-05-31 14:08:07 -07003116 THREAD_TYPE_UNSPECIFIED = 0;
3117
3118 THREAD_TYPE_MAIN = 1;
3119 THREAD_TYPE_IO = 2;
3120
3121 // Scheduler:
3122 THREAD_TYPE_THREAD_POOL_BG_WORKER = 3;
3123 THREAD_TYPE_THREAD_POOL_FG_WORKER = 4;
3124 THREAD_TYPE_THREAD_POOL_FB_BLOCKING = 5;
3125 THREAD_TYPE_THREAD_POOL_BG_BLOCKING = 6;
3126 THREAD_TYPE_THREAD_POOL_SERVICE = 7;
3127
3128 // Compositor:
3129 THREAD_TYPE_COMPOSITOR = 8;
3130 THREAD_TYPE_VIZ_COMPOSITOR = 9;
3131 THREAD_TYPE_COMPOSITOR_WORKER = 10;
3132
3133 // Renderer:
3134 THREAD_TYPE_SERVICE_WORKER = 11;
3135
3136 // Tracing related threads:
3137 THREAD_TYPE_MEMORY_INFRA = 50;
3138 THREAD_TYPE_SAMPLING_PROFILER = 51;
Eric Secklerc73ef062019-02-25 12:30:35 +00003139 };
Eric Seckler14167852019-03-26 09:20:09 +00003140 optional ChromeThreadType chrome_thread_type = 4;
Eric Secklerc73ef062019-02-25 12:30:35 +00003141
3142 // TODO(eseckler): Replace this with ChromeThreadType where possible.
3143 optional string thread_name = 5;
3144
3145 // Absolute reference values. Clock values in subsequent TrackEvents can be
3146 // encoded accumulatively and relative to these. This reduces their var-int
3147 // encoding size.
3148 optional int64 reference_timestamp_us = 6;
3149 optional int64 reference_thread_time_us = 7;
3150}
3151
3152// End of protos/perfetto/trace/track_event/thread_descriptor.proto
3153
3154// Begin of protos/perfetto/trace/track_event/track_event.proto
3155
3156// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
3157// which describe activity on a track, such as a thread, task sequence, or
3158// asynchronous track.
3159//
3160// This message is optimized for writing and makes heavy use of data interning
3161// and delta encoding (e.g. of timestamps) to reduce data repetition and encoded
3162// data size.
3163//
3164// A TrackEvent exists in the context of its packet sequence (TracePackets
3165// emitted by the same producer + writer) and refers to data in preceding
3166// TracePackets emitted on the same sequence, both directly and indirectly. For
3167// example, interned data entries are emitted as part of a TracePacket and
3168// directly referred to from TrackEvents by their interning IDs. Attributes
3169// shared by all events on the same sequence (e.g. their thread and process
3170// association) are emitted as part of ProcessDescriptor and ThreadDescriptor
3171// messages in separate TracePackets instead.
3172//
3173// Next reserved id: 7 (up to 15).
Andrew Comminos195e9352019-05-14 16:56:47 -07003174// Next id: 21.
Eric Secklerc73ef062019-02-25 12:30:35 +00003175message TrackEvent {
3176 // Timestamp in microseconds (usually CLOCK_MONOTONIC).
3177 oneof timestamp {
3178 // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
3179 // calculate the absolute timestamp value, sum up all delta values of the
3180 // preceding TrackEvents since the last ThreadDescriptor and add the sum to
3181 // the |reference_timestamp| in ThreadDescriptor. This value should always
3182 // be positive.
3183 int64 timestamp_delta_us = 1;
3184 // Absolute value (e.g. a manually specified timestamp in the macro).
3185 // This is a one-off value that does not affect delta timestamp computation
3186 // in subsequent TrackEvents.
3187 int64 timestamp_absolute_us = 16;
3188 }
3189
3190 // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
3191 // microseconds.
3192 oneof thread_time {
3193 // Same encoding as |timestamp| fields above.
3194 int64 thread_time_delta_us = 2;
3195 // TODO(eseckler): Consider removing absolute thread time support. It's
3196 // currently required to support writing PHASE_COMPLETE events out-of-order,
3197 // but shouldn't be required anymore when we split them into begin/end.
3198 int64 thread_time_absolute_us = 17;
3199 }
3200
Andrew Comminos195e9352019-05-14 16:56:47 -07003201 // Elapsed retired instruction count during the event.
3202 optional int64 thread_instruction_delta = 20;
3203
Eric Secklerc73ef062019-02-25 12:30:35 +00003204 // We intend to add a binary symbol version of this in the future.
3205 repeated uint32 category_iids = 3; // interned EventCategoryName.
3206
3207 // TODO(eseckler): May also want a debug_name for untyped debug-only events.
3208
3209 // Unstable key/value annotations shown in the trace viewer but not intended
3210 // for metrics use.
3211 repeated DebugAnnotation debug_annotations = 4;
3212
3213 // Typed event arguments:
3214 optional TaskExecution task_execution = 5;
3215 // TODO(eseckler): New argument types go here :)
3216
3217 // Apart from {category, time, thread time, tid, pid}, other legacy trace
3218 // event attributes are initially simply proxied for conversion to a JSON
3219 // trace. We intend to gradually transition these attributes to similar native
3220 // features in TrackEvent (e.g. async + flow events), or deprecate them
3221 // without replacement where transition is unsuitable.
Eric Seckler59945762019-03-04 11:48:25 +00003222 //
3223 // Next reserved id: 15 (up to 16).
3224 // Next id: 20.
Eric Secklerc73ef062019-02-25 12:30:35 +00003225 message LegacyEvent {
3226 optional uint32 name_iid = 1; // interned LegacyEventName.
3227 optional int32 phase = 2;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003228 optional int64 duration_us = 3;
3229 optional int64 thread_duration_us = 4;
Eric Seckler59945762019-03-04 11:48:25 +00003230
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003231 reserved 5; // used to be |flags|.
Eric Seckler59945762019-03-04 11:48:25 +00003232
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003233 oneof id {
3234 uint64 unscoped_id = 6;
3235 uint64 local_id = 10;
3236 uint64 global_id = 11;
3237 }
3238 // Additional optional scope for |id|.
3239 optional string id_scope = 7;
Eric Seckler59945762019-03-04 11:48:25 +00003240
3241 // Consider the thread timestamps for async BEGIN/END event pairs as valid.
3242 optional bool use_async_tts = 9;
3243
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003244 // Idenfifies a flow. Flow events with the same bind_id are connected.
Eric Secklerc73ef062019-02-25 12:30:35 +00003245 optional uint64 bind_id = 8;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003246 // Use the enclosing slice as binding point for a flow end event instead of
3247 // the next slice. Flow start/step events always bind to the enclosing
3248 // slice.
Eric Seckler59945762019-03-04 11:48:25 +00003249 optional bool bind_to_enclosing = 12;
3250
3251 enum FlowDirection {
3252 FLOW_UNSPECIFIED = 0;
3253 FLOW_IN = 1;
3254 FLOW_OUT = 2;
3255 FLOW_INOUT = 3;
3256 }
3257 optional FlowDirection flow_direction = 13;
3258
3259 enum InstantEventScope {
3260 SCOPE_UNSPECIFIED = 0;
3261 SCOPE_GLOBAL = 1;
3262 SCOPE_PROCESS = 2;
3263 SCOPE_THREAD = 3;
3264 }
3265 optional InstantEventScope instant_event_scope = 14;
Eric Secklerc73ef062019-02-25 12:30:35 +00003266
3267 // Override the pid/tid if the writer needs to emit events on behalf of
3268 // another process/thread. This should be the exception. Normally, the
3269 // pid+tid from ThreadDescriptor is used.
3270 optional int32 pid_override = 18;
3271 optional int32 tid_override = 19;
3272 }
3273
3274 optional LegacyEvent legacy_event = 6;
3275}
3276
3277// --------------------
3278// Interned data types:
3279// --------------------
3280
3281message EventCategory {
3282 optional uint32 iid = 1;
3283 optional string name = 2;
3284}
3285
3286message LegacyEventName {
3287 optional uint32 iid = 1;
3288 optional string name = 2;
3289}
3290
3291// End of protos/perfetto/trace/track_event/track_event.proto
3292
Stephen Nusko70ea3302019-04-01 19:44:40 +01003293// Begin of protos/perfetto/trace/trigger.proto
3294
3295// When a TracingSession receives a trigger it records the boot time nanoseconds
3296// in the TracePacket's timestamp field as well as the name of the producer that
3297// triggered it. We emit this data so filtering can be done on triggers received
3298// in the trace.
3299message Trigger {
3300 // Name of the trigger which was received.
3301 optional string trigger_name = 1;
3302 // The actual producer that activated |trigger|.
3303 optional string producer_name = 2;
3304 // The verified UID of the producer.
3305 optional int32 trusted_producer_uid = 3;
3306}
3307
3308// End of protos/perfetto/trace/trigger.proto
3309
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003310// Begin of protos/perfetto/config/android/android_log_config.proto
3311
3312message AndroidLogConfig {
3313 repeated AndroidLogId log_ids = 1;
3314
3315 reserved 2; // Was |poll_ms|, deprecated.
3316
3317 // If set ignores all log messages whose prio is < the given value.
3318 optional AndroidLogPriority min_prio = 3;
3319
3320 // If non-empty ignores all log messages whose tag doesn't match one of the
3321 // specified values.
3322 repeated string filter_tags = 4;
3323}
3324
3325// End of protos/perfetto/config/android/android_log_config.proto
3326
3327// Begin of protos/perfetto/config/chrome/chrome_config.proto
3328
3329// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3330// to reflect changes in the corresponding C++ headers.
3331
3332message ChromeConfig {
3333 optional string trace_config = 1;
Siddhartha S305a5012019-03-29 09:33:00 -07003334
3335 // When enabled, the data source should only fill in fields in the output that
3336 // are not potentially privacy sensitive.
3337 optional bool privacy_filtering_enabled = 2;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003338}
3339
3340// End of protos/perfetto/config/chrome/chrome_config.proto
3341
3342// Begin of protos/perfetto/config/data_source_config.proto
3343
3344// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3345// to reflect changes in the corresponding C++ headers.
3346
3347// The configuration that is passed to each data source when starting tracing.
3348message DataSourceConfig {
3349 // Data source unique name, e.g., "linux.ftrace". This must match
3350 // the name passed by the data source when it registers (see
3351 // RegisterDataSource()).
3352 optional string name = 1;
3353
3354 // The index of the logging buffer where TracePacket(s) will be stored.
3355 // This field doesn't make a major difference for the Producer(s). The final
3356 // logging buffers, in fact, are completely owned by the Service. We just ask
3357 // the Producer to copy this number into the chunk headers it emits, so that
3358 // the Service can quickly identify the buffer where to move the chunks into
3359 // without expensive lookups on its fastpath.
3360 optional uint32 target_buffer = 2;
3361
3362 // Set by the service to indicate the duration of the trace.
3363 // DO NOT SET in consumer as this will be overridden by the service.
3364 optional uint32 trace_duration_ms = 3;
3365
Florian Mayerfb879982019-03-29 10:45:32 +00003366 // Set by the service to indicate whether this tracing session has extra
3367 // guardrails.
3368 // DO NOT SET in consumer as this will be overridden by the service.
3369 optional bool enable_extra_guardrails = 6;
3370
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003371 // Set by the service to indicate which tracing session the data source
3372 // belongs to. The intended use case for this is checking if two data sources,
3373 // one of which produces metadata for the other one, belong to the same trace
3374 // session and hence should be linked together.
3375 // This field was introduced in Aug 2018 after Android P.
3376 optional uint64 tracing_session_id = 4;
3377
3378 // Keeep the lower IDs (up to 99) for fields that are *not* specific to
3379 // data-sources and needs to be processed by the traced daemon.
3380
Primiano Tucci0f2f3b42019-05-21 19:37:01 +01003381 // All data source config fields must be marked as [lazy=true]. This prevents
3382 // the proto-to-cpp generator from recursing into those when generating the
3383 // cpp classes and polluting tracing/core with data-source-specific classes.
3384 // Instead they are treated as opaque strings containing raw proto bytes.
3385
3386 optional FtraceConfig ftrace_config = 100 [lazy = true];
3387 optional InodeFileConfig inode_file_config = 102 [lazy = true];
3388 optional ProcessStatsConfig process_stats_config = 103 [lazy = true];
3389 optional SysStatsConfig sys_stats_config = 104 [lazy = true];
3390 optional HeapprofdConfig heapprofd_config = 105 [lazy = true];
3391 optional AndroidPowerConfig android_power_config = 106 [lazy = true];
3392 optional AndroidLogConfig android_log_config = 107 [lazy = true];
3393
3394 // TODO(primiano): Figure out how to deal with this, needs a multi-side patch.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003395 optional ChromeConfig chrome_config = 101;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003396
3397 // This is a fallback mechanism to send a free-form text config to the
3398 // producer. In theory this should never be needed. All the code that
3399 // is part of the platform (i.e. traced service) is supposed to *not* truncate
3400 // the trace config proto and propagate unknown fields. However, if anything
3401 // in the pipeline (client or backend) ends up breaking this forward compat
3402 // plan, this field will become the escape hatch to allow future data sources
3403 // to get some meaningful configuration.
3404 optional string legacy_config = 1000;
3405
3406 // This field is only used for testing.
3407 optional TestConfig for_testing =
3408 268435455; // 2^28 - 1, max field id for protos supported by Java.
3409}
3410
3411// End of protos/perfetto/config/data_source_config.proto
3412
3413// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
3414
3415// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3416// to reflect changes in the corresponding C++ headers.
3417
3418message FtraceConfig {
3419 repeated string ftrace_events = 1;
3420 repeated string atrace_categories = 2;
3421 repeated string atrace_apps = 3;
3422 // *Per-CPU* buffer size.
3423 optional uint32 buffer_size_kb = 10;
3424 optional uint32 drain_period_ms = 11;
3425}
3426
3427// End of protos/perfetto/config/ftrace/ftrace_config.proto
3428
3429// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
3430
3431// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3432// to reflect changes in the corresponding C++ headers.
3433
3434message InodeFileConfig {
3435 message MountPointMappingEntry {
3436 optional string mountpoint = 1;
3437 repeated string scan_roots = 2;
3438 }
3439
3440 // How long to pause between batches.
3441 optional uint32 scan_interval_ms = 1;
3442
3443 // How long to wait before the first scan in order to accumulate inodes.
3444 optional uint32 scan_delay_ms = 2;
3445
3446 // How many inodes to scan in one batch.
3447 optional uint32 scan_batch_size = 3;
3448
3449 // Do not scan for inodes not found in the static map.
3450 optional bool do_not_scan = 4;
3451
3452 // If non-empty, only scan inodes corresponding to block devices named in
3453 // this list.
3454 repeated string scan_mount_points = 5;
3455
3456 // When encountering an inode belonging to a block device corresponding
3457 // to one of the mount points in this map, scan its scan_roots instead.
3458 repeated MountPointMappingEntry mount_point_mapping = 6;
3459}
3460
3461// End of protos/perfetto/config/inode_file/inode_file_config.proto
3462
3463// Begin of protos/perfetto/config/power/android_power_config.proto
3464
3465message AndroidPowerConfig {
3466 enum BatteryCounters {
3467 BATTERY_COUNTER_UNSPECIFIED = 0;
3468 BATTERY_COUNTER_CHARGE = 1; // Coulomb counter.
3469 BATTERY_COUNTER_CAPACITY_PERCENT = 2; // Charge (%).
3470 BATTERY_COUNTER_CURRENT = 3; // Instantaneous current.
3471 BATTERY_COUNTER_CURRENT_AVG = 4; // Avg current.
3472 }
3473 optional uint32 battery_poll_ms = 1;
3474 repeated BatteryCounters battery_counters = 2;
3475
3476 // Where available enables per-power-rail measurements.
3477 optional bool collect_power_rails = 3;
3478}
3479
3480// End of protos/perfetto/config/power/android_power_config.proto
3481
3482// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
3483
3484// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3485// to reflect changes in the corresponding C++ headers.
3486
3487message ProcessStatsConfig {
3488 enum Quirks {
3489 QUIRKS_UNSPECIFIED = 0;
3490
3491 // This has been deprecated and ignored as per 2018-05-01. Full scan at
3492 // startup is now disabled by default and can be re-enabled using the
3493 // |scan_all_processes_on_start| arg.
3494 DISABLE_INITIAL_DUMP = 1 [deprecated = true];
3495
3496 DISABLE_ON_DEMAND = 2;
3497 }
3498
3499 repeated Quirks quirks = 1;
3500
3501 // If enabled all processes will be scanned and dumped when the trace starts.
3502 optional bool scan_all_processes_on_start = 2;
3503
3504 // If enabled thread names are also recoded (this is redundant if sched_switch
3505 // is enabled).
3506 optional bool record_thread_names = 3;
3507
3508 // If > 0 samples counters (see process_stats.proto) from
3509 // /proc/pid/status and oom_score_adj every X ms.
3510 // This is required to be > 100ms to avoid excessive CPU usage.
3511 // TODO(primiano): add CPU cost for change this value.
3512 optional uint32 proc_stats_poll_ms = 4;
3513
3514 // If empty samples stats for all processes. If non empty samples stats only
3515 // for processes matching the given string in their argv0 (i.e. the first
3516 // entry of /proc/pid/cmdline).
3517 // TODO(primiano): implement this feature.
3518 // repeated string proc_stats_filter = 5;
Lalit Maganti999355c2019-03-27 18:17:08 +00003519
3520 // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
3521 // (default: |proc_stats_poll_ms|). If = 0, will be set to
3522 // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
3523 // multiple.
3524 optional uint32 proc_stats_cache_ttl_ms = 6;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003525}
3526
3527// End of protos/perfetto/config/process_stats/process_stats_config.proto
3528
3529// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
3530
3531// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3532// to reflect changes in the corresponding C++ headers.
3533
3534// This file defines the configuration for the Linux /proc poller data source,
3535// which injects counters in the trace.
3536// Counters that are needed in the trace must be explicitly listed in the
3537// *_counters fields. This is to avoid spamming the trace with all counters
3538// at all times.
3539// The sampling rate is configurable. All polling rates (*_period_ms) need
3540// to be integer multiples of each other.
3541// OK: [10ms, 10ms, 10ms], [10ms, 20ms, 10ms], [10ms, 20ms, 60ms]
3542// Not OK: [10ms, 10ms, 11ms], [10ms, 15ms, 20ms]
3543message SysStatsConfig {
3544 // Polls /proc/meminfo every X ms, if non-zero.
3545 // This is required to be > 10ms to avoid excessive CPU usage.
3546 // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
3547 optional uint32 meminfo_period_ms = 1;
3548
3549 // Only the counters specified below are reported.
3550 repeated MeminfoCounters meminfo_counters = 2;
3551
3552 // Polls /proc/vmstat every X ms, if non-zero.
3553 // This is required to be > 10ms to avoid excessive CPU usage.
3554 // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
3555 optional uint32 vmstat_period_ms = 3;
3556 repeated VmstatCounters vmstat_counters = 4;
3557
3558 // Pols /proc/stat every X ms, if non-zero.
3559 // This is required to be > 10ms to avoid excessive CPU usage.
3560 // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
3561 optional uint32 stat_period_ms = 5;
3562 enum StatCounters {
3563 STAT_UNSPECIFIED = 0;
3564 STAT_CPU_TIMES = 1;
3565 STAT_IRQ_COUNTS = 2;
3566 STAT_SOFTIRQ_COUNTS = 3;
3567 STAT_FORK_COUNT = 4;
3568 }
3569 repeated StatCounters stat_counters = 6;
3570}
3571
3572// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
3573
3574// Begin of protos/perfetto/config/test_config.proto
3575
3576// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3577// to reflect changes in the corresponding C++ headers.
3578
3579// The configuration for a fake producer used in tests.
3580message TestConfig {
3581 message DummyFields {
3582 optional uint32 field_uint32 = 1;
3583 optional int32 field_int32 = 2;
3584 optional uint64 field_uint64 = 3;
3585 optional int64 field_int64 = 4;
3586 optional fixed64 field_fixed64 = 5;
3587 optional sfixed64 field_sfixed64 = 6;
3588 optional fixed32 field_fixed32 = 7;
3589 optional sfixed32 field_sfixed32 = 8;
3590 optional double field_double = 9;
3591 optional float field_float = 10;
3592 optional sint64 field_sint64 = 11;
3593 optional sint32 field_sint32 = 12;
3594 optional string field_string = 13;
3595 optional bytes field_bytes = 14;
3596 }
3597
3598 // The number of messages the fake producer should send.
3599 optional uint32 message_count = 1;
3600
3601 // The maximum number of messages which should be sent each second.
3602 // The actual obserced speed may be lower if the producer is unable to
3603 // work fast enough.
3604 // If this is zero or unset, the producer will send as fast as possible.
3605 optional uint32 max_messages_per_second = 2;
3606
3607 // The seed value for a simple multiplicative congruential pseudo-random
3608 // number sequence.
3609 optional uint32 seed = 3;
3610
3611 // The size of each message in bytes. Should be greater than or equal 5 to
3612 // account for the number of bytes needed to encode the random number and a
3613 // null byte for the string.
3614 optional uint32 message_size = 4;
3615
3616 // Whether the producer should send a event batch when the data source is
3617 // is initially registered.
3618 optional bool send_batch_on_register = 5;
3619
3620 optional DummyFields dummy_fields = 6;
3621}
3622
3623// End of protos/perfetto/config/test_config.proto
3624
3625// Begin of protos/perfetto/config/trace_config.proto
3626
Ryan Savitski0b4008a2019-05-13 17:55:53 +01003627// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003628// to reflect changes in the corresponding C++ headers.
3629
3630// The overall config that is used when starting a new tracing session through
3631// ProducerPort::StartTracing().
3632// It contains the general config for the logging buffer(s) and the configs for
3633// all the data source being enabled.
3634//
Hector Dearmanfb4d0732019-05-19 15:44:56 +01003635// Next id: 23.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003636message TraceConfig {
3637 message BufferConfig {
3638 optional uint32 size_kb = 1;
3639
3640 reserved 2; // |page_size|, now deprecated.
3641 reserved 3; // |optimize_for|, now deprecated.
3642
3643 enum FillPolicy {
3644 UNSPECIFIED = 0;
3645
3646 // Default behavior. The buffer operates as a conventional ring buffer.
3647 // If the writer is faster than the reader (or if the reader reads only
3648 // after tracing is stopped) newly written packets will overwrite old
3649 // packets.
3650 RING_BUFFER = 1;
3651
3652 // Behaves like RING_BUFFER as long as there is space in the buffer or
3653 // the reader catches up with the writer. As soon as the writer hits
3654 // an unread chunk, it stops accepting new data in the buffer.
3655 DISCARD = 2;
3656 }
3657 optional FillPolicy fill_policy = 4;
3658 }
3659 repeated BufferConfig buffers = 1;
3660
3661 message DataSource {
3662 // Filters and data-source specific config. It contains also the unique name
3663 // of the data source, the one passed in the DataSourceDescriptor when they
3664 // register on the service.
3665 optional protos.DataSourceConfig config = 1;
3666
3667 // Optional. If multiple producers (~processes) expose the same data source
3668 // and |producer_name_filter| != "", the data source is enabled only for
3669 // producers whose names match any of the producer_name_filter below.
3670 // The |producer_name_filter| has to be an exact match. (TODO(primiano):
3671 // support wildcards or regex).
3672 // This allows to enable a data source only for specific processes.
3673 // The "repeated" field has OR sematics: specifying a filter ["foo", "bar"]
3674 // will enable data source on both "foo" and "bar" (if existent).
3675 repeated string producer_name_filter = 2;
3676 }
3677 repeated DataSource data_sources = 2;
3678
Siddhartha Sb63f61e2019-05-03 16:19:51 -07003679 // Config for builtin trace packets emitted by perfetto like trace stats,
3680 // system info, etc.
3681 message BuiltinDataSource {
3682 // Disable emitting clock timestamps into the trace.
3683 optional bool disable_clock_snapshotting = 1;
3684
3685 optional bool disable_trace_config = 2;
3686
3687 optional bool disable_system_info = 3;
3688 }
3689 optional BuiltinDataSource builtin_data_sources = 20;
3690
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003691 // If specified, the trace will be stopped |duration_ms| after starting.
3692 // However in case of traces with triggers, see
3693 // TriggerConfig.trigger_timeout_ms instead.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003694 optional uint32 duration_ms = 3;
3695
3696 // This is set when --dropbox is passed to the Perfetto command line client
3697 // and enables guardrails that limit resource usage for traces requested
3698 // by statsd.
3699 optional bool enable_extra_guardrails = 4;
3700
3701 enum LockdownModeOperation {
3702 LOCKDOWN_UNCHANGED = 0;
3703 LOCKDOWN_CLEAR = 1;
3704 LOCKDOWN_SET = 2;
3705 }
3706 // Reject producers that are not running under the same UID as the tracing
3707 // service.
3708 optional LockdownModeOperation lockdown_mode = 5;
3709
3710 message ProducerConfig {
3711 // Identifies the producer for which this config is for.
3712 optional string producer_name = 1;
3713
3714 // Specifies the preferred size of the shared memory buffer. If the size is
3715 // larger than the max size, the max will be used. If it is smaller than
3716 // the page size or doesn't fit pages evenly into it, it will fall back to
3717 // the size specified by the producer or finally the default shared memory
3718 // size.
3719 optional uint32 shm_size_kb = 2;
3720
3721 // Specifies the preferred size of each page in the shared memory buffer.
3722 // Must be an integer multiple of 4K.
3723 optional uint32 page_size_kb = 3;
3724 }
3725
3726 repeated ProducerConfig producers = 6;
3727
3728 // Contains statsd-specific metadata about an alert associated with the trace.
3729 message StatsdMetadata {
3730 // The identifier of the alert which triggered this trace.
3731 optional int64 triggering_alert_id = 1;
3732 // The uid which registered the triggering configuration with statsd.
3733 optional int32 triggering_config_uid = 2;
3734 // The identifier of the config which triggered the alert.
3735 optional int64 triggering_config_id = 3;
3736 // The identifier of the subscription which triggered this trace.
3737 optional int64 triggering_subscription_id = 4;
3738 }
3739
3740 // Statsd-specific metadata.
3741 optional StatsdMetadata statsd_metadata = 7;
3742
3743 // When true, the EnableTracing() request must also provide a file descriptor.
3744 // The service will then periodically read packets out of the trace buffer and
3745 // store it into the passed file.
3746 optional bool write_into_file = 8;
3747
3748 // Optional. If non-zero tunes the write period. A min value of 100ms is
3749 // enforced (i.e. smaller values are ignored).
3750 optional uint32 file_write_period_ms = 9;
3751
3752 // Optional. When non zero the periodic write stops once at most X bytes
3753 // have been written into the file. Tracing is disabled when this limit is
3754 // reached, even if |duration_ms| has not been reached yet.
3755 optional uint64 max_file_size_bytes = 10;
3756
3757 // Contains flags which override the default values of the guardrails inside
3758 // Perfetto. These values are only affect userdebug builds.
3759 message GuardrailOverrides {
3760 // Override the default limit (in bytes) for uploading data to server within
3761 // a 24 hour period.
3762 optional uint64 max_upload_per_day_bytes = 1;
3763 }
3764
3765 optional GuardrailOverrides guardrail_overrides = 11;
3766
3767 // When true, data sources are not started until an explicit call to
3768 // StartTracing() on the consumer port. This is to support early
3769 // initialization and fast trace triggering. This can be used only when the
3770 // Consumer explicitly triggers the StartTracing() method.
3771 // This should not be used in a remote trace config via statsd, doing so will
3772 // result in a hung trace session.
3773 optional bool deferred_start = 12;
3774
3775 // When set, it periodically issues a Flush() to all data source, forcing them
3776 // to commit their data into the tracing service. This can be used for
3777 // quasi-real-time streaming mode and to guarantee some partial ordering of
3778 // events in the trace in windows of X ms.
3779 optional uint32 flush_period_ms = 13;
3780
3781 // Wait for this long for producers to acknowledge flush requests.
3782 // Default 5s.
3783 optional uint32 flush_timeout_ms = 14;
3784
Siddhartha Sb63f61e2019-05-03 16:19:51 -07003785 reserved 15; // |disable_clock_snapshotting| moved.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003786
3787 // Android-only. If set, sends an intent to the Traceur system app when the
3788 // trace ends to notify it about the trace readiness.
3789 optional bool notify_traceur = 16;
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003790
3791 // Triggers allow producers to start or stop the tracing session when an event
3792 // occurs.
3793 //
3794 // For example if we are tracing probabilistically, most traces will be
3795 // uninteresting. Triggers allow us to keep only the interesting ones such as
3796 // those traces during which the device temperature reached a certain
3797 // threshold. In this case the producer can activate a trigger to keep
3798 // (STOP_TRACING) the trace, otherwise it can also begin a trace
3799 // (START_TRACING) because it knows something is about to happen.
3800 message TriggerConfig {
3801 enum TriggerMode {
3802 UNSPECIFIED = 0;
3803
3804 // When this mode is chosen, data sources are not started until one of the
3805 // |triggers| are received. This supports early initialization and fast
3806 // starting of the tracing system. On triggering, the session will then
3807 // record for |stop_delay_ms|. However if no trigger is seen
3808 // after |trigger_timeout_ms| the session will be stopped and no data will
3809 // be returned.
3810 START_TRACING = 1;
3811
3812 // When this mode is chosen, the session will be started via the normal
3813 // EnableTracing() & StartTracing(). If no trigger is ever seen
3814 // the session will be stopped after |trigger_timeout_ms| and no data will
3815 // be returned. However if triggered the trace will stop after
3816 // |stop_delay_ms| and any data in the buffer will be returned to the
3817 // consumer.
3818 STOP_TRACING = 2;
3819 }
3820 optional TriggerMode trigger_mode = 1;
3821
3822 message Trigger {
3823 // The producer must specify this name to activate the trigger.
3824 optional string name = 1;
3825
3826 // The a std::regex that will match the producer that can activate this
3827 // trigger. This is optional. If unset any producers can activate this
3828 // trigger.
3829 optional string producer_name_regex = 2;
3830
3831 // After a trigger is received either in START_TRACING or STOP_TRACING
3832 // mode then the trace will end |stop_delay_ms| after triggering.
3833 optional uint32 stop_delay_ms = 3;
3834 }
3835 // A list of triggers which are related to this configuration. If ANY
3836 // trigger is seen then an action will be performed based on |trigger_mode|.
3837 repeated Trigger triggers = 2;
3838
3839 // Required and must be positive if a TriggerConfig is specified. This is
3840 // how long this TraceConfig should wait for a trigger to arrive. After this
3841 // period of time if no trigger is seen the TracingSession will be cleaned
3842 // up.
3843 optional uint32 trigger_timeout_ms = 3;
3844 }
3845 optional TriggerConfig trigger_config = 17;
Stephen Nusko9fa59cb2019-04-15 04:19:16 +01003846
3847 // When this is non-empty the perfetto command line tool will ignore the rest
3848 // of this TraceConfig and instead connect to the perfetto service as a
3849 // producer and send these triggers, potentially stopping or starting traces
3850 // that were previous configured to use a TriggerConfig.
3851 repeated string activate_triggers = 18;
Hector Dearman085dc3c2019-04-23 11:48:10 +01003852
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01003853 // Configuration for trace contents that reference earlier trace data. For
3854 // example, a data source might intern strings, and emit packets containing
3855 // {interned id : string} pairs. Future packets from that data source can then
3856 // use the interned ids instead of duplicating the raw string contents. The
3857 // trace parser will then need to use that interning table to fully interpret
3858 // the rest of the trace.
3859 message IncrementalStateConfig {
Ryan Savitski0b4008a2019-05-13 17:55:53 +01003860 // If nonzero, notify eligible data sources to clear their incremental state
3861 // periodically, with the given period. The notification is sent only to
3862 // data sources that have |handles_incremental_state_clear| set in their
3863 // DataSourceDescriptor. The notification requests that the data source
3864 // stops referring to past trace contents. This is particularly useful when
3865 // tracing in ring buffer mode, where it is not exceptional to overwrite old
3866 // trace data.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01003867 //
3868 // Warning: this time-based global clearing is likely to be removed in the
Ryan Savitski0b4008a2019-05-13 17:55:53 +01003869 // future, to be replaced with a smarter way of sending the notifications
3870 // only when necessary.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01003871 optional uint32 clear_period_ms = 1;
3872 }
3873 optional IncrementalStateConfig incremental_state_config = 21;
3874
Hector Dearman085dc3c2019-04-23 11:48:10 +01003875 // Additional guardrail used by the Perfetto command line client.
3876 // On user builds when --dropbox is set perfetto will refuse to trace unless
3877 // this is also set.
3878 // Added in Q.
3879 optional bool allow_user_build_tracing = 19;
Hector Dearmanfb4d0732019-05-19 15:44:56 +01003880
3881 // If set the tracing service will ensure there is at most one tracing session
3882 // with this key.
3883 optional string unique_session_name = 22;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003884}
3885
3886// End of protos/perfetto/config/trace_config.proto
3887
3888// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
3889
3890// Configuration for go/heapprofd.
3891message HeapprofdConfig {
3892 message ContinuousDumpConfig {
3893 // ms to wait before first dump.
3894 optional uint32 dump_phase_ms = 5;
3895 // ms to wait between following dumps.
3896 optional uint32 dump_interval_ms = 6;
3897 };
3898
3899 // Set to 1 for perfect accuracy.
3900 // Otherwise, sample every sample_interval_bytes on average.
Florian Mayer81df6cb2019-04-15 11:32:13 +01003901 //
3902 // See https://docs.perfetto.dev/#/heapprofd?id=sampling-interval for more
3903 // details.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003904 optional uint64 sampling_interval_bytes = 1;
3905
3906 // E.g. surfaceflinger, com.android.phone
Florian Mayerb524cbb2019-04-05 18:14:35 +01003907 // This input is normalized in the following way: if it contains slashes,
3908 // everything up to the last slash is discarded. If it contains "@",
3909 // everything after the first @ is discared.
3910 // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger.
3911 // This transformation is also applied to the processes' command lines when
3912 // matching.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003913 repeated string process_cmdline = 2;
Florian Mayerb524cbb2019-04-05 18:14:35 +01003914
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003915 // For watermark based triggering or local debugging.
3916 repeated uint64 pid = 4;
Florian Mayera774cb72019-04-29 14:20:43 +01003917
3918 // Profile all processes eligible for profiling on the system.
3919 // See https://docs.perfetto.dev/#/heapprofd?id=target-processes for which
3920 // processes are eligible.
3921 //
3922 // On unmodified userdebug builds, this will lead to system crashes. Zygote
3923 // will crash when trying to launch a new process as it will have an
3924 // unexpected open socket to heapprofd.
3925 //
3926 // heapprofd will likely be overloaded by the amount of data for low
3927 // sampling intervals.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003928 optional bool all = 5;
Florian Mayera774cb72019-04-29 14:20:43 +01003929
Florian Mayer9c6538d2019-03-07 14:32:05 +00003930 // Do not emit function names for mappings starting with this prefix.
3931 // E.g. /system to not emit symbols for any system libraries.
3932 repeated string skip_symbol_prefix = 7;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003933
3934 // Dump once at the end of the trace, emitting the heap dump at maximum
3935 // memory usage.
3936 // optional bool retain_max = 5; // TODO(fmayer): Implement
3937
3938 // Dump at a predefined interval.
3939 optional ContinuousDumpConfig continuous_dump_config = 6;
Florian Mayer92e8bf92019-03-28 13:44:45 +00003940
3941 // Size of the shared memory buffer between the profiled processes and
3942 // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500
3943 // MiB.
Florian Mayer91b3c6d2019-04-10 13:44:37 -07003944 //
3945 // Needs to be:
3946 // * at least 8192,
3947 // * a power of two,
3948 // * a multiple of 4096.
Florian Mayer92e8bf92019-03-28 13:44:45 +00003949 optional uint64 shmem_size_bytes = 8;
Florian Mayerd6bdb6f2019-05-03 17:53:58 +01003950
3951 // When the shmem buffer is full, block the client instead of ending the
3952 // trace. Use with caution as this will significantly slow down the target
3953 // process.
3954 optional bool block_client = 9;
Florian Mayer225559a2019-05-09 14:28:26 +01003955
3956 // Do not profile processes from startup, only match already running
3957 // processes.
3958 //
3959 // Can not be set at the same time as no_running.
3960 optional bool no_startup = 10;
3961
3962 // Do not profile running processes. Only match processes on startup.
3963 //
3964 // Can not be set at the same time as no_startup.
3965 optional bool no_running = 11;
Florian Mayer7142c7c2019-05-20 18:11:41 +01003966
3967 // Gather information on how many bytes of allocations are on non-referenced
3968 // pages. The way to use this generally is:
3969 // 1. Start profile of app.
3970 // 2. Start app.
3971 // 3. echo 1 > /proc/$APP_PID/clear_refs.
3972 // 4. Do operations.
3973 // 5. End profile.
3974 //
3975 // You can then find the allocations that were not used for the operations you
3976 // did in step 4.
3977 optional bool idle_allocations = 12;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003978}
3979
3980// End of protos/perfetto/config/profiling/heapprofd_config.proto