blob: 761a636b4ec8026a0e49f1d9874151236e6bf36a [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
Primiano Tucci64df2ca2019-01-03 22:26:47 +0000182// Begin of protos/perfetto/trace/android/android_log.proto
183
184message AndroidLogPacket {
185 message LogEvent {
186 // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
187 optional AndroidLogId log_id = 1;
188
189 // PID (TGID), TID and UID of the task that emitted the event.
190 optional int32 pid = 2;
191 optional int32 tid = 3;
192 optional int32 uid = 4;
193
194 // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
195 // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
196 // processor will take care of realigning clocks using the ClockSnapshot(s).
197 optional uint64 timestamp = 5;
198
199 // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
200 // the second column of /system/etc/event-log-tags. For all other events,
201 // |tag| is the app-specified argument passed to __android_log_write().
202 optional string tag = 6;
203
204 // Empty when log_id == LID_EVENTS.
205 optional AndroidLogPriority prio = 7;
206
207 // Empty when log_id == LID_EVENTS.
208 optional string message = 8;
209
210 message Arg {
211 optional string name = 1;
212 oneof value {
213 int64 int_value = 2;
214 float float_value = 3;
215 string string_value = 4;
216 }
217 }
218 // Only populated when log_id == LID_EVENTS.
219 repeated Arg args = 9;
220 }
221
222 repeated LogEvent events = 1;
223
224 // Stats are emitted only upon Flush() and are monotonic (i.e. they are
225 // absolute counters since the beginning of the lifetime of the tracing
226 // session and NOT relative to the previous Stats snapshot).
227 message Stats {
228 // Total number of log events seen, including errors and skipped entries
229 // (num of events stored in the trace = total - failed - skipped).
230 optional uint64 num_total = 1;
231
232 // Parser failures.
233 optional uint64 num_failed = 2;
234
235 // Messages skipped due to filters.
236 optional uint64 num_skipped = 3;
237 }
238 optional Stats stats = 2;
239}
240
241// End of protos/perfetto/trace/android/android_log.proto
242
Hector Dearmane92c6742018-11-22 21:42:39 +0000243// Begin of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100244
Hector Dearmane92c6742018-11-22 21:42:39 +0000245// A snapshot of clock readings to allow for trace alignment.
246message ClockSnapshot {
247 message Clock {
248 enum Type {
249 UNKNOWN = 0;
250 REALTIME = 1;
251 REALTIME_COARSE = 2;
252 MONOTONIC = 3;
253 MONOTONIC_COARSE = 4;
254 MONOTONIC_RAW = 5;
255 BOOTTIME = 6;
256 PROCESS_CPUTIME = 7;
257 THREAD_CPUTIME = 8;
258 }
259 optional Type type = 1;
260 optional uint64 timestamp = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100261 }
Hector Dearmane92c6742018-11-22 21:42:39 +0000262 repeated Clock clocks = 1;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100263}
264
Hector Dearmane92c6742018-11-22 21:42:39 +0000265// End of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100266
Florian Mayerbeba7262018-04-17 19:05:43 +0100267// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto
268
269// Represents the mapping between inode numbers in a block device and their path
270// on the filesystem
271message InodeFileMap {
272 // Representation of Entry
273 message Entry {
274 optional uint64 inode_number = 1;
275
276 // The path to the file, e.g. "etc/file.xml"
277 // List of strings for multiple hardlinks
278 repeated string paths = 2;
279
280 // The file type
281 enum Type {
282 UNKNOWN = 0;
283 FILE = 1;
284 DIRECTORY = 2;
285 }
286 optional Type type = 3;
287 }
288
289 optional uint64 block_device_id = 1;
290
291 // The mount points of the block device, e.g. ["system"].
292 repeated string mount_points = 2;
293
294 // The list of all the entries from the block device
295 repeated Entry entries = 3;
296}
297
298// End of protos/perfetto/trace/filesystem/inode_file_map.proto
299
Hector Dearmane0e57802018-11-21 16:09:56 +0000300// Begin of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100301
302message BinderTransactionFtraceEvent {
303 optional int32 debug_id = 1;
304 optional int32 target_node = 2;
305 optional int32 to_proc = 3;
306 optional int32 to_thread = 4;
307 optional int32 reply = 5;
308 optional uint32 code = 6;
309 optional uint32 flags = 7;
310}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100311message BinderTransactionReceivedFtraceEvent {
312 optional int32 debug_id = 1;
313}
Hector Dearmane0e57802018-11-21 16:09:56 +0000314message BinderSetPriorityFtraceEvent {
315 optional int32 proc = 1;
316 optional int32 thread = 2;
317 optional uint32 old_prio = 3;
318 optional uint32 new_prio = 4;
319 optional uint32 desired_prio = 5;
320}
321message BinderLockFtraceEvent {
322 optional string tag = 1;
323}
324message BinderLockedFtraceEvent {
325 optional string tag = 1;
326}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100327message BinderUnlockFtraceEvent {
328 optional string tag = 1;
329}
Hector Dearmane0e57802018-11-21 16:09:56 +0000330message BinderTransactionAllocBufFtraceEvent {
331 optional uint64 data_size = 1;
332 optional int32 debug_id = 2;
333 optional uint64 offsets_size = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100334}
335
Hector Dearmane0e57802018-11-21 16:09:56 +0000336// End of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100337
Hector Dearmane0e57802018-11-21 16:09:56 +0000338// Begin of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100339
340message BlockRqIssueFtraceEvent {
341 optional uint64 dev = 1;
342 optional uint64 sector = 2;
343 optional uint32 nr_sector = 3;
344 optional uint32 bytes = 4;
345 optional string rwbs = 5;
346 optional string comm = 6;
347 optional string cmd = 7;
348}
Hector Dearmane0e57802018-11-21 16:09:56 +0000349message BlockBioBackmergeFtraceEvent {
350 optional uint64 dev = 1;
351 optional uint64 sector = 2;
352 optional uint32 nr_sector = 3;
353 optional string rwbs = 4;
354 optional string comm = 5;
355}
356message BlockBioBounceFtraceEvent {
357 optional uint64 dev = 1;
358 optional uint64 sector = 2;
359 optional uint32 nr_sector = 3;
360 optional string rwbs = 4;
361 optional string comm = 5;
362}
363message BlockBioCompleteFtraceEvent {
364 optional uint64 dev = 1;
365 optional uint64 sector = 2;
366 optional uint32 nr_sector = 3;
367 optional int32 error = 4;
368 optional string rwbs = 5;
369}
370message BlockBioFrontmergeFtraceEvent {
371 optional uint64 dev = 1;
372 optional uint64 sector = 2;
373 optional uint32 nr_sector = 3;
374 optional string rwbs = 4;
375 optional string comm = 5;
376}
377message BlockBioQueueFtraceEvent {
378 optional uint64 dev = 1;
379 optional uint64 sector = 2;
380 optional uint32 nr_sector = 3;
381 optional string rwbs = 4;
382 optional string comm = 5;
383}
384message BlockBioRemapFtraceEvent {
385 optional uint64 dev = 1;
386 optional uint64 sector = 2;
387 optional uint32 nr_sector = 3;
388 optional uint64 old_dev = 4;
389 optional uint64 old_sector = 5;
390 optional string rwbs = 6;
391}
392message BlockDirtyBufferFtraceEvent {
393 optional uint64 dev = 1;
394 optional uint64 sector = 2;
395 optional uint64 size = 3;
396}
397message BlockGetrqFtraceEvent {
398 optional uint64 dev = 1;
399 optional uint64 sector = 2;
400 optional uint32 nr_sector = 3;
401 optional string rwbs = 4;
402 optional string comm = 5;
403}
404message BlockPlugFtraceEvent {
405 optional string comm = 1;
406}
407message BlockRqAbortFtraceEvent {
408 optional uint64 dev = 1;
409 optional uint64 sector = 2;
410 optional uint32 nr_sector = 3;
411 optional int32 errors = 4;
412 optional string rwbs = 5;
413 optional string cmd = 6;
414}
415message BlockRqCompleteFtraceEvent {
416 optional uint64 dev = 1;
417 optional uint64 sector = 2;
418 optional uint32 nr_sector = 3;
419 optional int32 errors = 4;
420 optional string rwbs = 5;
421 optional string cmd = 6;
422}
423message BlockRqInsertFtraceEvent {
424 optional uint64 dev = 1;
425 optional uint64 sector = 2;
426 optional uint32 nr_sector = 3;
427 optional uint32 bytes = 4;
428 optional string rwbs = 5;
429 optional string comm = 6;
430 optional string cmd = 7;
431}
432message BlockRqRemapFtraceEvent {
433 optional uint64 dev = 1;
434 optional uint64 sector = 2;
435 optional uint32 nr_sector = 3;
436 optional uint64 old_dev = 4;
437 optional uint64 old_sector = 5;
438 optional uint32 nr_bios = 6;
439 optional string rwbs = 7;
440}
441message BlockRqRequeueFtraceEvent {
442 optional uint64 dev = 1;
443 optional uint64 sector = 2;
444 optional uint32 nr_sector = 3;
445 optional int32 errors = 4;
446 optional string rwbs = 5;
447 optional string cmd = 6;
448}
449message BlockSleeprqFtraceEvent {
450 optional uint64 dev = 1;
451 optional uint64 sector = 2;
452 optional uint32 nr_sector = 3;
453 optional string rwbs = 4;
454 optional string comm = 5;
455}
456message BlockSplitFtraceEvent {
457 optional uint64 dev = 1;
458 optional uint64 sector = 2;
459 optional uint64 new_sector = 3;
460 optional string rwbs = 4;
461 optional string comm = 5;
462}
463message BlockTouchBufferFtraceEvent {
464 optional uint64 dev = 1;
465 optional uint64 sector = 2;
466 optional uint64 size = 3;
467}
468message BlockUnplugFtraceEvent {
469 optional int32 nr_rq = 1;
470 optional string comm = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100471}
472
Hector Dearmane0e57802018-11-21 16:09:56 +0000473// End of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100474
Hector Dearmane0e57802018-11-21 16:09:56 +0000475// Begin of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100476
Hector Dearmane0e57802018-11-21 16:09:56 +0000477message ClkEnableFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +0100478 optional string name = 1;
Hector Dearmane0e57802018-11-21 16:09:56 +0000479}
480message ClkDisableFtraceEvent {
481 optional string name = 1;
482}
483message ClkSetRateFtraceEvent {
484 optional string name = 1;
485 optional uint64 rate = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100486}
487
Hector Dearmane0e57802018-11-21 16:09:56 +0000488// End of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100489
Hector Dearmane0e57802018-11-21 16:09:56 +0000490// Begin of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100491
492message Ext4DaWriteBeginFtraceEvent {
493 optional uint64 dev = 1;
494 optional uint64 ino = 2;
495 optional int64 pos = 3;
496 optional uint32 len = 4;
497 optional uint32 flags = 5;
498}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100499message Ext4DaWriteEndFtraceEvent {
500 optional uint64 dev = 1;
501 optional uint64 ino = 2;
502 optional int64 pos = 3;
503 optional uint32 len = 4;
504 optional uint32 copied = 5;
505}
Hector Dearmane0e57802018-11-21 16:09:56 +0000506message Ext4SyncFileEnterFtraceEvent {
507 optional uint64 dev = 1;
508 optional uint64 ino = 2;
509 optional uint64 parent = 3;
510 optional int32 datasync = 4;
511}
512message Ext4SyncFileExitFtraceEvent {
513 optional uint64 dev = 1;
514 optional uint64 ino = 2;
515 optional int32 ret = 3;
516}
517message Ext4AllocDaBlocksFtraceEvent {
518 optional uint64 dev = 1;
519 optional uint64 ino = 2;
520 optional uint32 data_blocks = 3;
521 optional uint32 meta_blocks = 4;
522}
523message Ext4AllocateBlocksFtraceEvent {
524 optional uint64 dev = 1;
525 optional uint64 ino = 2;
526 optional uint64 block = 3;
527 optional uint32 len = 4;
528 optional uint32 logical = 5;
529 optional uint32 lleft = 6;
530 optional uint32 lright = 7;
531 optional uint64 goal = 8;
532 optional uint64 pleft = 9;
533 optional uint64 pright = 10;
534 optional uint32 flags = 11;
535}
536message Ext4AllocateInodeFtraceEvent {
537 optional uint64 dev = 1;
538 optional uint64 ino = 2;
539 optional uint64 dir = 3;
540 optional uint32 mode = 4;
541}
542message Ext4BeginOrderedTruncateFtraceEvent {
543 optional uint64 dev = 1;
544 optional uint64 ino = 2;
545 optional int64 new_size = 3;
546}
547message Ext4CollapseRangeFtraceEvent {
548 optional uint64 dev = 1;
549 optional uint64 ino = 2;
550 optional int64 offset = 3;
551 optional int64 len = 4;
552}
553message Ext4DaReleaseSpaceFtraceEvent {
554 optional uint64 dev = 1;
555 optional uint64 ino = 2;
556 optional uint64 i_blocks = 3;
557 optional int32 freed_blocks = 4;
558 optional int32 reserved_data_blocks = 5;
559 optional int32 reserved_meta_blocks = 6;
560 optional int32 allocated_meta_blocks = 7;
561 optional uint32 mode = 8;
562}
563message Ext4DaReserveSpaceFtraceEvent {
564 optional uint64 dev = 1;
565 optional uint64 ino = 2;
566 optional uint64 i_blocks = 3;
567 optional int32 reserved_data_blocks = 4;
568 optional int32 reserved_meta_blocks = 5;
569 optional uint32 mode = 6;
570 optional int32 md_needed = 7;
571}
572message Ext4DaUpdateReserveSpaceFtraceEvent {
573 optional uint64 dev = 1;
574 optional uint64 ino = 2;
575 optional uint64 i_blocks = 3;
576 optional int32 used_blocks = 4;
577 optional int32 reserved_data_blocks = 5;
578 optional int32 reserved_meta_blocks = 6;
579 optional int32 allocated_meta_blocks = 7;
580 optional int32 quota_claim = 8;
581 optional uint32 mode = 9;
582}
583message Ext4DaWritePagesFtraceEvent {
584 optional uint64 dev = 1;
585 optional uint64 ino = 2;
586 optional uint64 first_page = 3;
587 optional int64 nr_to_write = 4;
588 optional int32 sync_mode = 5;
589 optional uint64 b_blocknr = 6;
590 optional uint32 b_size = 7;
591 optional uint32 b_state = 8;
592 optional int32 io_done = 9;
593 optional int32 pages_written = 10;
594}
595message Ext4DaWritePagesExtentFtraceEvent {
596 optional uint64 dev = 1;
597 optional uint64 ino = 2;
598 optional uint64 lblk = 3;
599 optional uint32 len = 4;
600 optional uint32 flags = 5;
601}
602message Ext4DirectIOEnterFtraceEvent {
603 optional uint64 dev = 1;
604 optional uint64 ino = 2;
605 optional int64 pos = 3;
606 optional uint64 len = 4;
607 optional int32 rw = 5;
608}
609message Ext4DirectIOExitFtraceEvent {
610 optional uint64 dev = 1;
611 optional uint64 ino = 2;
612 optional int64 pos = 3;
613 optional uint64 len = 4;
614 optional int32 rw = 5;
615 optional int32 ret = 6;
616}
617message Ext4DiscardBlocksFtraceEvent {
618 optional uint64 dev = 1;
619 optional uint64 blk = 2;
620 optional uint64 count = 3;
621}
622message Ext4DiscardPreallocationsFtraceEvent {
623 optional uint64 dev = 1;
624 optional uint64 ino = 2;
625}
626message Ext4DropInodeFtraceEvent {
627 optional uint64 dev = 1;
628 optional uint64 ino = 2;
629 optional int32 drop = 3;
630}
631message Ext4EsCacheExtentFtraceEvent {
632 optional uint64 dev = 1;
633 optional uint64 ino = 2;
634 optional uint32 lblk = 3;
635 optional uint32 len = 4;
636 optional uint64 pblk = 5;
637 optional uint32 status = 6;
638}
639message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
640 optional uint64 dev = 1;
641 optional uint64 ino = 2;
642 optional uint32 lblk = 3;
643}
644message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
645 optional uint64 dev = 1;
646 optional uint64 ino = 2;
647 optional uint32 lblk = 3;
648 optional uint32 len = 4;
649 optional uint64 pblk = 5;
650 optional uint64 status = 6;
651}
652message Ext4EsInsertExtentFtraceEvent {
653 optional uint64 dev = 1;
654 optional uint64 ino = 2;
655 optional uint32 lblk = 3;
656 optional uint32 len = 4;
657 optional uint64 pblk = 5;
658 optional uint64 status = 6;
659}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100660message Ext4EsLookupExtentEnterFtraceEvent {
661 optional uint64 dev = 1;
662 optional uint64 ino = 2;
663 optional uint32 lblk = 3;
664}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100665message Ext4EsLookupExtentExitFtraceEvent {
666 optional uint64 dev = 1;
667 optional uint64 ino = 2;
668 optional uint32 lblk = 3;
669 optional uint32 len = 4;
670 optional uint64 pblk = 5;
Florian Mayer7c9e3b22018-04-26 11:55:15 +0100671 optional uint64 status = 6;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100672 optional int32 found = 7;
673}
Hector Dearmane0e57802018-11-21 16:09:56 +0000674message Ext4EsRemoveExtentFtraceEvent {
675 optional uint64 dev = 1;
676 optional uint64 ino = 2;
677 optional int64 lblk = 3;
678 optional int64 len = 4;
679}
680message Ext4EsShrinkFtraceEvent {
681 optional uint64 dev = 1;
682 optional int32 nr_shrunk = 2;
683 optional uint64 scan_time = 3;
684 optional int32 nr_skipped = 4;
685 optional int32 retried = 5;
686}
687message Ext4EsShrinkCountFtraceEvent {
688 optional uint64 dev = 1;
689 optional int32 nr_to_scan = 2;
690 optional int32 cache_cnt = 3;
691}
692message Ext4EsShrinkScanEnterFtraceEvent {
693 optional uint64 dev = 1;
694 optional int32 nr_to_scan = 2;
695 optional int32 cache_cnt = 3;
696}
697message Ext4EsShrinkScanExitFtraceEvent {
698 optional uint64 dev = 1;
699 optional int32 nr_shrunk = 2;
700 optional int32 cache_cnt = 3;
701}
702message Ext4EvictInodeFtraceEvent {
703 optional uint64 dev = 1;
704 optional uint64 ino = 2;
705 optional int32 nlink = 3;
706}
707message Ext4ExtConvertToInitializedEnterFtraceEvent {
708 optional uint64 dev = 1;
709 optional uint64 ino = 2;
710 optional uint32 m_lblk = 3;
711 optional uint32 m_len = 4;
712 optional uint32 u_lblk = 5;
713 optional uint32 u_len = 6;
714 optional uint64 u_pblk = 7;
715}
716message Ext4ExtConvertToInitializedFastpathFtraceEvent {
717 optional uint64 dev = 1;
718 optional uint64 ino = 2;
719 optional uint32 m_lblk = 3;
720 optional uint32 m_len = 4;
721 optional uint32 u_lblk = 5;
722 optional uint32 u_len = 6;
723 optional uint64 u_pblk = 7;
724 optional uint32 i_lblk = 8;
725 optional uint32 i_len = 9;
726 optional uint64 i_pblk = 10;
727}
728message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
729 optional uint64 dev = 1;
730 optional uint64 ino = 2;
731 optional int32 flags = 3;
732 optional uint32 lblk = 4;
733 optional uint64 pblk = 5;
734 optional uint32 len = 6;
735 optional uint32 allocated = 7;
736 optional uint64 newblk = 8;
737}
738message Ext4ExtInCacheFtraceEvent {
739 optional uint64 dev = 1;
740 optional uint64 ino = 2;
741 optional uint32 lblk = 3;
742 optional int32 ret = 4;
743}
744message Ext4ExtLoadExtentFtraceEvent {
745 optional uint64 dev = 1;
746 optional uint64 ino = 2;
747 optional uint64 pblk = 3;
748 optional uint32 lblk = 4;
749}
750message Ext4ExtMapBlocksEnterFtraceEvent {
751 optional uint64 dev = 1;
752 optional uint64 ino = 2;
753 optional uint32 lblk = 3;
754 optional uint32 len = 4;
755 optional uint32 flags = 5;
756}
757message Ext4ExtMapBlocksExitFtraceEvent {
758 optional uint64 dev = 1;
759 optional uint64 ino = 2;
760 optional uint32 flags = 3;
761 optional uint64 pblk = 4;
762 optional uint32 lblk = 5;
763 optional uint32 len = 6;
764 optional uint32 mflags = 7;
765 optional int32 ret = 8;
766}
767message Ext4ExtPutInCacheFtraceEvent {
768 optional uint64 dev = 1;
769 optional uint64 ino = 2;
770 optional uint32 lblk = 3;
771 optional uint32 len = 4;
772 optional uint64 start = 5;
773}
774message Ext4ExtRemoveSpaceFtraceEvent {
775 optional uint64 dev = 1;
776 optional uint64 ino = 2;
777 optional uint32 start = 3;
778 optional uint32 end = 4;
779 optional int32 depth = 5;
780}
781message Ext4ExtRemoveSpaceDoneFtraceEvent {
782 optional uint64 dev = 1;
783 optional uint64 ino = 2;
784 optional uint32 start = 3;
785 optional uint32 end = 4;
786 optional int32 depth = 5;
787 optional int64 partial = 6;
788 optional uint32 eh_entries = 7;
789}
790message Ext4ExtRmIdxFtraceEvent {
791 optional uint64 dev = 1;
792 optional uint64 ino = 2;
793 optional uint64 pblk = 3;
794}
795message Ext4ExtRmLeafFtraceEvent {
796 optional uint64 dev = 1;
797 optional uint64 ino = 2;
798 optional int64 partial = 3;
799 optional uint32 start = 4;
800 optional uint32 ee_lblk = 5;
801 optional uint64 ee_pblk = 6;
802 optional int32 ee_len = 7;
803}
804message Ext4ExtShowExtentFtraceEvent {
805 optional uint64 dev = 1;
806 optional uint64 ino = 2;
807 optional uint64 pblk = 3;
808 optional uint32 lblk = 4;
809 optional uint32 len = 5;
810}
811message Ext4FallocateEnterFtraceEvent {
812 optional uint64 dev = 1;
813 optional uint64 ino = 2;
814 optional int64 offset = 3;
815 optional int64 len = 4;
816 optional int32 mode = 5;
817 optional int64 pos = 6;
818}
819message Ext4FallocateExitFtraceEvent {
820 optional uint64 dev = 1;
821 optional uint64 ino = 2;
822 optional int64 pos = 3;
823 optional uint32 blocks = 4;
824 optional int32 ret = 5;
825}
826message Ext4FindDelallocRangeFtraceEvent {
827 optional uint64 dev = 1;
828 optional uint64 ino = 2;
829 optional uint32 from = 3;
830 optional uint32 to = 4;
831 optional int32 reverse = 5;
832 optional int32 found = 6;
833 optional uint32 found_blk = 7;
834}
835message Ext4ForgetFtraceEvent {
836 optional uint64 dev = 1;
837 optional uint64 ino = 2;
838 optional uint64 block = 3;
839 optional int32 is_metadata = 4;
840 optional uint32 mode = 5;
841}
842message Ext4FreeBlocksFtraceEvent {
843 optional uint64 dev = 1;
844 optional uint64 ino = 2;
845 optional uint64 block = 3;
846 optional uint64 count = 4;
847 optional int32 flags = 5;
848 optional uint32 mode = 6;
849}
850message Ext4FreeInodeFtraceEvent {
851 optional uint64 dev = 1;
852 optional uint64 ino = 2;
853 optional uint32 uid = 3;
854 optional uint32 gid = 4;
855 optional uint64 blocks = 5;
856 optional uint32 mode = 6;
857}
858message Ext4GetImpliedClusterAllocExitFtraceEvent {
859 optional uint64 dev = 1;
860 optional uint32 flags = 2;
861 optional uint32 lblk = 3;
862 optional uint64 pblk = 4;
863 optional uint32 len = 5;
864 optional int32 ret = 6;
865}
866message Ext4GetReservedClusterAllocFtraceEvent {
867 optional uint64 dev = 1;
868 optional uint64 ino = 2;
869 optional uint32 lblk = 3;
870 optional uint32 len = 4;
871}
872message Ext4IndMapBlocksEnterFtraceEvent {
873 optional uint64 dev = 1;
874 optional uint64 ino = 2;
875 optional uint32 lblk = 3;
876 optional uint32 len = 4;
877 optional uint32 flags = 5;
878}
879message Ext4IndMapBlocksExitFtraceEvent {
880 optional uint64 dev = 1;
881 optional uint64 ino = 2;
882 optional uint32 flags = 3;
883 optional uint64 pblk = 4;
884 optional uint32 lblk = 5;
885 optional uint32 len = 6;
886 optional uint32 mflags = 7;
887 optional int32 ret = 8;
888}
889message Ext4InsertRangeFtraceEvent {
890 optional uint64 dev = 1;
891 optional uint64 ino = 2;
892 optional int64 offset = 3;
893 optional int64 len = 4;
894}
895message Ext4InvalidatepageFtraceEvent {
896 optional uint64 dev = 1;
897 optional uint64 ino = 2;
898 optional uint64 index = 3;
899 optional uint64 offset = 4;
900 optional uint32 length = 5;
901}
902message Ext4JournalStartFtraceEvent {
903 optional uint64 dev = 1;
904 optional uint64 ip = 2;
905 optional int32 blocks = 3;
906 optional int32 rsv_blocks = 4;
907 optional int32 nblocks = 5;
908}
909message Ext4JournalStartReservedFtraceEvent {
910 optional uint64 dev = 1;
911 optional uint64 ip = 2;
912 optional int32 blocks = 3;
913}
914message Ext4JournalledInvalidatepageFtraceEvent {
915 optional uint64 dev = 1;
916 optional uint64 ino = 2;
917 optional uint64 index = 3;
918 optional uint64 offset = 4;
919 optional uint32 length = 5;
920}
921message Ext4JournalledWriteEndFtraceEvent {
922 optional uint64 dev = 1;
923 optional uint64 ino = 2;
924 optional int64 pos = 3;
925 optional uint32 len = 4;
926 optional uint32 copied = 5;
927}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100928message Ext4LoadInodeFtraceEvent {
929 optional uint64 dev = 1;
930 optional uint64 ino = 2;
931}
Hector Dearmane0e57802018-11-21 16:09:56 +0000932message Ext4LoadInodeBitmapFtraceEvent {
933 optional uint64 dev = 1;
934 optional uint32 group = 2;
935}
936message Ext4MarkInodeDirtyFtraceEvent {
937 optional uint64 dev = 1;
938 optional uint64 ino = 2;
939 optional uint64 ip = 3;
940}
941message Ext4MbBitmapLoadFtraceEvent {
942 optional uint64 dev = 1;
943 optional uint32 group = 2;
944}
945message Ext4MbBuddyBitmapLoadFtraceEvent {
946 optional uint64 dev = 1;
947 optional uint32 group = 2;
948}
949message Ext4MbDiscardPreallocationsFtraceEvent {
950 optional uint64 dev = 1;
951 optional int32 needed = 2;
952}
953message Ext4MbNewGroupPaFtraceEvent {
954 optional uint64 dev = 1;
955 optional uint64 ino = 2;
956 optional uint64 pa_pstart = 3;
957 optional uint64 pa_lstart = 4;
958 optional uint32 pa_len = 5;
959}
960message Ext4MbNewInodePaFtraceEvent {
961 optional uint64 dev = 1;
962 optional uint64 ino = 2;
963 optional uint64 pa_pstart = 3;
964 optional uint64 pa_lstart = 4;
965 optional uint32 pa_len = 5;
966}
967message Ext4MbReleaseGroupPaFtraceEvent {
968 optional uint64 dev = 1;
969 optional uint64 pa_pstart = 2;
970 optional uint32 pa_len = 3;
971}
972message Ext4MbReleaseInodePaFtraceEvent {
973 optional uint64 dev = 1;
974 optional uint64 ino = 2;
975 optional uint64 block = 3;
976 optional uint32 count = 4;
977}
978message Ext4MballocAllocFtraceEvent {
979 optional uint64 dev = 1;
980 optional uint64 ino = 2;
981 optional uint32 orig_logical = 3;
982 optional int32 orig_start = 4;
983 optional uint32 orig_group = 5;
984 optional int32 orig_len = 6;
985 optional uint32 goal_logical = 7;
986 optional int32 goal_start = 8;
987 optional uint32 goal_group = 9;
988 optional int32 goal_len = 10;
989 optional uint32 result_logical = 11;
990 optional int32 result_start = 12;
991 optional uint32 result_group = 13;
992 optional int32 result_len = 14;
993 optional uint32 found = 15;
994 optional uint32 groups = 16;
995 optional uint32 buddy = 17;
996 optional uint32 flags = 18;
997 optional uint32 tail = 19;
998 optional uint32 cr = 20;
999}
1000message Ext4MballocDiscardFtraceEvent {
1001 optional uint64 dev = 1;
1002 optional uint64 ino = 2;
1003 optional int32 result_start = 3;
1004 optional uint32 result_group = 4;
1005 optional int32 result_len = 5;
1006}
1007message Ext4MballocFreeFtraceEvent {
1008 optional uint64 dev = 1;
1009 optional uint64 ino = 2;
1010 optional int32 result_start = 3;
1011 optional uint32 result_group = 4;
1012 optional int32 result_len = 5;
1013}
1014message Ext4MballocPreallocFtraceEvent {
1015 optional uint64 dev = 1;
1016 optional uint64 ino = 2;
1017 optional uint32 orig_logical = 3;
1018 optional int32 orig_start = 4;
1019 optional uint32 orig_group = 5;
1020 optional int32 orig_len = 6;
1021 optional uint32 result_logical = 7;
1022 optional int32 result_start = 8;
1023 optional uint32 result_group = 9;
1024 optional int32 result_len = 10;
1025}
1026message Ext4OtherInodeUpdateTimeFtraceEvent {
1027 optional uint64 dev = 1;
1028 optional uint64 ino = 2;
1029 optional uint64 orig_ino = 3;
1030 optional uint32 uid = 4;
1031 optional uint32 gid = 5;
1032 optional uint32 mode = 6;
1033}
1034message Ext4PunchHoleFtraceEvent {
1035 optional uint64 dev = 1;
1036 optional uint64 ino = 2;
1037 optional int64 offset = 3;
1038 optional int64 len = 4;
1039 optional int32 mode = 5;
1040}
1041message Ext4ReadBlockBitmapLoadFtraceEvent {
1042 optional uint64 dev = 1;
1043 optional uint32 group = 2;
1044}
1045message Ext4ReadpageFtraceEvent {
1046 optional uint64 dev = 1;
1047 optional uint64 ino = 2;
1048 optional uint64 index = 3;
1049}
1050message Ext4ReleasepageFtraceEvent {
1051 optional uint64 dev = 1;
1052 optional uint64 ino = 2;
1053 optional uint64 index = 3;
1054}
1055message Ext4RemoveBlocksFtraceEvent {
1056 optional uint64 dev = 1;
1057 optional uint64 ino = 2;
1058 optional uint32 from = 3;
1059 optional uint32 to = 4;
1060 optional int64 partial = 5;
1061 optional uint64 ee_pblk = 6;
1062 optional uint32 ee_lblk = 7;
1063 optional uint32 ee_len = 8;
1064}
1065message Ext4RequestBlocksFtraceEvent {
1066 optional uint64 dev = 1;
1067 optional uint64 ino = 2;
1068 optional uint32 len = 3;
1069 optional uint32 logical = 4;
1070 optional uint32 lleft = 5;
1071 optional uint32 lright = 6;
1072 optional uint64 goal = 7;
1073 optional uint64 pleft = 8;
1074 optional uint64 pright = 9;
1075 optional uint32 flags = 10;
1076}
1077message Ext4RequestInodeFtraceEvent {
1078 optional uint64 dev = 1;
1079 optional uint64 dir = 2;
1080 optional uint32 mode = 3;
1081}
1082message Ext4SyncFsFtraceEvent {
1083 optional uint64 dev = 1;
1084 optional int32 wait = 2;
1085}
1086message Ext4TrimAllFreeFtraceEvent {
1087 optional int32 dev_major = 1;
1088 optional int32 dev_minor = 2;
1089 optional uint32 group = 3;
1090 optional int32 start = 4;
1091 optional int32 len = 5;
1092}
1093message Ext4TrimExtentFtraceEvent {
1094 optional int32 dev_major = 1;
1095 optional int32 dev_minor = 2;
1096 optional uint32 group = 3;
1097 optional int32 start = 4;
1098 optional int32 len = 5;
1099}
1100message Ext4TruncateEnterFtraceEvent {
1101 optional uint64 dev = 1;
1102 optional uint64 ino = 2;
1103 optional uint64 blocks = 3;
1104}
1105message Ext4TruncateExitFtraceEvent {
1106 optional uint64 dev = 1;
1107 optional uint64 ino = 2;
1108 optional uint64 blocks = 3;
1109}
1110message Ext4UnlinkEnterFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001111 optional uint64 dev = 1;
1112 optional uint64 ino = 2;
1113 optional uint64 parent = 3;
Hector Dearmane0e57802018-11-21 16:09:56 +00001114 optional int64 size = 4;
Hector Dearman55ef3e02018-04-11 17:28:55 +01001115}
Hector Dearmane0e57802018-11-21 16:09:56 +00001116message Ext4UnlinkExitFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001117 optional uint64 dev = 1;
1118 optional uint64 ino = 2;
1119 optional int32 ret = 3;
1120}
Hector Dearmane0e57802018-11-21 16:09:56 +00001121message Ext4WriteBeginFtraceEvent {
1122 optional uint64 dev = 1;
1123 optional uint64 ino = 2;
1124 optional int64 pos = 3;
1125 optional uint32 len = 4;
1126 optional uint32 flags = 5;
1127}
1128message Ext4WriteEndFtraceEvent {
1129 optional uint64 dev = 1;
1130 optional uint64 ino = 2;
1131 optional int64 pos = 3;
1132 optional uint32 len = 4;
1133 optional uint32 copied = 5;
1134}
1135message Ext4WritepageFtraceEvent {
1136 optional uint64 dev = 1;
1137 optional uint64 ino = 2;
1138 optional uint64 index = 3;
1139}
1140message Ext4WritepagesFtraceEvent {
1141 optional uint64 dev = 1;
1142 optional uint64 ino = 2;
1143 optional int64 nr_to_write = 3;
1144 optional int64 pages_skipped = 4;
1145 optional int64 range_start = 5;
1146 optional int64 range_end = 6;
1147 optional uint64 writeback_index = 7;
1148 optional int32 sync_mode = 8;
1149 optional uint32 for_kupdate = 9;
1150 optional uint32 range_cyclic = 10;
1151}
1152message Ext4WritepagesResultFtraceEvent {
1153 optional uint64 dev = 1;
1154 optional uint64 ino = 2;
1155 optional int32 ret = 3;
1156 optional int32 pages_written = 4;
1157 optional int64 pages_skipped = 5;
1158 optional uint64 writeback_index = 6;
1159 optional int32 sync_mode = 7;
1160}
1161message Ext4ZeroRangeFtraceEvent {
1162 optional uint64 dev = 1;
1163 optional uint64 ino = 2;
1164 optional int64 offset = 3;
1165 optional int64 len = 4;
1166 optional int32 mode = 5;
1167}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001168
Hector Dearmane0e57802018-11-21 16:09:56 +00001169// End of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001170
Hector Dearmane0e57802018-11-21 16:09:56 +00001171// Begin of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001172
Hector Dearmane0e57802018-11-21 16:09:56 +00001173message F2fsDoSubmitBioFtraceEvent {
1174 optional uint64 dev = 1;
1175 optional int32 btype = 2;
1176 optional uint32 sync = 3;
1177 optional uint64 sector = 4;
1178 optional uint32 size = 5;
1179}
1180message F2fsEvictInodeFtraceEvent {
1181 optional uint64 dev = 1;
1182 optional uint64 ino = 2;
1183 optional uint64 pino = 3;
1184 optional uint32 mode = 4;
1185 optional int64 size = 5;
1186 optional uint32 nlink = 6;
1187 optional uint64 blocks = 7;
1188 optional uint32 advise = 8;
1189}
1190message F2fsFallocateFtraceEvent {
1191 optional uint64 dev = 1;
1192 optional uint64 ino = 2;
1193 optional int32 mode = 3;
1194 optional int64 offset = 4;
1195 optional int64 len = 5;
1196 optional int64 size = 6;
1197 optional uint64 blocks = 7;
1198 optional int32 ret = 8;
1199}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001200message F2fsGetDataBlockFtraceEvent {
1201 optional uint64 dev = 1;
1202 optional uint64 ino = 2;
1203 optional uint64 iblock = 3;
1204 optional uint64 bh_start = 4;
1205 optional uint64 bh_size = 5;
1206 optional int32 ret = 6;
1207}
Hector Dearmane0e57802018-11-21 16:09:56 +00001208message F2fsGetVictimFtraceEvent {
1209 optional uint64 dev = 1;
1210 optional int32 type = 2;
1211 optional int32 gc_type = 3;
1212 optional int32 alloc_mode = 4;
1213 optional int32 gc_mode = 5;
1214 optional uint32 victim = 6;
1215 optional uint32 ofs_unit = 7;
1216 optional uint32 pre_victim = 8;
1217 optional uint32 prefree = 9;
1218 optional uint32 free = 10;
1219}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001220message F2fsIgetFtraceEvent {
1221 optional uint64 dev = 1;
1222 optional uint64 ino = 2;
1223 optional uint64 pino = 3;
1224 optional uint32 mode = 4;
1225 optional int64 size = 5;
1226 optional uint32 nlink = 6;
1227 optional uint64 blocks = 7;
1228 optional uint32 advise = 8;
1229}
Hector Dearmane0e57802018-11-21 16:09:56 +00001230message F2fsIgetExitFtraceEvent {
1231 optional uint64 dev = 1;
1232 optional uint64 ino = 2;
1233 optional int32 ret = 3;
1234}
1235message F2fsNewInodeFtraceEvent {
1236 optional uint64 dev = 1;
1237 optional uint64 ino = 2;
1238 optional int32 ret = 3;
1239}
1240message F2fsReadpageFtraceEvent {
1241 optional uint64 dev = 1;
1242 optional uint64 ino = 2;
1243 optional uint64 index = 3;
1244 optional uint64 blkaddr = 4;
1245 optional int32 type = 5;
1246}
1247message F2fsReserveNewBlockFtraceEvent {
1248 optional uint64 dev = 1;
1249 optional uint32 nid = 2;
1250 optional uint32 ofs_in_node = 3;
1251}
1252message F2fsSetPageDirtyFtraceEvent {
1253 optional uint64 dev = 1;
1254 optional uint64 ino = 2;
1255 optional int32 type = 3;
1256 optional int32 dir = 4;
1257 optional uint64 index = 5;
1258 optional int32 dirty = 6;
1259}
1260message F2fsSubmitWritePageFtraceEvent {
1261 optional uint64 dev = 1;
1262 optional uint64 ino = 2;
1263 optional int32 type = 3;
1264 optional uint64 index = 4;
1265 optional uint32 block = 5;
1266}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001267message F2fsSyncFileEnterFtraceEvent {
1268 optional uint64 dev = 1;
1269 optional uint64 ino = 2;
1270 optional uint64 pino = 3;
1271 optional uint32 mode = 4;
1272 optional int64 size = 5;
1273 optional uint32 nlink = 6;
1274 optional uint64 blocks = 7;
1275 optional uint32 advise = 8;
1276}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001277message F2fsSyncFileExitFtraceEvent {
1278 optional uint64 dev = 1;
1279 optional uint64 ino = 2;
1280 optional uint32 need_cp = 3;
1281 optional int32 datasync = 4;
1282 optional int32 ret = 5;
1283}
Hector Dearmane0e57802018-11-21 16:09:56 +00001284message F2fsSyncFsFtraceEvent {
1285 optional uint64 dev = 1;
1286 optional int32 dirty = 2;
1287 optional int32 wait = 3;
1288}
1289message F2fsTruncateFtraceEvent {
1290 optional uint64 dev = 1;
1291 optional uint64 ino = 2;
1292 optional uint64 pino = 3;
1293 optional uint32 mode = 4;
1294 optional int64 size = 5;
1295 optional uint32 nlink = 6;
1296 optional uint64 blocks = 7;
1297 optional uint32 advise = 8;
1298}
1299message F2fsTruncateBlocksEnterFtraceEvent {
1300 optional uint64 dev = 1;
1301 optional uint64 ino = 2;
1302 optional int64 size = 3;
1303 optional uint64 blocks = 4;
1304 optional uint64 from = 5;
1305}
1306message F2fsTruncateBlocksExitFtraceEvent {
1307 optional uint64 dev = 1;
1308 optional uint64 ino = 2;
1309 optional int32 ret = 3;
1310}
1311message F2fsTruncateDataBlocksRangeFtraceEvent {
1312 optional uint64 dev = 1;
1313 optional uint64 ino = 2;
1314 optional uint32 nid = 3;
1315 optional uint32 ofs = 4;
1316 optional int32 free = 5;
1317}
1318message F2fsTruncateInodeBlocksEnterFtraceEvent {
1319 optional uint64 dev = 1;
1320 optional uint64 ino = 2;
1321 optional int64 size = 3;
1322 optional uint64 blocks = 4;
1323 optional uint64 from = 5;
1324}
1325message F2fsTruncateInodeBlocksExitFtraceEvent {
1326 optional uint64 dev = 1;
1327 optional uint64 ino = 2;
1328 optional int32 ret = 3;
1329}
1330message F2fsTruncateNodeFtraceEvent {
1331 optional uint64 dev = 1;
1332 optional uint64 ino = 2;
1333 optional uint32 nid = 3;
1334 optional uint32 blk_addr = 4;
1335}
1336message F2fsTruncateNodesEnterFtraceEvent {
1337 optional uint64 dev = 1;
1338 optional uint64 ino = 2;
1339 optional uint32 nid = 3;
1340 optional uint32 blk_addr = 4;
1341}
1342message F2fsTruncateNodesExitFtraceEvent {
1343 optional uint64 dev = 1;
1344 optional uint64 ino = 2;
1345 optional int32 ret = 3;
1346}
1347message F2fsTruncatePartialNodesFtraceEvent {
1348 optional uint64 dev = 1;
1349 optional uint64 ino = 2;
1350 optional uint32 nid = 3;
1351 optional int32 depth = 4;
1352 optional int32 err = 5;
1353}
1354message F2fsUnlinkEnterFtraceEvent {
1355 optional uint64 dev = 1;
1356 optional uint64 ino = 2;
1357 optional int64 size = 3;
1358 optional uint64 blocks = 4;
1359 optional string name = 5;
1360}
1361message F2fsUnlinkExitFtraceEvent {
1362 optional uint64 dev = 1;
1363 optional uint64 ino = 2;
1364 optional int32 ret = 3;
1365}
1366message F2fsVmPageMkwriteFtraceEvent {
1367 optional uint64 dev = 1;
1368 optional uint64 ino = 2;
1369 optional int32 type = 3;
1370 optional int32 dir = 4;
1371 optional uint64 index = 5;
1372 optional int32 dirty = 6;
1373}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001374message F2fsWriteBeginFtraceEvent {
1375 optional uint64 dev = 1;
1376 optional uint64 ino = 2;
1377 optional int64 pos = 3;
1378 optional uint32 len = 4;
1379 optional uint32 flags = 5;
1380}
Hector Dearmane0e57802018-11-21 16:09:56 +00001381message F2fsWriteCheckpointFtraceEvent {
1382 optional uint64 dev = 1;
1383 optional uint32 is_umount = 2;
1384 optional string msg = 3;
1385}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001386message F2fsWriteEndFtraceEvent {
1387 optional uint64 dev = 1;
1388 optional uint64 ino = 2;
1389 optional int64 pos = 3;
1390 optional uint32 len = 4;
1391 optional uint32 copied = 5;
1392}
1393
Hector Dearmane0e57802018-11-21 16:09:56 +00001394// End of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001395
Hector Dearmane0e57802018-11-21 16:09:56 +00001396// Begin of protos/perfetto/trace/ftrace/filemap.proto
1397
1398message MmFilemapAddToPageCacheFtraceEvent {
1399 optional uint64 pfn = 1;
1400 optional uint64 i_ino = 2;
1401 optional uint64 index = 3;
1402 optional uint64 s_dev = 4;
1403 optional uint64 page = 5;
1404}
1405message MmFilemapDeleteFromPageCacheFtraceEvent {
1406 optional uint64 pfn = 1;
1407 optional uint64 i_ino = 2;
1408 optional uint64 index = 3;
1409 optional uint64 s_dev = 4;
1410 optional uint64 page = 5;
1411}
1412
1413// End of protos/perfetto/trace/ftrace/filemap.proto
1414
1415// Begin of protos/perfetto/trace/ftrace/ftrace.proto
1416
1417message PrintFtraceEvent {
1418 optional uint64 ip = 1;
1419 optional string buf = 2;
1420}
1421
1422// End of protos/perfetto/trace/ftrace/ftrace.proto
1423
1424// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto
1425
1426message FtraceEvent {
1427 // Nanoseconds since an epoch.
1428 // Epoch is configurable by writing into trace_clock.
1429 // By default this timestamp is CPU local.
1430 // TODO: Figure out a story for reconciling the various clocks.
1431 optional uint64 timestamp = 1;
1432
1433 // Kernel pid (do not confuse with userspace pid aka tgid)
1434 optional uint32 pid = 2;
1435
1436 oneof event {
1437 PrintFtraceEvent print = 3;
1438 SchedSwitchFtraceEvent sched_switch = 4;
1439 // removed field with id 5;
1440 // removed field with id 6;
1441 // removed field with id 7;
1442 // removed field with id 8;
1443 // removed field with id 9;
1444 // removed field with id 10;
1445 CpuFrequencyFtraceEvent cpu_frequency = 11;
1446 CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
1447 CpuIdleFtraceEvent cpu_idle = 13;
1448 ClockEnableFtraceEvent clock_enable = 14;
1449 ClockDisableFtraceEvent clock_disable = 15;
1450 ClockSetRateFtraceEvent clock_set_rate = 16;
1451 SchedWakeupFtraceEvent sched_wakeup = 17;
1452 SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
1453 SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
1454 SchedWakingFtraceEvent sched_waking = 20;
1455 // removed field with id 21
1456 // removed field with id 22
1457 // removed field with id 23
1458 // removed field with id 24
1459 // removed field with id 25
1460 // removed field with id 26
1461 // removed field with id 27
1462 // removed field with id 28
1463 // removed field with id 29
1464 // removed field with id 30
1465 // removed field with id 31
1466 // removed field with id 32
1467 // removed field with id 33
1468 // removed field with id 34
1469 LowmemoryKillFtraceEvent lowmemory_kill = 35;
1470 // removed field with id 36
1471 // removed field with id 37
1472 // removed field with id 38
1473 // removed field with id 39
1474 // removed field with id 40
1475 Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
1476 Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
1477 Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
1478 Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
1479 BlockRqIssueFtraceEvent block_rq_issue = 45;
1480 MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
1481 MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
1482 MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
1483 MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
1484 BinderTransactionFtraceEvent binder_transaction = 50;
1485 BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
1486 BinderSetPriorityFtraceEvent binder_set_priority = 52;
1487 BinderLockFtraceEvent binder_lock = 53;
1488 BinderLockedFtraceEvent binder_locked = 54;
1489 BinderUnlockFtraceEvent binder_unlock = 55;
1490 // removed field with id 56
1491 // removed field with id 57
1492 // removed field with id 58
1493 // removed field with id 59
1494 // removed field with id 60
1495 // removed field with id 61
1496 // removed field with id 62
1497 // removed field with id 63
1498 // removed field with id 64
1499 // removed field with id 65
1500 // removed field with id 66
1501 // removed field with id 67
1502 // removed field with id 68
1503 // removed field with id 69
1504 // removed field with id 70
1505 // removed field with id 71
1506 // removed field with id 72
1507 // removed field with id 73
1508 // removed field with id 74
1509 // removed field with id 75
1510 // removed field with id 76
1511 // removed field with id 77
1512 // removed field with id 78
1513 // removed field with id 79
1514 // removed field with id 80
1515 // removed field with id 81
1516 // removed field with id 82
1517 // removed field with id 83
1518 // removed field with id 84
1519 // removed field with id 85
1520 // removed field with id 86
1521 // removed field with id 87
1522 // removed field with id 88
1523 // removed field with id 89
1524 // removed field with id 90
1525 // removed field with id 91
1526 // removed field with id 92
1527 // removed field with id 93
1528 // removed field with id 94
1529 // removed field with id 95
1530 // removed field with id 96
1531 MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
1532 MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
1533 98;
1534 // removed field with id 99
1535 // removed field with id 100
1536 // removed field with id 101
1537 // removed field with id 102
1538 // removed field with id 103
1539 // removed field with id 104
1540 // removed field with id 105
1541 // removed field with id 106
1542 // removed field with id 107
1543 // removed field with id 108
1544 // removed field with id 109
1545 // removed field with id 110
1546 // removed field with id 111
1547 // removed field with id 112
1548 SuspendResumeFtraceEvent suspend_resume = 113;
1549 SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
1550 BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
1551 BlockBioBounceFtraceEvent block_bio_bounce = 116;
1552 BlockBioCompleteFtraceEvent block_bio_complete = 117;
1553 BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
1554 BlockBioQueueFtraceEvent block_bio_queue = 119;
1555 BlockBioRemapFtraceEvent block_bio_remap = 120;
1556 BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
1557 BlockGetrqFtraceEvent block_getrq = 122;
1558 BlockPlugFtraceEvent block_plug = 123;
1559 BlockRqAbortFtraceEvent block_rq_abort = 124;
1560 BlockRqCompleteFtraceEvent block_rq_complete = 125;
1561 BlockRqInsertFtraceEvent block_rq_insert = 126;
1562 // removed field with id 127;
1563 BlockRqRemapFtraceEvent block_rq_remap = 128;
1564 BlockRqRequeueFtraceEvent block_rq_requeue = 129;
1565 BlockSleeprqFtraceEvent block_sleeprq = 130;
1566 BlockSplitFtraceEvent block_split = 131;
1567 BlockTouchBufferFtraceEvent block_touch_buffer = 132;
1568 BlockUnplugFtraceEvent block_unplug = 133;
1569 Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
1570 Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
1571 Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
1572 Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
1573 Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
1574 Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
1575 Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
1576 Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
1577 Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
1578 Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
1579 Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
1580 Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
1581 Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
1582 Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
1583 Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
1584 Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
1585 Ext4EsFindDelayedExtentRangeEnterFtraceEvent
1586 ext4_es_find_delayed_extent_range_enter = 150;
1587 Ext4EsFindDelayedExtentRangeExitFtraceEvent
1588 ext4_es_find_delayed_extent_range_exit = 151;
1589 Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
1590 Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
1591 Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
1592 Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
1593 Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
1594 Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
1595 Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
1596 Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
1597 Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
1598 Ext4ExtConvertToInitializedEnterFtraceEvent
1599 ext4_ext_convert_to_initialized_enter = 161;
1600 Ext4ExtConvertToInitializedFastpathFtraceEvent
1601 ext4_ext_convert_to_initialized_fastpath = 162;
1602 Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
1603 163;
1604 Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
1605 Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
1606 Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
1607 Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
1608 Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
1609 Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
1610 Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
1611 Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
1612 Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
1613 Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
1614 Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
1615 Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
1616 Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
1617 Ext4ForgetFtraceEvent ext4_forget = 177;
1618 Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
1619 Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
1620 Ext4GetImpliedClusterAllocExitFtraceEvent
1621 ext4_get_implied_cluster_alloc_exit = 180;
1622 Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
1623 181;
1624 Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
1625 Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
1626 Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
1627 Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
1628 Ext4JournalStartFtraceEvent ext4_journal_start = 186;
1629 Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
1630 Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
1631 188;
1632 Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
1633 Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
1634 Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
1635 Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
1636 Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
1637 Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
1638 Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
1639 Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
1640 Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
1641 Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
1642 Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
1643 Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
1644 Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
1645 Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
1646 Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
1647 Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
1648 Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
1649 Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
1650 Ext4ReadpageFtraceEvent ext4_readpage = 207;
1651 Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
1652 Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
1653 Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
1654 Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
1655 Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
1656 Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
1657 Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
1658 Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
1659 Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
1660 Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
1661 Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
1662 Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
1663 // removed field with id 220;
1664 // removed field with id 221;
1665 // removed field with id 222;
1666 // removed field with id 223;
1667 // removed field with id 224;
1668 // removed field with id 225;
1669 // removed field with id 226;
1670 // removed field with id 227;
1671 // removed field with id 228;
1672 // removed field with id 229;
1673 Ext4WriteEndFtraceEvent ext4_write_end = 230;
1674 Ext4WritepageFtraceEvent ext4_writepage = 231;
1675 Ext4WritepagesFtraceEvent ext4_writepages = 232;
1676 Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
1677 Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
1678 TaskNewtaskFtraceEvent task_newtask = 235;
1679 TaskRenameFtraceEvent task_rename = 236;
1680 SchedProcessExecFtraceEvent sched_process_exec = 237;
1681 SchedProcessExitFtraceEvent sched_process_exit = 238;
1682 SchedProcessForkFtraceEvent sched_process_fork = 239;
1683 SchedProcessFreeFtraceEvent sched_process_free = 240;
1684 SchedProcessHangFtraceEvent sched_process_hang = 241;
1685 SchedProcessWaitFtraceEvent sched_process_wait = 242;
1686 F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
1687 F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
1688 F2fsFallocateFtraceEvent f2fs_fallocate = 245;
1689 F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
1690 F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
1691 F2fsIgetFtraceEvent f2fs_iget = 248;
1692 F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
1693 F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
1694 F2fsReadpageFtraceEvent f2fs_readpage = 251;
1695 F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
1696 F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
1697 F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
1698 F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
1699 F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
1700 F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
1701 F2fsTruncateFtraceEvent f2fs_truncate = 258;
1702 F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
1703 F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
1704 F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
1705 261;
1706 F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
1707 262;
1708 F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
1709 263;
1710 F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
1711 F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
1712 F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
1713 F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
1714 F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
1715 F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
1716 F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
1717 F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
1718 F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
1719 F2fsWriteEndFtraceEvent f2fs_write_end = 273;
1720 AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
1721 AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
1722 AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
1723 AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
1724 AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
1725 AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
1726 DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
1727 IommuMapRangeFtraceEvent iommu_map_range = 281;
1728 IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
1729 IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
1730 IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
1731 IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
1732 IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
1733 IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
1734 IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
1735 IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
1736 IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
1737 IonPrefetchingFtraceEvent ion_prefetching = 291;
1738 IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
1739 IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
1740 293;
1741 IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
1742 IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
1743 IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
1744 IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
1745 297;
1746 KfreeFtraceEvent kfree = 298;
1747 KmallocFtraceEvent kmalloc = 299;
1748 KmallocNodeFtraceEvent kmalloc_node = 300;
1749 KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
1750 KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
1751 KmemCacheFreeFtraceEvent kmem_cache_free = 303;
1752 MigratePagesEndFtraceEvent migrate_pages_end = 304;
1753 MigratePagesStartFtraceEvent migrate_pages_start = 305;
1754 MigrateRetryFtraceEvent migrate_retry = 306;
1755 MmPageAllocFtraceEvent mm_page_alloc = 307;
1756 MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
1757 MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
1758 MmPageFreeFtraceEvent mm_page_free = 310;
1759 MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
1760 MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
1761 RssStatFtraceEvent rss_stat = 313;
1762 IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
1763 IonHeapGrowFtraceEvent ion_heap_grow = 315;
1764 // removed field with id 316
1765 // removed field with id 317
1766 // removed field with id 318
1767 // removed field with id 319
1768 ClkEnableFtraceEvent clk_enable = 320;
1769 ClkDisableFtraceEvent clk_disable = 321;
1770 ClkSetRateFtraceEvent clk_set_rate = 322;
1771 BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
1772 SignalDeliverFtraceEvent signal_deliver = 324;
1773 SignalGenerateFtraceEvent signal_generate = 325;
1774 // removed field with id 326
Isabelle Taylor98e560d2018-11-22 11:59:12 +00001775 GenericFtraceEvent generic = 327;
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00001776 MmEventRecordFtraceEvent mm_event_record = 328;
Lalit Magantia73a7252019-01-25 10:32:40 +00001777 SysEnterFtraceEvent sys_enter = 329;
1778 SysExitFtraceEvent sys_exit = 330;
Hector Dearmane0e57802018-11-21 16:09:56 +00001779 }
1780}
1781
1782// End of protos/perfetto/trace/ftrace/ftrace_event.proto
1783
1784// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
1785
1786message FtraceEventBundle {
1787 optional uint32 cpu = 1;
1788 repeated FtraceEvent event = 2;
1789 // Total of all overwrite fields from the headers of all kernel
1790 // ftrace pages we parsed into this FtraceEventBundle. Zero if
1791 // no overwriting occurred, a number larger than zero if some overwriting
1792 // occurred.
1793 optional uint32 overwrite_count = 3;
1794}
1795
1796// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
1797
1798// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto
1799
1800// Per-CPU stats for the ftrace data source gathered from the kernel from
1801// /sys/kernel/debug/tracing/per_cpu/cpuX/stats.
1802message FtraceCpuStats {
1803 // CPU index.
1804 optional uint64 cpu = 1;
1805
1806 // Number of entries still in the kernel buffer. Ideally this should be close
1807 // to zero, as events are consumed regularly and moved into the userspace
1808 // buffers (or file).
1809 optional uint64 entries = 2;
1810
1811 // Number of events lost in kernel buffers due to overwriting of old events
1812 // before userspace had a chance to drain them.
1813 optional uint64 overrun = 3;
1814
1815 // This should always be zero. If not the buffer size is way too small or
1816 // something went wrong with the tracer.
1817 optional uint64 commit_overrun = 4;
1818
1819 // Bytes actually read (not overwritten).
1820 optional uint64 bytes_read = 5;
1821
1822 // The timestamp for the oldest event still in the ring buffer.
1823 optional double oldest_event_ts = 6;
1824
1825 // The current timestamp.
1826 optional double now_ts = 7;
1827
1828 // If the kernel buffer has overwrite mode disabled, this will show the number
1829 // of new events that were lost because the buffer was full. This is similar
1830 // to |overrun| but only for the overwrite=false case.
1831 optional uint64 dropped_events = 8;
1832
1833 // The number of events read.
1834 optional uint64 read_events = 9;
1835}
1836
1837// Ftrace stats for all CPUs.
1838message FtraceStats {
1839 enum Phase {
1840 UNSPECIFIED = 0;
1841 START_OF_TRACE = 1;
1842 END_OF_TRACE = 2;
1843 }
1844
1845 // Tells when stats were sampled. There should be one sample at the beginning
1846 // of the trace and one sample at the end.
1847 optional Phase phase = 1;
1848
1849 // Per-CPU stats (one entry for each CPU).
1850 repeated FtraceCpuStats cpu_stats = 2;
1851}
1852
1853// End of protos/perfetto/trace/ftrace/ftrace_stats.proto
1854
Hector Dearmane92c6742018-11-22 21:42:39 +00001855// Begin of protos/perfetto/trace/ftrace/generic.proto
1856
1857// This generic proto is used to output events in the trace
1858// when a specific proto for that event does not exist.
1859message GenericFtraceEvent {
1860 message Field {
1861 optional string name = 1;
1862 oneof value {
1863 string str_value = 3;
1864 int64 int_value = 4;
1865 uint64 uint_value = 5;
1866 }
1867 }
1868
1869 optional string event_name = 1;
1870 repeated Field field = 2;
1871}
1872
1873// End of protos/perfetto/trace/ftrace/generic.proto
1874
Hector Dearmane0e57802018-11-21 16:09:56 +00001875// Begin of protos/perfetto/trace/ftrace/kmem.proto
1876
1877message AllocPagesIommuEndFtraceEvent {
1878 optional uint32 gfp_flags = 1;
1879 optional uint32 order = 2;
1880}
1881message AllocPagesIommuFailFtraceEvent {
1882 optional uint32 gfp_flags = 1;
1883 optional uint32 order = 2;
1884}
1885message AllocPagesIommuStartFtraceEvent {
1886 optional uint32 gfp_flags = 1;
1887 optional uint32 order = 2;
1888}
1889message AllocPagesSysEndFtraceEvent {
1890 optional uint32 gfp_flags = 1;
1891 optional uint32 order = 2;
1892}
1893message AllocPagesSysFailFtraceEvent {
1894 optional uint32 gfp_flags = 1;
1895 optional uint32 order = 2;
1896}
1897message AllocPagesSysStartFtraceEvent {
1898 optional uint32 gfp_flags = 1;
1899 optional uint32 order = 2;
1900}
1901message DmaAllocContiguousRetryFtraceEvent {
1902 optional int32 tries = 1;
1903}
1904message IommuMapRangeFtraceEvent {
1905 optional uint64 chunk_size = 1;
1906 optional uint64 len = 2;
1907 optional uint64 pa = 3;
1908 optional uint64 va = 4;
1909}
1910message IommuSecPtblMapRangeEndFtraceEvent {
1911 optional uint64 len = 1;
1912 optional int32 num = 2;
1913 optional uint32 pa = 3;
1914 optional int32 sec_id = 4;
1915 optional uint64 va = 5;
1916}
1917message IommuSecPtblMapRangeStartFtraceEvent {
1918 optional uint64 len = 1;
1919 optional int32 num = 2;
1920 optional uint32 pa = 3;
1921 optional int32 sec_id = 4;
1922 optional uint64 va = 5;
1923}
1924message IonAllocBufferEndFtraceEvent {
1925 optional string client_name = 1;
1926 optional uint32 flags = 2;
1927 optional string heap_name = 3;
1928 optional uint64 len = 4;
1929 optional uint32 mask = 5;
1930}
1931message IonAllocBufferFailFtraceEvent {
1932 optional string client_name = 1;
1933 optional int64 error = 2;
1934 optional uint32 flags = 3;
1935 optional string heap_name = 4;
1936 optional uint64 len = 5;
1937 optional uint32 mask = 6;
1938}
1939message IonAllocBufferFallbackFtraceEvent {
1940 optional string client_name = 1;
1941 optional int64 error = 2;
1942 optional uint32 flags = 3;
1943 optional string heap_name = 4;
1944 optional uint64 len = 5;
1945 optional uint32 mask = 6;
1946}
1947message IonAllocBufferStartFtraceEvent {
1948 optional string client_name = 1;
1949 optional uint32 flags = 2;
1950 optional string heap_name = 3;
1951 optional uint64 len = 4;
1952 optional uint32 mask = 5;
1953}
1954message IonCpAllocRetryFtraceEvent {
1955 optional int32 tries = 1;
1956}
1957message IonCpSecureBufferEndFtraceEvent {
1958 optional uint64 align = 1;
1959 optional uint64 flags = 2;
1960 optional string heap_name = 3;
1961 optional uint64 len = 4;
1962}
1963message IonCpSecureBufferStartFtraceEvent {
1964 optional uint64 align = 1;
1965 optional uint64 flags = 2;
1966 optional string heap_name = 3;
1967 optional uint64 len = 4;
1968}
1969message IonPrefetchingFtraceEvent {
1970 optional uint64 len = 1;
1971}
1972message IonSecureCmaAddToPoolEndFtraceEvent {
1973 optional uint32 is_prefetch = 1;
1974 optional uint64 len = 2;
1975 optional int32 pool_total = 3;
1976}
1977message IonSecureCmaAddToPoolStartFtraceEvent {
1978 optional uint32 is_prefetch = 1;
1979 optional uint64 len = 2;
1980 optional int32 pool_total = 3;
1981}
1982message IonSecureCmaAllocateEndFtraceEvent {
1983 optional uint64 align = 1;
1984 optional uint64 flags = 2;
1985 optional string heap_name = 3;
1986 optional uint64 len = 4;
1987}
1988message IonSecureCmaAllocateStartFtraceEvent {
1989 optional uint64 align = 1;
1990 optional uint64 flags = 2;
1991 optional string heap_name = 3;
1992 optional uint64 len = 4;
1993}
1994message IonSecureCmaShrinkPoolEndFtraceEvent {
1995 optional uint64 drained_size = 1;
1996 optional uint64 skipped_size = 2;
1997}
1998message IonSecureCmaShrinkPoolStartFtraceEvent {
1999 optional uint64 drained_size = 1;
2000 optional uint64 skipped_size = 2;
2001}
2002message KfreeFtraceEvent {
2003 optional uint64 call_site = 1;
2004 optional uint64 ptr = 2;
2005}
2006message KmallocFtraceEvent {
2007 optional uint64 bytes_alloc = 1;
2008 optional uint64 bytes_req = 2;
2009 optional uint64 call_site = 3;
2010 optional uint32 gfp_flags = 4;
2011 optional uint64 ptr = 5;
2012}
2013message KmallocNodeFtraceEvent {
2014 optional uint64 bytes_alloc = 1;
2015 optional uint64 bytes_req = 2;
2016 optional uint64 call_site = 3;
2017 optional uint32 gfp_flags = 4;
2018 optional int32 node = 5;
2019 optional uint64 ptr = 6;
2020}
2021message KmemCacheAllocFtraceEvent {
2022 optional uint64 bytes_alloc = 1;
2023 optional uint64 bytes_req = 2;
2024 optional uint64 call_site = 3;
2025 optional uint32 gfp_flags = 4;
2026 optional uint64 ptr = 5;
2027}
2028message KmemCacheAllocNodeFtraceEvent {
2029 optional uint64 bytes_alloc = 1;
2030 optional uint64 bytes_req = 2;
2031 optional uint64 call_site = 3;
2032 optional uint32 gfp_flags = 4;
2033 optional int32 node = 5;
2034 optional uint64 ptr = 6;
2035}
2036message KmemCacheFreeFtraceEvent {
2037 optional uint64 call_site = 1;
2038 optional uint64 ptr = 2;
2039}
2040message MigratePagesEndFtraceEvent {
2041 optional int32 mode = 1;
2042}
2043message MigratePagesStartFtraceEvent {
2044 optional int32 mode = 1;
2045}
2046message MigrateRetryFtraceEvent {
2047 optional int32 tries = 1;
2048}
2049message MmPageAllocFtraceEvent {
2050 optional uint32 gfp_flags = 1;
2051 optional int32 migratetype = 2;
2052 optional uint32 order = 3;
2053 optional uint64 page = 4;
2054 optional uint64 pfn = 5;
2055}
2056message MmPageAllocExtfragFtraceEvent {
2057 optional int32 alloc_migratetype = 1;
2058 optional int32 alloc_order = 2;
2059 optional int32 fallback_migratetype = 3;
2060 optional int32 fallback_order = 4;
2061 optional uint64 page = 5;
2062 optional int32 change_ownership = 6;
2063 optional uint64 pfn = 7;
2064}
2065message MmPageAllocZoneLockedFtraceEvent {
2066 optional int32 migratetype = 1;
2067 optional uint32 order = 2;
2068 optional uint64 page = 3;
2069 optional uint64 pfn = 4;
2070}
2071message MmPageFreeFtraceEvent {
2072 optional uint32 order = 1;
2073 optional uint64 page = 2;
2074 optional uint64 pfn = 3;
2075}
2076message MmPageFreeBatchedFtraceEvent {
2077 optional int32 cold = 1;
2078 optional uint64 page = 2;
2079 optional uint64 pfn = 3;
2080}
2081message MmPagePcpuDrainFtraceEvent {
2082 optional int32 migratetype = 1;
2083 optional uint32 order = 2;
2084 optional uint64 page = 3;
2085 optional uint64 pfn = 4;
2086}
2087message RssStatFtraceEvent {
2088 optional int32 member = 1;
2089 optional int64 size = 2;
2090}
2091message IonHeapShrinkFtraceEvent {
2092 optional string heap_name = 1;
2093 optional uint64 len = 2;
2094 optional int64 total_allocated = 3;
2095}
2096message IonHeapGrowFtraceEvent {
2097 optional string heap_name = 1;
2098 optional uint64 len = 2;
2099 optional int64 total_allocated = 3;
2100}
2101
2102// End of protos/perfetto/trace/ftrace/kmem.proto
2103
2104// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002105
2106message LowmemoryKillFtraceEvent {
2107 optional string comm = 1;
2108 optional int32 pid = 2;
2109 optional int64 pagecache_size = 3;
2110 optional int64 pagecache_limit = 4;
2111 optional int64 free = 5;
2112}
2113
Hector Dearmane0e57802018-11-21 16:09:56 +00002114// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002115
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00002116// Begin of protos/perfetto/trace/ftrace/mm_event.proto
2117
2118message MmEventRecordFtraceEvent {
2119 optional uint32 avg_lat = 1;
2120 optional uint32 count = 2;
2121 optional uint32 max_lat = 3;
2122 optional uint32 type = 4;
2123}
2124
2125// End of protos/perfetto/trace/ftrace/mm_event.proto
2126
Hector Dearmane0e57802018-11-21 16:09:56 +00002127// Begin of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002128
Hector Dearmane0e57802018-11-21 16:09:56 +00002129message CpuFrequencyFtraceEvent {
2130 optional uint32 state = 1;
2131 optional uint32 cpu_id = 2;
2132}
2133message CpuFrequencyLimitsFtraceEvent {
2134 optional uint32 min_freq = 1;
2135 optional uint32 max_freq = 2;
2136 optional uint32 cpu_id = 3;
2137}
2138message CpuIdleFtraceEvent {
2139 optional uint32 state = 1;
2140 optional uint32 cpu_id = 2;
2141}
2142message ClockEnableFtraceEvent {
2143 optional string name = 1;
2144 optional uint64 state = 2;
2145 optional uint64 cpu_id = 3;
2146}
2147message ClockDisableFtraceEvent {
2148 optional string name = 1;
2149 optional uint64 state = 2;
2150 optional uint64 cpu_id = 3;
2151}
2152message ClockSetRateFtraceEvent {
2153 optional string name = 1;
2154 optional uint64 state = 2;
2155 optional uint64 cpu_id = 3;
2156}
2157message SuspendResumeFtraceEvent {
2158 optional string action = 1;
2159 optional int32 val = 2;
2160 optional uint32 start = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +01002161}
2162
Hector Dearmane0e57802018-11-21 16:09:56 +00002163// End of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002164
Lalit Magantia73a7252019-01-25 10:32:40 +00002165// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto
2166
2167message SysEnterFtraceEvent {
2168 optional int64 id = 1;
2169}
2170message SysExitFtraceEvent {
2171 optional int64 id = 1;
2172 optional int64 ret = 2;
2173}
2174
2175// End of protos/perfetto/trace/ftrace/raw_syscalls.proto
2176
Hector Dearmane0e57802018-11-21 16:09:56 +00002177// Begin of protos/perfetto/trace/ftrace/sched.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002178
2179message SchedSwitchFtraceEvent {
2180 optional string prev_comm = 1;
2181 optional int32 prev_pid = 2;
2182 optional int32 prev_prio = 3;
2183 optional int64 prev_state = 4;
2184 optional string next_comm = 5;
2185 optional int32 next_pid = 6;
2186 optional int32 next_prio = 7;
2187}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002188message SchedWakeupFtraceEvent {
2189 optional string comm = 1;
2190 optional int32 pid = 2;
2191 optional int32 prio = 3;
2192 optional int32 success = 4;
2193 optional int32 target_cpu = 5;
2194}
Hector Dearmane0e57802018-11-21 16:09:56 +00002195message SchedBlockedReasonFtraceEvent {
2196 optional int32 pid = 1;
2197 optional uint64 caller = 2;
2198 optional uint32 io_wait = 3;
2199}
2200message SchedCpuHotplugFtraceEvent {
2201 optional int32 affected_cpu = 1;
2202 optional int32 error = 2;
2203 optional int32 status = 3;
2204}
2205message SchedWakingFtraceEvent {
2206 optional string comm = 1;
2207 optional int32 pid = 2;
2208 optional int32 prio = 3;
2209 optional int32 success = 4;
2210 optional int32 target_cpu = 5;
2211}
2212message SchedWakeupNewFtraceEvent {
2213 optional string comm = 1;
2214 optional int32 pid = 2;
2215 optional int32 prio = 3;
2216 optional int32 success = 4;
2217 optional int32 target_cpu = 5;
2218}
2219message SchedProcessExecFtraceEvent {
2220 optional string filename = 1;
2221 optional int32 pid = 2;
2222 optional int32 old_pid = 3;
2223}
2224message SchedProcessExitFtraceEvent {
2225 optional string comm = 1;
2226 optional int32 pid = 2;
2227 optional int32 tgid = 3;
2228 optional int32 prio = 4;
2229}
2230message SchedProcessForkFtraceEvent {
2231 optional string parent_comm = 1;
2232 optional int32 parent_pid = 2;
2233 optional string child_comm = 3;
2234 optional int32 child_pid = 4;
2235}
2236message SchedProcessFreeFtraceEvent {
2237 optional string comm = 1;
2238 optional int32 pid = 2;
2239 optional int32 prio = 3;
2240}
2241message SchedProcessHangFtraceEvent {
2242 optional string comm = 1;
2243 optional int32 pid = 2;
2244}
2245message SchedProcessWaitFtraceEvent {
2246 optional string comm = 1;
2247 optional int32 pid = 2;
2248 optional int32 prio = 3;
2249}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002250
Hector Dearmane0e57802018-11-21 16:09:56 +00002251// End of protos/perfetto/trace/ftrace/sched.proto
2252
2253// Begin of protos/perfetto/trace/ftrace/signal.proto
2254
2255message SignalDeliverFtraceEvent {
2256 optional int32 code = 1;
2257 optional uint64 sa_flags = 2;
2258 optional int32 sig = 3;
2259}
2260message SignalGenerateFtraceEvent {
2261 optional int32 code = 1;
2262 optional string comm = 2;
2263 optional int32 group = 3;
2264 optional int32 pid = 4;
2265 optional int32 result = 5;
2266 optional int32 sig = 6;
2267}
2268
2269// End of protos/perfetto/trace/ftrace/signal.proto
2270
2271// Begin of protos/perfetto/trace/ftrace/task.proto
2272
2273message TaskNewtaskFtraceEvent {
2274 optional int32 pid = 1;
2275 optional string comm = 2;
2276 optional uint64 clone_flags = 3;
2277 optional int32 oom_score_adj = 4;
2278}
2279message TaskRenameFtraceEvent {
2280 optional int32 pid = 1;
2281 optional string oldcomm = 2;
2282 optional string newcomm = 3;
2283 optional int32 oom_score_adj = 4;
2284}
2285
2286// End of protos/perfetto/trace/ftrace/task.proto
2287
2288// Begin of protos/perfetto/trace/ftrace/vmscan.proto
2289
2290message MmVmscanDirectReclaimBeginFtraceEvent {
2291 optional int32 order = 1;
2292 optional int32 may_writepage = 2;
2293 optional uint32 gfp_flags = 3;
2294}
2295message MmVmscanDirectReclaimEndFtraceEvent {
2296 optional uint64 nr_reclaimed = 1;
2297}
2298message MmVmscanKswapdWakeFtraceEvent {
2299 optional int32 nid = 1;
2300 optional int32 order = 2;
2301}
2302message MmVmscanKswapdSleepFtraceEvent {
2303 optional int32 nid = 1;
2304}
2305
2306// End of protos/perfetto/trace/ftrace/vmscan.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002307
Eric Secklerc73ef062019-02-25 12:30:35 +00002308// Begin of protos/perfetto/trace/interned_data/interned_data.proto
2309
2310// ------------------------------ DATA INTERNING: ------------------------------
2311// Interning indexes are built up gradually by adding the entries contained in
2312// each TracePacket of the same packet sequence (packets emitted by the same
2313// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
2314// can only refer to interned data from other packets in the same sequence.
2315//
2316// The writer will emit new entries when it encounters new internable values
2317// that aren't yet in the index. Data in current and subsequent TracePackets can
2318// then refer to the entry by its position (interning ID, abbreviated "iid") in
2319// its index.
2320//
2321// Because of the incremental build-up, the interning index will miss data when
2322// TracePackets are lost, e.g. because a chunk was overridden in the central
2323// ring buffer. To avoid invalidation of the whole trace in such a case, the
2324// index is periodically reset (see |incremental_state_cleared| in TracePacket).
2325// When packet loss occurs, the reader will only lose interning data up to the
2326// next reset.
2327// -----------------------------------------------------------------------------
2328
2329// Message that contains new entries for the interning indices of a packet
2330// sequence.
2331//
2332// The writer will usually emit new entries in the same TracePacket that first
2333// refers to them (since the last reset of interning state). They may also be
2334// emitted proactively in advance of referring to them in later packets.
2335//
2336// Next id: 5.
2337message InternedData {
2338 // Each field's message type needs to specify an |iid| field, which is the ID
2339 // of the entry in the field's interning index. Each field constructs its own
2340 // index, thus interning IDs are scoped to the tracing session and field
2341 // (usually as a counter for efficient var-int encoding). It is illegal to
2342 // override entries in an index (using the same iid for two different values)
2343 // within the same tracing session, even after a reset of the emitted
2344 // interning state.
2345 repeated EventCategory event_categories = 1;
2346 repeated LegacyEventName legacy_event_names = 2;
2347 repeated DebugAnnotationName debug_annotation_names = 3;
2348 repeated SourceLocation source_locations = 4;
2349 // Note: field IDs up to 15 should be used for frequent data only.
2350}
2351
2352// End of protos/perfetto/trace/interned_data/interned_data.proto
2353
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01002354// Begin of protos/perfetto/trace/power/battery_counters.proto
2355
2356message BatteryCounters {
2357 // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
2358 optional int64 charge_counter_uah = 1;
2359
2360 // Remaining battery capacity percentage of total capacity
2361 optional float capacity_percent = 2;
2362
2363 // Instantaneous battery current in microamperes(µA).
2364 // Positive values indicate net current entering the battery from a charge
2365 // source, negative values indicate net current discharging from the battery.
2366 optional int64 current_ua = 3;
2367
2368 // Instantaneous battery current in microamperes(µA).
2369 optional int64 current_avg_ua = 4;
2370}
2371
2372// End of protos/perfetto/trace/power/battery_counters.proto
2373
Esteban Talavera7714cec2019-01-31 15:53:34 +00002374// Begin of protos/perfetto/trace/power/power_rails.proto
2375
2376message PowerRails {
2377
2378 message RailDescriptor {
2379 // Index corresponding to the rail
2380 optional uint32 index = 1;
2381 // Name of the rail
2382 optional string rail_name = 2;
2383 // Name of the subsystem to which this rail belongs
2384 optional string subsys_name = 3;
2385 // Hardware sampling rate
2386 optional uint32 sampling_rate = 4;
2387 }
2388
2389 // This is only emitted at the beginning of the trace.
2390 repeated RailDescriptor rail_descriptor = 1;
2391
2392 message EnergyData {
2393 // Index corresponding to RailDescriptor.index
2394 optional uint32 index = 1;
2395 // Time since device boot(CLOCK_BOOTTIME) in milli-seconds
2396 optional uint64 timestamp_ms = 2;
2397 // Accumulated energy since device boot in microwatt-seconds (uWs)
2398 optional uint64 energy = 3;
2399 }
2400
2401 repeated EnergyData energy_data = 2;
2402}
2403
2404// End of protos/perfetto/trace/power/power_rails.proto
2405
Hector Dearman685f7522019-03-12 14:28:56 +00002406// Begin of protos/perfetto/trace/profiling/profile_packet.proto
2407
2408message ProfilePacket {
2409 // either a function or library name.
2410 repeated InternedString strings = 1;
2411 message InternedString {
2412 optional uint64 id = 1;
2413 optional bytes str = 2;
2414 }
2415
2416 repeated Frame frames = 2;
2417 message Frame {
2418 optional uint64 id = 1; // Interning key
2419 // E.g. "fopen"
2420 optional uint64 function_name_id = 2; // id of string.
2421 optional uint64 mapping_id = 3;
2422 optional uint64 rel_pc = 4;
2423 }
2424
2425 repeated Callstack callstacks = 3;
2426 message Callstack {
2427 optional uint64 id = 1;
2428 // Frames of this callstack. Bottom frame first.
2429 repeated uint64 frame_ids = 2;
2430 }
2431
2432 repeated Mapping mappings = 4;
2433 message Mapping {
2434 optional uint64 id = 1; // Interning key.
2435 optional uint64 build_id = 2; // Interning key.
2436 optional uint64 offset = 3;
2437 optional uint64 start = 4;
2438 optional uint64 end = 5;
2439 optional uint64 load_bias = 6;
2440 // E.g. ["system", "lib64", "libc.so"]
2441 repeated uint64 path_string_ids = 7; // id of string.
2442 }
2443
2444 message HeapSample {
2445 optional uint64 callstack_id = 1;
2446 // bytes allocated at this frame.
2447 optional uint64 self_allocated = 2;
2448 // bytes freed at this frame.
2449 optional uint64 self_freed = 3;
2450 optional uint64 timestamp = 4; // timestamp [opt]
2451 optional uint64 alloc_count = 5;
2452 optional uint64 free_count = 6;
2453 }
2454
2455 repeated ProcessHeapSamples process_dumps = 5;
Florian Mayerdba63f72019-03-27 10:20:46 +00002456 message ProcessStats {
2457 optional uint64 unwinding_errors = 1;
2458 optional uint64 heap_samples = 2;
2459 optional uint64 map_reparses = 3;
2460 }
Florian Mayerd0335fe2019-03-27 10:20:22 +00002461
Hector Dearman685f7522019-03-12 14:28:56 +00002462 message ProcessHeapSamples {
2463 optional uint64 pid = 1;
Florian Mayerd0335fe2019-03-27 10:20:22 +00002464
2465 // This process was profiled from startup.
2466 // If false, this process was already running when profiling started.
2467 optional bool from_startup = 3;
2468
2469 // This process was not profiled because a concurrent session was active.
2470 // If this is true, samples will be empty.
2471 optional bool rejected_concurrent = 4;
Florian Mayer22e08dc2019-03-28 11:36:02 +00002472
2473 // This process disconnected while it was profiled.
2474 // If false, the process outlived the profiling session.
2475 optional bool disconnected = 6;
2476
Florian Mayerd0335fe2019-03-27 10:20:22 +00002477 optional ProcessStats stats = 5;
2478
Hector Dearman685f7522019-03-12 14:28:56 +00002479 repeated HeapSample samples = 2;
2480 }
2481
2482 optional bool continued = 6;
2483 optional uint64 index = 7;
2484}
2485
2486// End of protos/perfetto/trace/profiling/profile_packet.proto
2487
Hector Dearmane92c6742018-11-22 21:42:39 +00002488// Begin of protos/perfetto/trace/ps/process_stats.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002489
Hector Dearmane92c6742018-11-22 21:42:39 +00002490// Per-process periodically sampled stats. These samples are wrapped in a
2491// dedicated message (as opposite to be fields in process_tree.proto) because
2492// they are dumped at a different rate than cmdline and thread list.
Lalit Maganti999355c2019-03-27 18:17:08 +00002493// Note: not all of these stats will be present in every ProcessStats message
2494// and sometimes processes may be missing . This is because counters are
2495// cached to reduce emission of counters which do not change.
Hector Dearmane92c6742018-11-22 21:42:39 +00002496message ProcessStats {
Lalit Maganti6820abc2019-01-21 11:12:23 +00002497 message Process {
Hector Dearmane92c6742018-11-22 21:42:39 +00002498 optional int32 pid = 1;
Lalit Maganti6820abc2019-01-21 11:12:23 +00002499
2500 // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
Hector Dearmane92c6742018-11-22 21:42:39 +00002501 optional uint64 vm_size_kb = 2;
2502 optional uint64 vm_rss_kb = 3;
2503 optional uint64 rss_anon_kb = 4;
2504 optional uint64 rss_file_kb = 5;
2505 optional uint64 rss_shmem_kb = 6;
2506 optional uint64 vm_swap_kb = 7;
2507 optional uint64 vm_locked_kb = 8;
2508 optional uint64 vm_hwm_kb = 9;
2509 // When adding a new field remember to update kProcMemCounterSize in
2510 // the trace processor.
Lalit Maganti6820abc2019-01-21 11:12:23 +00002511
2512 optional int64 oom_score_adj = 10;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002513 }
Lalit Maganti6820abc2019-01-21 11:12:23 +00002514 repeated Process processes = 1;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002515}
2516
Hector Dearmane92c6742018-11-22 21:42:39 +00002517// End of protos/perfetto/trace/ps/process_stats.proto
2518
2519// Begin of protos/perfetto/trace/ps/process_tree.proto
2520
2521message ProcessTree {
2522 // Representation of a thread.
2523 message Thread {
2524 // The thread id (as per gettid())
2525 optional int32 tid = 1;
2526
2527 // Thread group id (i.e. the PID of the process, == TID of the main thread)
2528 optional int32 tgid = 3;
2529
2530 // The name of the thread.
2531 optional string name = 2;
2532 }
2533
2534 // Representation of a process.
2535 message Process {
2536 // The UNIX process ID, aka thread group ID (as per getpid()).
2537 optional int32 pid = 1;
2538
2539 // The parent process ID, as per getppid().
2540 optional int32 ppid = 2;
2541
2542 // The command line for the process, as per /proc/pid/cmdline.
2543 // If it is a kernel thread there will only be one cmdline field
2544 // and it will contain /proc/pid/comm.
2545 repeated string cmdline = 3;
2546
2547 // No longer used as of Apr 2018, when the dedicated |threads| field was
2548 // introduced in ProcessTree.
2549 repeated Thread threads_deprecated = 4 [deprecated = true];
2550 }
2551
2552 // List of processes and threads in the client. These lists are incremental
2553 // and not exhaustive. A process and its threads might show up separately in
2554 // different ProcessTree messages. A thread might event not show up at all, if
2555 // no sched_switch activity was detected, for instance:
2556 // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
2557 // #1 { threads: [{pid: 12, tgid: 10}] }
2558 // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
2559 repeated Process processes = 1;
2560 repeated Thread threads = 2;
2561}
2562
2563// End of protos/perfetto/trace/ps/process_tree.proto
2564
2565// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
2566
2567// Various Linux system stat counters from /proc.
2568// The fields in this message can be reported at different rates and with
2569// different granularity. See sys_stats_config.proto.
2570message SysStats {
2571 // Counters from /proc/meminfo. Values are in KB.
2572 message MeminfoValue {
2573 optional MeminfoCounters key = 1;
2574 optional uint64 value = 2;
2575 };
2576 repeated MeminfoValue meminfo = 1;
2577
2578 // Counter from /proc/vmstat. Units are often pages, not KB.
2579 message VmstatValue {
2580 optional VmstatCounters key = 1;
2581 optional uint64 value = 2;
2582 };
2583 repeated VmstatValue vmstat = 2;
2584
2585 // Times in each mode, since boot. Unit: nanoseconds.
2586 message CpuTimes {
2587 optional uint32 cpu_id = 1;
2588 optional uint64 user_ns = 2; // Time spent in user mode.
2589 optional uint64 user_ice_ns = 3; // Time spent in user mode (low prio).
2590 optional uint64 system_mode_ns = 4; // Time spent in system mode.
2591 optional uint64 idle_ns = 5; // Time spent in the idle task.
2592 optional uint64 io_wait_ns = 6; // Time spent waiting for I/O.
2593 optional uint64 irq_ns = 7; // Time spent servicing interrupts.
2594 optional uint64 softirq_ns = 8; // Time spent servicing softirqs.
2595 }
2596 repeated CpuTimes cpu_stat = 3; // One entry per cpu.
2597
2598 // Num processes forked since boot.
2599 // Populated only if FORK_COUNT in config.stat_counters.
2600 optional uint64 num_forks = 4;
2601
2602 message InterruptCount {
2603 optional int32 irq = 1;
2604 optional uint64 count = 2;
2605 }
2606
2607 // Number of interrupts, broken by IRQ number.
2608 // Populated only if IRQ_COUNTS in config.stat_counters.
2609 optional uint64 num_irq_total = 5; // Total num of irqs serviced since boot.
2610 repeated InterruptCount num_irq = 6;
2611
2612 // Number of softirqs, broken by softirq number.
2613 // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
2614 optional uint64 num_softirq_total = 7; // Total num of softirqs since boot.
2615 repeated InterruptCount num_softirq = 8; // Per-softirq count.
2616}
2617
2618// End of protos/perfetto/trace/sys_stats/sys_stats.proto
2619
Hector Dearman685f7522019-03-12 14:28:56 +00002620// Begin of protos/perfetto/trace/system_info.proto
2621
2622message Utsname {
2623 optional string sysname = 1;
2624 optional string version = 2;
2625 optional string release = 3;
2626 optional string machine = 4;
2627}
2628
2629message SystemInfo {
2630 optional Utsname utsname = 1;
2631}
2632
2633// End of protos/perfetto/trace/system_info.proto
2634
Hector Dearmane92c6742018-11-22 21:42:39 +00002635// Begin of protos/perfetto/trace/trace.proto
2636
2637message Trace {
2638 repeated TracePacket packet = 1;
2639
2640 // Do NOT add any other field here. This is just a convenience wrapper for
2641 // the use case of a trace being saved to a file. There are other cases
2642 // (streaming) where TracePacket are directly streamed without being wrapped
2643 // in a Trace proto. Nothing should ever rely on the full trace, all the
2644 // logic should be based on TracePacket(s).
2645}
2646
2647// End of protos/perfetto/trace/trace.proto
2648
2649// Begin of protos/perfetto/trace/trace_packet.proto
2650
2651// The root object emitted by Perfetto. A perfetto trace is just a stream of
2652// TracePacket(s).
2653//
Eric Secklerc73ef062019-02-25 12:30:35 +00002654// Next reserved id: 13 (up to 15).
Hector Dearman685f7522019-03-12 14:28:56 +00002655// Next id: 46.
Hector Dearmane92c6742018-11-22 21:42:39 +00002656message TracePacket {
Lalit Maganti64bcc242018-12-05 13:35:08 +00002657 // TODO(primiano): in future we should add a timestamp_clock_domain field to
Hector Dearmane92c6742018-11-22 21:42:39 +00002658 // allow mixing timestamps from different clock domains.
2659 optional uint64 timestamp = 8; // Timestamp [ns].
2660
2661 oneof data {
2662 FtraceEventBundle ftrace_events = 1;
2663 ProcessTree process_tree = 2;
2664 ProcessStats process_stats = 9;
2665 InodeFileMap inode_file_map = 4;
2666 // removed field with id 5
2667 ClockSnapshot clock_snapshot = 6;
2668 SysStats sys_stats = 7;
Eric Secklerc73ef062019-02-25 12:30:35 +00002669 TrackEvent track_event = 11;
Hector Dearmane92c6742018-11-22 21:42:39 +00002670
Eric Secklerc73ef062019-02-25 12:30:35 +00002671 // IDs up to 15 are reserved. They take only one byte to encode their
2672 // preamble so should be used for freqeuent events.
Hector Dearmane92c6742018-11-22 21:42:39 +00002673
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00002674 TraceConfig trace_config = 33;
Hector Dearmane92c6742018-11-22 21:42:39 +00002675 FtraceStats ftrace_stats = 34;
2676 // removed field with id 35
Florian Mayer84113672019-01-21 14:48:27 +00002677 ProfilePacket profile_packet = 37;
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01002678 BatteryCounters battery = 38;
Esteban Talavera7714cec2019-01-31 15:53:34 +00002679 PowerRails power_rails = 40;
Primiano Tucci64df2ca2019-01-03 22:26:47 +00002680 AndroidLogPacket android_log = 39;
Hector Dearman685f7522019-03-12 14:28:56 +00002681 SystemInfo system_info = 45;
Hector Dearmane92c6742018-11-22 21:42:39 +00002682
Eric Secklerc73ef062019-02-25 12:30:35 +00002683 // Only used by TrackEvent.
2684 ProcessDescriptor process_descriptor = 43;
2685 ThreadDescriptor thread_descriptor = 44;
2686
Hector Dearmane92c6742018-11-22 21:42:39 +00002687 // This field is emitted at periodic intervals (~10s) and
2688 // contains always the binary representation of the UUID
2689 // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
2690 // efficiently partition long traces without having to fully parse them.
2691 bytes synchronization_marker = 36;
2692
2693 // This field is only used for testing.
2694 // removed field with id 268435455 // 2^28 - 1, max field id for protos.
2695 }
2696
2697 // Trusted user id of the producer which generated this packet. Keep in sync
2698 // with TrustedPacket.trusted_uid.
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00002699 //
2700 // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
2701 // instead.
Hector Dearmane92c6742018-11-22 21:42:39 +00002702 oneof optional_trusted_uid { int32 trusted_uid = 3; };
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00002703
2704 // Service-assigned identifier of the packet sequence this packet belongs to.
2705 // Uniquely identifies a producer + writer pair within the tracing session. A
2706 // value of zero denotes an invalid ID. Keep in sync with
2707 // TrustedPacket.trusted_packet_sequence_id.
2708 oneof optional_trusted_packet_sequence_id {
2709 uint32 trusted_packet_sequence_id = 10;
2710 }
Eric Secklerc73ef062019-02-25 12:30:35 +00002711
2712 // Incrementally emitted interned data, valid only on the packet's sequence
2713 // (packets with the same |trusted_packet_sequence_id|). The writer will
2714 // usually emit new interned data in the same TracePacket that first refers to
2715 // it (since the last reset of interning state). It may also be emitted
2716 // proactively in advance of referring to them in later packets.
2717 optional InternedData interned_data = 12;
2718
2719 // Set to true by the writer to indicate that it will re-emit any incremental
2720 // data for the packet's sequence before referring to it again. This includes
2721 // interned data as well as periodically emitted data like
2722 // Process/ThreadDescriptors. This flag only affects the current packet
2723 // sequence (see |trusted_packet_sequence_id|).
2724 //
2725 // When set to true, this TracePacket and subsequent TracePackets on the same
2726 // sequence will not refer to any incremental data emitted before this
2727 // TracePacket. For example, previously emitted interned data will be
2728 // re-emitted if it is referred to again.
2729 //
2730 // When the reader detects packet loss (|previous_packet_dropped|), it needs
2731 // to skip packets in the sequence until the next one with this flag set, to
2732 // ensure intact incremental data.
2733 optional bool incremental_state_cleared = 41;
2734
Ryan Savitskia9097812019-03-26 16:13:25 +00002735 // Flag set by the service if, for the current packet sequence (see
2736 // |trusted_packet_sequence_id|), either:
2737 // * this is the first packet, or
2738 // * one or multiple packets were dropped since the last packet that the
2739 // consumer read from the sequence. This can happen if chunks in the trace
2740 // buffer are overridden before the consumer could read them when the trace
2741 // is configured in ring buffer mode.
Eric Secklerc73ef062019-02-25 12:30:35 +00002742 //
2743 // When packet loss occurs, incrementally emitted data (including interned
2744 // data) on the sequence should be considered invalid up until the next packet
Ryan Savitskia9097812019-03-26 16:13:25 +00002745 // with |incremental_state_cleared| set.
Eric Secklerc73ef062019-02-25 12:30:35 +00002746 optional bool previous_packet_dropped = 42;
Hector Dearmane92c6742018-11-22 21:42:39 +00002747}
2748
2749// End of protos/perfetto/trace/trace_packet.proto
Florian Mayer84113672019-01-21 14:48:27 +00002750
Eric Secklerc73ef062019-02-25 12:30:35 +00002751// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
2752
2753// Key/value annotations provided in untyped TRACE_EVENT macros. These
2754// annotations are intended for debug use and are not considered a stable API
2755// surface. As such, they should not be relied upon to implement (new) metrics.
2756message DebugAnnotation {
2757 message NestedValue {
2758 enum NestedType {
2759 UNSPECIFIED = 0; // leaf value.
2760 DICT = 1;
2761 ARRAY = 2;
2762 }
2763 optional NestedType nested_type = 1;
2764
2765 repeated string dict_keys = 2;
2766 repeated NestedValue dict_values = 3;
2767 repeated NestedValue array_values = 4;
2768 optional int64 int_value = 5;
2769 optional double double_value = 6;
2770 optional bool bool_value = 7;
2771 optional string string_value = 8;
2772 }
2773
2774 optional uint32 name_iid = 1; // interned DebugAnnotationName.
2775
2776 oneof value {
2777 bool bool_value = 2;
2778 uint64 uint_value = 3;
2779 int64 int_value = 4;
2780 double double_value = 5;
2781 string string_value = 6;
2782 // Pointers are stored in a separate type as the JSON output treats them
2783 // differently from other uint64 values.
2784 uint64 pointer_value = 7;
2785 NestedValue nested_value = 8;
2786
2787 // Legacy instrumentation may not support conversion of nested data to
2788 // NestedValue yet.
2789 string legacy_json_value = 9;
2790 }
2791}
2792
2793// --------------------
2794// Interned data types:
2795// --------------------
2796
2797message DebugAnnotationName {
2798 optional uint32 iid = 1;
2799 optional string name = 2;
2800}
2801
2802// End of protos/perfetto/trace/track_event/debug_annotation.proto
2803
2804// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
2805
2806// Process-wide data that is periodically emitted by one thread per process.
2807// Valid for all events in packet sequences emitted by the same process.
2808//
2809// Next id: 5.
2810message ProcessDescriptor {
2811 optional int32 pid = 1;
2812 repeated string cmdline = 2;
2813
2814 // To support old UI. New UI should determine default sorting by process_type.
2815 optional int32 legacy_sort_index = 3;
2816
2817 // See chromium's content::ProcessType.
2818 enum ChromeProcessType {
Eric Seckler59945762019-03-04 11:48:25 +00002819 PROCESS_UNSPECIFIED = 0;
2820 PROCESS_BROWSER = 1;
2821 PROCESS_RENDERER = 2;
2822 PROCESS_UTILITY = 3;
2823 PROCESS_ZYGOTE = 4;
2824 PROCESS_SANDBOX_HELPER = 5;
2825 PROCESS_GPU = 6;
2826 PROCESS_PPAPI_PLUGIN = 7;
2827 PROCESS_PPAPI_BROKER = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00002828 }
2829 optional ChromeProcessType chrome_process_type = 4;
2830}
2831
2832// End of protos/perfetto/trace/track_event/process_descriptor.proto
2833
2834// Begin of protos/perfetto/trace/track_event/task_execution.proto
2835
2836// TrackEvent arguments describing the execution of a task.
2837message TaskExecution {
2838 // Source location that the task was posted from.
2839 optional uint32 posted_from_iid = 1; // interned SourceLocation.
2840}
2841
2842// --------------------
2843// Interned data types:
2844// --------------------
2845
2846message SourceLocation {
2847 optional uint32 iid = 1;
2848
2849 // We intend to add a binary symbol version of this in the future.
2850 optional string file_name = 2;
2851 optional string function_name = 3;
2852}
2853
2854// End of protos/perfetto/trace/track_event/task_execution.proto
2855
2856// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
2857
2858// Periodically emitted data that's common to all events emitted by the same
2859// thread, i.e. all events in the same packet sequence. Valid for all subsequent
2860// events in the same sequence.
2861//
2862// Next id: 8.
2863message ThreadDescriptor {
2864 optional int32 pid = 1;
2865 optional int32 tid = 2;
2866
2867 // To support old UI. New UI should determine default sorting by thread_type.
2868 optional int32 legacy_sort_index = 3;
2869
2870 enum ChromeThreadType {
Eric Seckler59945762019-03-04 11:48:25 +00002871 THREAD_UNSPECIFIED = 0;
2872 // TODO(eseckler): Add thread types.
Eric Secklerc73ef062019-02-25 12:30:35 +00002873 };
Eric Seckler14167852019-03-26 09:20:09 +00002874 optional ChromeThreadType chrome_thread_type = 4;
Eric Secklerc73ef062019-02-25 12:30:35 +00002875
2876 // TODO(eseckler): Replace this with ChromeThreadType where possible.
2877 optional string thread_name = 5;
2878
2879 // Absolute reference values. Clock values in subsequent TrackEvents can be
2880 // encoded accumulatively and relative to these. This reduces their var-int
2881 // encoding size.
2882 optional int64 reference_timestamp_us = 6;
2883 optional int64 reference_thread_time_us = 7;
2884}
2885
2886// End of protos/perfetto/trace/track_event/thread_descriptor.proto
2887
2888// Begin of protos/perfetto/trace/track_event/track_event.proto
2889
2890// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
2891// which describe activity on a track, such as a thread, task sequence, or
2892// asynchronous track.
2893//
2894// This message is optimized for writing and makes heavy use of data interning
2895// and delta encoding (e.g. of timestamps) to reduce data repetition and encoded
2896// data size.
2897//
2898// A TrackEvent exists in the context of its packet sequence (TracePackets
2899// emitted by the same producer + writer) and refers to data in preceding
2900// TracePackets emitted on the same sequence, both directly and indirectly. For
2901// example, interned data entries are emitted as part of a TracePacket and
2902// directly referred to from TrackEvents by their interning IDs. Attributes
2903// shared by all events on the same sequence (e.g. their thread and process
2904// association) are emitted as part of ProcessDescriptor and ThreadDescriptor
2905// messages in separate TracePackets instead.
2906//
2907// Next reserved id: 7 (up to 15).
2908// Next id: 20.
2909message TrackEvent {
2910 // Timestamp in microseconds (usually CLOCK_MONOTONIC).
2911 oneof timestamp {
2912 // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
2913 // calculate the absolute timestamp value, sum up all delta values of the
2914 // preceding TrackEvents since the last ThreadDescriptor and add the sum to
2915 // the |reference_timestamp| in ThreadDescriptor. This value should always
2916 // be positive.
2917 int64 timestamp_delta_us = 1;
2918 // Absolute value (e.g. a manually specified timestamp in the macro).
2919 // This is a one-off value that does not affect delta timestamp computation
2920 // in subsequent TrackEvents.
2921 int64 timestamp_absolute_us = 16;
2922 }
2923
2924 // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
2925 // microseconds.
2926 oneof thread_time {
2927 // Same encoding as |timestamp| fields above.
2928 int64 thread_time_delta_us = 2;
2929 // TODO(eseckler): Consider removing absolute thread time support. It's
2930 // currently required to support writing PHASE_COMPLETE events out-of-order,
2931 // but shouldn't be required anymore when we split them into begin/end.
2932 int64 thread_time_absolute_us = 17;
2933 }
2934
2935 // We intend to add a binary symbol version of this in the future.
2936 repeated uint32 category_iids = 3; // interned EventCategoryName.
2937
2938 // TODO(eseckler): May also want a debug_name for untyped debug-only events.
2939
2940 // Unstable key/value annotations shown in the trace viewer but not intended
2941 // for metrics use.
2942 repeated DebugAnnotation debug_annotations = 4;
2943
2944 // Typed event arguments:
2945 optional TaskExecution task_execution = 5;
2946 // TODO(eseckler): New argument types go here :)
2947
2948 // Apart from {category, time, thread time, tid, pid}, other legacy trace
2949 // event attributes are initially simply proxied for conversion to a JSON
2950 // trace. We intend to gradually transition these attributes to similar native
2951 // features in TrackEvent (e.g. async + flow events), or deprecate them
2952 // without replacement where transition is unsuitable.
Eric Seckler59945762019-03-04 11:48:25 +00002953 //
2954 // Next reserved id: 15 (up to 16).
2955 // Next id: 20.
Eric Secklerc73ef062019-02-25 12:30:35 +00002956 message LegacyEvent {
2957 optional uint32 name_iid = 1; // interned LegacyEventName.
2958 optional int32 phase = 2;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00002959 optional int64 duration_us = 3;
2960 optional int64 thread_duration_us = 4;
Eric Seckler59945762019-03-04 11:48:25 +00002961
Eric Seckler7f2c5e42019-03-05 08:59:02 +00002962 reserved 5; // used to be |flags|.
Eric Seckler59945762019-03-04 11:48:25 +00002963
Eric Seckler7f2c5e42019-03-05 08:59:02 +00002964 oneof id {
2965 uint64 unscoped_id = 6;
2966 uint64 local_id = 10;
2967 uint64 global_id = 11;
2968 }
2969 // Additional optional scope for |id|.
2970 optional string id_scope = 7;
Eric Seckler59945762019-03-04 11:48:25 +00002971
2972 // Consider the thread timestamps for async BEGIN/END event pairs as valid.
2973 optional bool use_async_tts = 9;
2974
Eric Seckler7f2c5e42019-03-05 08:59:02 +00002975 // Idenfifies a flow. Flow events with the same bind_id are connected.
Eric Secklerc73ef062019-02-25 12:30:35 +00002976 optional uint64 bind_id = 8;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00002977 // Use the enclosing slice as binding point for a flow end event instead of
2978 // the next slice. Flow start/step events always bind to the enclosing
2979 // slice.
Eric Seckler59945762019-03-04 11:48:25 +00002980 optional bool bind_to_enclosing = 12;
2981
2982 enum FlowDirection {
2983 FLOW_UNSPECIFIED = 0;
2984 FLOW_IN = 1;
2985 FLOW_OUT = 2;
2986 FLOW_INOUT = 3;
2987 }
2988 optional FlowDirection flow_direction = 13;
2989
2990 enum InstantEventScope {
2991 SCOPE_UNSPECIFIED = 0;
2992 SCOPE_GLOBAL = 1;
2993 SCOPE_PROCESS = 2;
2994 SCOPE_THREAD = 3;
2995 }
2996 optional InstantEventScope instant_event_scope = 14;
Eric Secklerc73ef062019-02-25 12:30:35 +00002997
2998 // Override the pid/tid if the writer needs to emit events on behalf of
2999 // another process/thread. This should be the exception. Normally, the
3000 // pid+tid from ThreadDescriptor is used.
3001 optional int32 pid_override = 18;
3002 optional int32 tid_override = 19;
3003 }
3004
3005 optional LegacyEvent legacy_event = 6;
3006}
3007
3008// --------------------
3009// Interned data types:
3010// --------------------
3011
3012message EventCategory {
3013 optional uint32 iid = 1;
3014 optional string name = 2;
3015}
3016
3017message LegacyEventName {
3018 optional uint32 iid = 1;
3019 optional string name = 2;
3020}
3021
3022// End of protos/perfetto/trace/track_event/track_event.proto
3023
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003024// Begin of protos/perfetto/config/android/android_log_config.proto
3025
3026message AndroidLogConfig {
3027 repeated AndroidLogId log_ids = 1;
3028
3029 reserved 2; // Was |poll_ms|, deprecated.
3030
3031 // If set ignores all log messages whose prio is < the given value.
3032 optional AndroidLogPriority min_prio = 3;
3033
3034 // If non-empty ignores all log messages whose tag doesn't match one of the
3035 // specified values.
3036 repeated string filter_tags = 4;
3037}
3038
3039// End of protos/perfetto/config/android/android_log_config.proto
3040
3041// Begin of protos/perfetto/config/chrome/chrome_config.proto
3042
3043// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3044// to reflect changes in the corresponding C++ headers.
3045
3046message ChromeConfig {
3047 optional string trace_config = 1;
3048}
3049
3050// End of protos/perfetto/config/chrome/chrome_config.proto
3051
3052// Begin of protos/perfetto/config/data_source_config.proto
3053
3054// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3055// to reflect changes in the corresponding C++ headers.
3056
3057// The configuration that is passed to each data source when starting tracing.
3058message DataSourceConfig {
3059 // Data source unique name, e.g., "linux.ftrace". This must match
3060 // the name passed by the data source when it registers (see
3061 // RegisterDataSource()).
3062 optional string name = 1;
3063
3064 // The index of the logging buffer where TracePacket(s) will be stored.
3065 // This field doesn't make a major difference for the Producer(s). The final
3066 // logging buffers, in fact, are completely owned by the Service. We just ask
3067 // the Producer to copy this number into the chunk headers it emits, so that
3068 // the Service can quickly identify the buffer where to move the chunks into
3069 // without expensive lookups on its fastpath.
3070 optional uint32 target_buffer = 2;
3071
3072 // Set by the service to indicate the duration of the trace.
3073 // DO NOT SET in consumer as this will be overridden by the service.
3074 optional uint32 trace_duration_ms = 3;
3075
3076 // Set by the service to indicate which tracing session the data source
3077 // belongs to. The intended use case for this is checking if two data sources,
3078 // one of which produces metadata for the other one, belong to the same trace
3079 // session and hence should be linked together.
3080 // This field was introduced in Aug 2018 after Android P.
3081 optional uint64 tracing_session_id = 4;
3082
3083 // Keeep the lower IDs (up to 99) for fields that are *not* specific to
3084 // data-sources and needs to be processed by the traced daemon.
3085
3086 optional FtraceConfig ftrace_config = 100;
3087 optional ChromeConfig chrome_config = 101;
3088 optional InodeFileConfig inode_file_config = 102;
3089 optional ProcessStatsConfig process_stats_config = 103;
3090 optional SysStatsConfig sys_stats_config = 104;
3091 optional HeapprofdConfig heapprofd_config = 105;
3092 optional AndroidPowerConfig android_power_config = 106;
3093 optional AndroidLogConfig android_log_config = 107;
3094
3095 // This is a fallback mechanism to send a free-form text config to the
3096 // producer. In theory this should never be needed. All the code that
3097 // is part of the platform (i.e. traced service) is supposed to *not* truncate
3098 // the trace config proto and propagate unknown fields. However, if anything
3099 // in the pipeline (client or backend) ends up breaking this forward compat
3100 // plan, this field will become the escape hatch to allow future data sources
3101 // to get some meaningful configuration.
3102 optional string legacy_config = 1000;
3103
3104 // This field is only used for testing.
3105 optional TestConfig for_testing =
3106 268435455; // 2^28 - 1, max field id for protos supported by Java.
3107}
3108
3109// End of protos/perfetto/config/data_source_config.proto
3110
3111// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
3112
3113// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3114// to reflect changes in the corresponding C++ headers.
3115
3116message FtraceConfig {
3117 repeated string ftrace_events = 1;
3118 repeated string atrace_categories = 2;
3119 repeated string atrace_apps = 3;
3120 // *Per-CPU* buffer size.
3121 optional uint32 buffer_size_kb = 10;
3122 optional uint32 drain_period_ms = 11;
3123}
3124
3125// End of protos/perfetto/config/ftrace/ftrace_config.proto
3126
3127// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
3128
3129// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3130// to reflect changes in the corresponding C++ headers.
3131
3132message InodeFileConfig {
3133 message MountPointMappingEntry {
3134 optional string mountpoint = 1;
3135 repeated string scan_roots = 2;
3136 }
3137
3138 // How long to pause between batches.
3139 optional uint32 scan_interval_ms = 1;
3140
3141 // How long to wait before the first scan in order to accumulate inodes.
3142 optional uint32 scan_delay_ms = 2;
3143
3144 // How many inodes to scan in one batch.
3145 optional uint32 scan_batch_size = 3;
3146
3147 // Do not scan for inodes not found in the static map.
3148 optional bool do_not_scan = 4;
3149
3150 // If non-empty, only scan inodes corresponding to block devices named in
3151 // this list.
3152 repeated string scan_mount_points = 5;
3153
3154 // When encountering an inode belonging to a block device corresponding
3155 // to one of the mount points in this map, scan its scan_roots instead.
3156 repeated MountPointMappingEntry mount_point_mapping = 6;
3157}
3158
3159// End of protos/perfetto/config/inode_file/inode_file_config.proto
3160
3161// Begin of protos/perfetto/config/power/android_power_config.proto
3162
3163message AndroidPowerConfig {
3164 enum BatteryCounters {
3165 BATTERY_COUNTER_UNSPECIFIED = 0;
3166 BATTERY_COUNTER_CHARGE = 1; // Coulomb counter.
3167 BATTERY_COUNTER_CAPACITY_PERCENT = 2; // Charge (%).
3168 BATTERY_COUNTER_CURRENT = 3; // Instantaneous current.
3169 BATTERY_COUNTER_CURRENT_AVG = 4; // Avg current.
3170 }
3171 optional uint32 battery_poll_ms = 1;
3172 repeated BatteryCounters battery_counters = 2;
3173
3174 // Where available enables per-power-rail measurements.
3175 optional bool collect_power_rails = 3;
3176}
3177
3178// End of protos/perfetto/config/power/android_power_config.proto
3179
3180// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
3181
3182// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3183// to reflect changes in the corresponding C++ headers.
3184
3185message ProcessStatsConfig {
3186 enum Quirks {
3187 QUIRKS_UNSPECIFIED = 0;
3188
3189 // This has been deprecated and ignored as per 2018-05-01. Full scan at
3190 // startup is now disabled by default and can be re-enabled using the
3191 // |scan_all_processes_on_start| arg.
3192 DISABLE_INITIAL_DUMP = 1 [deprecated = true];
3193
3194 DISABLE_ON_DEMAND = 2;
3195 }
3196
3197 repeated Quirks quirks = 1;
3198
3199 // If enabled all processes will be scanned and dumped when the trace starts.
3200 optional bool scan_all_processes_on_start = 2;
3201
3202 // If enabled thread names are also recoded (this is redundant if sched_switch
3203 // is enabled).
3204 optional bool record_thread_names = 3;
3205
3206 // If > 0 samples counters (see process_stats.proto) from
3207 // /proc/pid/status and oom_score_adj every X ms.
3208 // This is required to be > 100ms to avoid excessive CPU usage.
3209 // TODO(primiano): add CPU cost for change this value.
3210 optional uint32 proc_stats_poll_ms = 4;
3211
3212 // If empty samples stats for all processes. If non empty samples stats only
3213 // for processes matching the given string in their argv0 (i.e. the first
3214 // entry of /proc/pid/cmdline).
3215 // TODO(primiano): implement this feature.
3216 // repeated string proc_stats_filter = 5;
Lalit Maganti999355c2019-03-27 18:17:08 +00003217
3218 // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
3219 // (default: |proc_stats_poll_ms|). If = 0, will be set to
3220 // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
3221 // multiple.
3222 optional uint32 proc_stats_cache_ttl_ms = 6;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003223}
3224
3225// End of protos/perfetto/config/process_stats/process_stats_config.proto
3226
3227// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
3228
3229// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3230// to reflect changes in the corresponding C++ headers.
3231
3232// This file defines the configuration for the Linux /proc poller data source,
3233// which injects counters in the trace.
3234// Counters that are needed in the trace must be explicitly listed in the
3235// *_counters fields. This is to avoid spamming the trace with all counters
3236// at all times.
3237// The sampling rate is configurable. All polling rates (*_period_ms) need
3238// to be integer multiples of each other.
3239// OK: [10ms, 10ms, 10ms], [10ms, 20ms, 10ms], [10ms, 20ms, 60ms]
3240// Not OK: [10ms, 10ms, 11ms], [10ms, 15ms, 20ms]
3241message SysStatsConfig {
3242 // Polls /proc/meminfo every X ms, if non-zero.
3243 // This is required to be > 10ms to avoid excessive CPU usage.
3244 // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
3245 optional uint32 meminfo_period_ms = 1;
3246
3247 // Only the counters specified below are reported.
3248 repeated MeminfoCounters meminfo_counters = 2;
3249
3250 // Polls /proc/vmstat every X ms, if non-zero.
3251 // This is required to be > 10ms to avoid excessive CPU usage.
3252 // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
3253 optional uint32 vmstat_period_ms = 3;
3254 repeated VmstatCounters vmstat_counters = 4;
3255
3256 // Pols /proc/stat every X ms, if non-zero.
3257 // This is required to be > 10ms to avoid excessive CPU usage.
3258 // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
3259 optional uint32 stat_period_ms = 5;
3260 enum StatCounters {
3261 STAT_UNSPECIFIED = 0;
3262 STAT_CPU_TIMES = 1;
3263 STAT_IRQ_COUNTS = 2;
3264 STAT_SOFTIRQ_COUNTS = 3;
3265 STAT_FORK_COUNT = 4;
3266 }
3267 repeated StatCounters stat_counters = 6;
3268}
3269
3270// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
3271
3272// Begin of protos/perfetto/config/test_config.proto
3273
3274// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3275// to reflect changes in the corresponding C++ headers.
3276
3277// The configuration for a fake producer used in tests.
3278message TestConfig {
3279 message DummyFields {
3280 optional uint32 field_uint32 = 1;
3281 optional int32 field_int32 = 2;
3282 optional uint64 field_uint64 = 3;
3283 optional int64 field_int64 = 4;
3284 optional fixed64 field_fixed64 = 5;
3285 optional sfixed64 field_sfixed64 = 6;
3286 optional fixed32 field_fixed32 = 7;
3287 optional sfixed32 field_sfixed32 = 8;
3288 optional double field_double = 9;
3289 optional float field_float = 10;
3290 optional sint64 field_sint64 = 11;
3291 optional sint32 field_sint32 = 12;
3292 optional string field_string = 13;
3293 optional bytes field_bytes = 14;
3294 }
3295
3296 // The number of messages the fake producer should send.
3297 optional uint32 message_count = 1;
3298
3299 // The maximum number of messages which should be sent each second.
3300 // The actual obserced speed may be lower if the producer is unable to
3301 // work fast enough.
3302 // If this is zero or unset, the producer will send as fast as possible.
3303 optional uint32 max_messages_per_second = 2;
3304
3305 // The seed value for a simple multiplicative congruential pseudo-random
3306 // number sequence.
3307 optional uint32 seed = 3;
3308
3309 // The size of each message in bytes. Should be greater than or equal 5 to
3310 // account for the number of bytes needed to encode the random number and a
3311 // null byte for the string.
3312 optional uint32 message_size = 4;
3313
3314 // Whether the producer should send a event batch when the data source is
3315 // is initially registered.
3316 optional bool send_batch_on_register = 5;
3317
3318 optional DummyFields dummy_fields = 6;
3319}
3320
3321// End of protos/perfetto/config/test_config.proto
3322
3323// Begin of protos/perfetto/config/trace_config.proto
3324
3325// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3326// to reflect changes in the corresponding C++ headers.
3327
3328// The overall config that is used when starting a new tracing session through
3329// ProducerPort::StartTracing().
3330// It contains the general config for the logging buffer(s) and the configs for
3331// all the data source being enabled.
3332//
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003333// Next id: 18.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003334message TraceConfig {
3335 message BufferConfig {
3336 optional uint32 size_kb = 1;
3337
3338 reserved 2; // |page_size|, now deprecated.
3339 reserved 3; // |optimize_for|, now deprecated.
3340
3341 enum FillPolicy {
3342 UNSPECIFIED = 0;
3343
3344 // Default behavior. The buffer operates as a conventional ring buffer.
3345 // If the writer is faster than the reader (or if the reader reads only
3346 // after tracing is stopped) newly written packets will overwrite old
3347 // packets.
3348 RING_BUFFER = 1;
3349
3350 // Behaves like RING_BUFFER as long as there is space in the buffer or
3351 // the reader catches up with the writer. As soon as the writer hits
3352 // an unread chunk, it stops accepting new data in the buffer.
3353 DISCARD = 2;
3354 }
3355 optional FillPolicy fill_policy = 4;
3356 }
3357 repeated BufferConfig buffers = 1;
3358
3359 message DataSource {
3360 // Filters and data-source specific config. It contains also the unique name
3361 // of the data source, the one passed in the DataSourceDescriptor when they
3362 // register on the service.
3363 optional protos.DataSourceConfig config = 1;
3364
3365 // Optional. If multiple producers (~processes) expose the same data source
3366 // and |producer_name_filter| != "", the data source is enabled only for
3367 // producers whose names match any of the producer_name_filter below.
3368 // The |producer_name_filter| has to be an exact match. (TODO(primiano):
3369 // support wildcards or regex).
3370 // This allows to enable a data source only for specific processes.
3371 // The "repeated" field has OR sematics: specifying a filter ["foo", "bar"]
3372 // will enable data source on both "foo" and "bar" (if existent).
3373 repeated string producer_name_filter = 2;
3374 }
3375 repeated DataSource data_sources = 2;
3376
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003377 // If specified, the trace will be stopped |duration_ms| after starting.
3378 // However in case of traces with triggers, see
3379 // TriggerConfig.trigger_timeout_ms instead.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003380 optional uint32 duration_ms = 3;
3381
3382 // This is set when --dropbox is passed to the Perfetto command line client
3383 // and enables guardrails that limit resource usage for traces requested
3384 // by statsd.
3385 optional bool enable_extra_guardrails = 4;
3386
3387 enum LockdownModeOperation {
3388 LOCKDOWN_UNCHANGED = 0;
3389 LOCKDOWN_CLEAR = 1;
3390 LOCKDOWN_SET = 2;
3391 }
3392 // Reject producers that are not running under the same UID as the tracing
3393 // service.
3394 optional LockdownModeOperation lockdown_mode = 5;
3395
3396 message ProducerConfig {
3397 // Identifies the producer for which this config is for.
3398 optional string producer_name = 1;
3399
3400 // Specifies the preferred size of the shared memory buffer. If the size is
3401 // larger than the max size, the max will be used. If it is smaller than
3402 // the page size or doesn't fit pages evenly into it, it will fall back to
3403 // the size specified by the producer or finally the default shared memory
3404 // size.
3405 optional uint32 shm_size_kb = 2;
3406
3407 // Specifies the preferred size of each page in the shared memory buffer.
3408 // Must be an integer multiple of 4K.
3409 optional uint32 page_size_kb = 3;
3410 }
3411
3412 repeated ProducerConfig producers = 6;
3413
3414 // Contains statsd-specific metadata about an alert associated with the trace.
3415 message StatsdMetadata {
3416 // The identifier of the alert which triggered this trace.
3417 optional int64 triggering_alert_id = 1;
3418 // The uid which registered the triggering configuration with statsd.
3419 optional int32 triggering_config_uid = 2;
3420 // The identifier of the config which triggered the alert.
3421 optional int64 triggering_config_id = 3;
3422 // The identifier of the subscription which triggered this trace.
3423 optional int64 triggering_subscription_id = 4;
3424 }
3425
3426 // Statsd-specific metadata.
3427 optional StatsdMetadata statsd_metadata = 7;
3428
3429 // When true, the EnableTracing() request must also provide a file descriptor.
3430 // The service will then periodically read packets out of the trace buffer and
3431 // store it into the passed file.
3432 optional bool write_into_file = 8;
3433
3434 // Optional. If non-zero tunes the write period. A min value of 100ms is
3435 // enforced (i.e. smaller values are ignored).
3436 optional uint32 file_write_period_ms = 9;
3437
3438 // Optional. When non zero the periodic write stops once at most X bytes
3439 // have been written into the file. Tracing is disabled when this limit is
3440 // reached, even if |duration_ms| has not been reached yet.
3441 optional uint64 max_file_size_bytes = 10;
3442
3443 // Contains flags which override the default values of the guardrails inside
3444 // Perfetto. These values are only affect userdebug builds.
3445 message GuardrailOverrides {
3446 // Override the default limit (in bytes) for uploading data to server within
3447 // a 24 hour period.
3448 optional uint64 max_upload_per_day_bytes = 1;
3449 }
3450
3451 optional GuardrailOverrides guardrail_overrides = 11;
3452
3453 // When true, data sources are not started until an explicit call to
3454 // StartTracing() on the consumer port. This is to support early
3455 // initialization and fast trace triggering. This can be used only when the
3456 // Consumer explicitly triggers the StartTracing() method.
3457 // This should not be used in a remote trace config via statsd, doing so will
3458 // result in a hung trace session.
3459 optional bool deferred_start = 12;
3460
3461 // When set, it periodically issues a Flush() to all data source, forcing them
3462 // to commit their data into the tracing service. This can be used for
3463 // quasi-real-time streaming mode and to guarantee some partial ordering of
3464 // events in the trace in windows of X ms.
3465 optional uint32 flush_period_ms = 13;
3466
3467 // Wait for this long for producers to acknowledge flush requests.
3468 // Default 5s.
3469 optional uint32 flush_timeout_ms = 14;
3470
3471 // Disable emitting clock timestamps into the trace.
3472 optional bool disable_clock_snapshotting = 15;
3473
3474 // Android-only. If set, sends an intent to the Traceur system app when the
3475 // trace ends to notify it about the trace readiness.
3476 optional bool notify_traceur = 16;
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003477
3478 // Triggers allow producers to start or stop the tracing session when an event
3479 // occurs.
3480 //
3481 // For example if we are tracing probabilistically, most traces will be
3482 // uninteresting. Triggers allow us to keep only the interesting ones such as
3483 // those traces during which the device temperature reached a certain
3484 // threshold. In this case the producer can activate a trigger to keep
3485 // (STOP_TRACING) the trace, otherwise it can also begin a trace
3486 // (START_TRACING) because it knows something is about to happen.
3487 message TriggerConfig {
3488 enum TriggerMode {
3489 UNSPECIFIED = 0;
3490
3491 // When this mode is chosen, data sources are not started until one of the
3492 // |triggers| are received. This supports early initialization and fast
3493 // starting of the tracing system. On triggering, the session will then
3494 // record for |stop_delay_ms|. However if no trigger is seen
3495 // after |trigger_timeout_ms| the session will be stopped and no data will
3496 // be returned.
3497 START_TRACING = 1;
3498
3499 // When this mode is chosen, the session will be started via the normal
3500 // EnableTracing() & StartTracing(). If no trigger is ever seen
3501 // the session will be stopped after |trigger_timeout_ms| and no data will
3502 // be returned. However if triggered the trace will stop after
3503 // |stop_delay_ms| and any data in the buffer will be returned to the
3504 // consumer.
3505 STOP_TRACING = 2;
3506 }
3507 optional TriggerMode trigger_mode = 1;
3508
3509 message Trigger {
3510 // The producer must specify this name to activate the trigger.
3511 optional string name = 1;
3512
3513 // The a std::regex that will match the producer that can activate this
3514 // trigger. This is optional. If unset any producers can activate this
3515 // trigger.
3516 optional string producer_name_regex = 2;
3517
3518 // After a trigger is received either in START_TRACING or STOP_TRACING
3519 // mode then the trace will end |stop_delay_ms| after triggering.
3520 optional uint32 stop_delay_ms = 3;
3521 }
3522 // A list of triggers which are related to this configuration. If ANY
3523 // trigger is seen then an action will be performed based on |trigger_mode|.
3524 repeated Trigger triggers = 2;
3525
3526 // Required and must be positive if a TriggerConfig is specified. This is
3527 // how long this TraceConfig should wait for a trigger to arrive. After this
3528 // period of time if no trigger is seen the TracingSession will be cleaned
3529 // up.
3530 optional uint32 trigger_timeout_ms = 3;
3531 }
3532 optional TriggerConfig trigger_config = 17;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003533}
3534
3535// End of protos/perfetto/config/trace_config.proto
3536
3537// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
3538
3539// Configuration for go/heapprofd.
3540message HeapprofdConfig {
3541 message ContinuousDumpConfig {
3542 // ms to wait before first dump.
3543 optional uint32 dump_phase_ms = 5;
3544 // ms to wait between following dumps.
3545 optional uint32 dump_interval_ms = 6;
3546 };
3547
3548 // Set to 1 for perfect accuracy.
3549 // Otherwise, sample every sample_interval_bytes on average.
3550 // TODO(fmayer): Add link to docs elaborating on this.
3551 optional uint64 sampling_interval_bytes = 1;
3552
3553 // E.g. surfaceflinger, com.android.phone
3554 repeated string process_cmdline = 2;
3555 // repeated string android_app = 3; // TODO(fmayer): Implement
3556 // For watermark based triggering or local debugging.
3557 repeated uint64 pid = 4;
3558 optional bool all = 5;
Florian Mayer9c6538d2019-03-07 14:32:05 +00003559 // Do not emit function names for mappings starting with this prefix.
3560 // E.g. /system to not emit symbols for any system libraries.
3561 repeated string skip_symbol_prefix = 7;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003562
3563 // Dump once at the end of the trace, emitting the heap dump at maximum
3564 // memory usage.
3565 // optional bool retain_max = 5; // TODO(fmayer): Implement
3566
3567 // Dump at a predefined interval.
3568 optional ContinuousDumpConfig continuous_dump_config = 6;
3569}
3570
3571// End of protos/perfetto/config/profiling/heapprofd_config.proto