blob: a80c9339b085566326eac53519812f52978b87d5 [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;
Primiano Tucci1eb966d2019-06-06 15:40:09 +0100179 VMSTAT_NR_ZSPAGES = 93;
180 VMSTAT_NR_ION_HEAP = 94;
181 VMSTAT_NR_GPU_HEAP = 95;
Primiano Tucci82a8bfd2018-09-19 11:33:04 +0100182}
183// End of protos/perfetto/common/sys_stats_counters.proto
184
Ryan Savitski41ce4592019-05-02 14:43:59 +0100185// Begin of protos/perfetto/common/trace_stats.proto
186
187// Statistics for the internals of the tracing service.
188//
189// Next id: 10.
190message TraceStats {
191 // From TraceBuffer::Stats.
192 //
193 // Next id: 19.
194 message BufferStats {
195 // Size of the circular buffer in bytes.
196 optional uint64 buffer_size = 12;
197
198 // Num. bytes written into the circular buffer, including chunk headers.
199 optional uint64 bytes_written = 1;
200
201 // Num. bytes overwritten before they have been read (i.e. loss of data).
202 optional uint64 bytes_overwritten = 13;
203
204 // Total size of chunks that were fully read from the circular buffer by the
205 // consumer. This may not be equal to |bytes_written| either in the middle
206 // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the
207 // size of the chunks read from the buffer, including chunk headers, which
208 // will be different from the total size of packets returned to the
209 // consumer.
210 //
211 // The current utilization of the trace buffer (mid-tracing) can be obtained
212 // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|,
213 // adding the difference of |padding_bytes_written| and
214 // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|.
215 // Note that this represents the total size of buffered data in the buffer,
216 // yet this data may be spread non-contiguously through the buffer and may
217 // be overridden before the utilization reaches 100%.
218 optional uint64 bytes_read = 14;
219
220 // Num. bytes that were allocated as padding between chunks in the circular
221 // buffer.
222 optional uint64 padding_bytes_written = 15;
223
224 // Num. of padding bytes that were removed from the circular buffer when
225 // they were overwritten.
226 //
227 // The difference between |padding_bytes_written| and
228 // |padding_bytes_cleared| denotes the total size of padding currently
229 // present in the buffer.
230 optional uint64 padding_bytes_cleared = 16;
231
232 // Num. chunks (!= packets) written into the buffer.
233 optional uint64 chunks_written = 2;
234
235 // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote
236 // the same chunk with additional packets appended to the end.
237 optional uint64 chunks_rewritten = 10;
238
239 // Num. chunks overwritten before they have been read (i.e. loss of data).
240 optional uint64 chunks_overwritten = 3;
241
242 // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer
243 // is configured with FillPolicy == DISCARD.
244 optional uint64 chunks_discarded = 18;
245
246 // Num. chunks (!= packets) that were fully read from the circular buffer by
247 // the consumer. This may not be equal to |chunks_written| either in the
248 // middle of tracing, or if |chunks_overwritten| is non-zero.
249 optional uint64 chunks_read = 17;
250
251 // Num. chunks that were committed out of order.
252 optional uint64 chunks_committed_out_of_order = 11;
253
254 // Num. times the ring buffer wrapped around.
255 optional uint64 write_wrap_count = 4;
256
257 // Num. out-of-band (OOB) patches that succeeded.
258 optional uint64 patches_succeeded = 5;
259
260 // Num. OOB patches that failed (e.g., the chunk to patch was gone).
261 optional uint64 patches_failed = 6;
262
263 // Num. readaheads (for large multi-chunk packet reads) that ended up in a
264 // successful packet read.
265 optional uint64 readaheads_succeeded = 7;
266
267 // Num. readaheads aborted because of missing chunks in the sequence stream.
268 // Note that a small number > 0 is totally expected: occasionally, when
269 // issuing a read, the very last packet in a sequence might be incomplete
270 // (because the producer is still writing it while we read). The read will
271 // stop at that point, for that sequence, increasing this counter.
272 optional uint64 readaheads_failed = 8;
273
274 // Num. of violations of the SharedMemoryABI found while writing or reading
275 // the buffer. This is an indication of either a bug in the producer(s) or
276 // malicious producer(s).
277 optional uint64 abi_violations = 9;
278 }
279
280 // Stats for the TraceBuffer(s) of the current trace session.
281 repeated BufferStats buffer_stats = 1;
282
283 // Num. producers connected (whether they are involved in the current tracing
284 // session or not).
285 optional uint32 producers_connected = 2;
286
287 // Num. producers ever seen for all trace sessions since startup (it's a good
288 // proxy for inferring num. producers crashed / killed).
289 optional uint64 producers_seen = 3;
290
291 // Num. data sources registered for all trace sessions.
292 optional uint32 data_sources_registered = 4;
293
294 // Num. data sources ever seen for all trace sessions since startup.
295 optional uint64 data_sources_seen = 5;
296
297 // Num. concurrently active tracing sessions.
298 optional uint32 tracing_sessions = 6;
299
300 // Num. buffers for all tracing session (not just the current one). This will
301 // be >= buffer_stats.size(), because the latter is only about the current
302 // session.
303 optional uint32 total_buffers = 7;
304
305 // The fields below have been introduced in Android Q.
306
307 // Num. chunks that were discarded by the service before attempting to commit
308 // them to a buffer, e.g. because the producer specified an invalid buffer ID.
309 optional uint64 chunks_discarded = 8;
310
311 // Num. patches that were discarded by the service before attempting to apply
312 // them to a buffer, e.g. because the producer specified an invalid buffer ID.
313 optional uint64 patches_discarded = 9;
314}
315
316// End of protos/perfetto/common/trace_stats.proto
317
Primiano Tucci64df2ca2019-01-03 22:26:47 +0000318// Begin of protos/perfetto/trace/android/android_log.proto
319
320message AndroidLogPacket {
321 message LogEvent {
322 // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
323 optional AndroidLogId log_id = 1;
324
325 // PID (TGID), TID and UID of the task that emitted the event.
326 optional int32 pid = 2;
327 optional int32 tid = 3;
328 optional int32 uid = 4;
329
330 // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
331 // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
332 // processor will take care of realigning clocks using the ClockSnapshot(s).
333 optional uint64 timestamp = 5;
334
335 // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
336 // the second column of /system/etc/event-log-tags. For all other events,
337 // |tag| is the app-specified argument passed to __android_log_write().
338 optional string tag = 6;
339
340 // Empty when log_id == LID_EVENTS.
341 optional AndroidLogPriority prio = 7;
342
343 // Empty when log_id == LID_EVENTS.
344 optional string message = 8;
345
346 message Arg {
347 optional string name = 1;
348 oneof value {
349 int64 int_value = 2;
350 float float_value = 3;
351 string string_value = 4;
352 }
353 }
354 // Only populated when log_id == LID_EVENTS.
355 repeated Arg args = 9;
356 }
357
358 repeated LogEvent events = 1;
359
360 // Stats are emitted only upon Flush() and are monotonic (i.e. they are
361 // absolute counters since the beginning of the lifetime of the tracing
362 // session and NOT relative to the previous Stats snapshot).
363 message Stats {
364 // Total number of log events seen, including errors and skipped entries
365 // (num of events stored in the trace = total - failed - skipped).
366 optional uint64 num_total = 1;
367
368 // Parser failures.
369 optional uint64 num_failed = 2;
370
371 // Messages skipped due to filters.
372 optional uint64 num_skipped = 3;
373 }
374 optional Stats stats = 2;
375}
376
377// End of protos/perfetto/trace/android/android_log.proto
378
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100379// Begin of protos/perfetto/trace/android/packages_list.proto
380
381message PackagesList {
Florian Mayere7647412019-04-04 11:00:51 +0100382 message PackageInfo {
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100383 optional string name = 1;
384 optional uint64 uid = 2;
385 optional bool debuggable = 3;
386 optional bool profileable_from_shell = 4;
387 optional int64 version_code = 5;
388 }
389
Florian Mayere7647412019-04-04 11:00:51 +0100390 repeated PackageInfo packages = 1;
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100391
Florian Mayer03918af2019-04-04 10:44:26 +0100392 // At least one error occurred parsing the packages.list.
Florian Mayere7647412019-04-04 11:00:51 +0100393 optional bool parse_error = 2;
394
395 // Failed to open / read packages.list.
396 optional bool read_error = 3;
Florian Mayer12f0f8e2019-04-02 12:31:13 +0100397}
398
399// End of protos/perfetto/trace/android/packages_list.proto
400
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +0100401// Begin of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
402
403// This message is not intended to be written by the chrome on the device.
404// It's emitted on the host by the telemetry benchmark infrastructure (it's a
405// part of the trace that's written by the telemetry tracing agent).
406message ChromeBenchmarkMetadata {
407 // Time when the benchmark execution started (host unixtime in microseconds).
408 optional int64 benchmark_start_time_us = 1;
409
410 // Time when this particular story was run (host unixtime in microseconds).
411 optional int64 story_run_time_us = 2;
412
413 // Name of benchmark.
414 optional string benchmark_name = 3;
415
416 // Description of benchmark.
417 optional string benchmark_description = 4;
418
419 // Optional label.
420 optional string label = 5;
421
422 // Name of story.
423 optional string story_name = 6;
424
425 // List of story tags.
426 repeated string story_tags = 7;
427
428 // Index of the story run (>0 if the same story was run several times).
429 optional int32 story_run_index = 8;
430
431 // Whether this run failed.
432 optional bool had_failures = 9;
433}
434
435// End of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
436
Siddhartha S1239fb32019-06-06 11:17:13 -0700437// Begin of protos/perfetto/trace/chrome/chrome_metadata.proto
438
439// Metadata for chrome traces.
440message ChromeMetadataPacket {
441 optional BackgroundTracingMetadata background_tracing_metadata = 1;
442}
443
444// Metadata related to background tracing scenarios, states and triggers.
445message BackgroundTracingMetadata {
446 // Information about a trigger rule defined in the experiment config.
447 message TriggerRule {
448 enum TriggerType {
449 TRIGGER_UNSPECIFIED = 0;
450
451 // Traces are triggered by specific range of values of an UMA histogram.
452 MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1;
453
454 // Traces are triggered by specific named events in chromium codebase,
455 // like "second-update-failure".
456 MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2;
457 }
458 optional TriggerType trigger_type = 1;
459
460 // Configuration of histogram trigger.
461 message HistogramRule {
462 // UMA histogram name hash, same as HistogramEventProto.name_hash.
463 optional fixed64 histogram_name_hash = 1;
464
465 // Range of values of the histogram that activates trigger.
466 optional int64 histogram_min_trigger = 2;
467 optional int64 histogram_max_trigger = 3;
468 }
469 optional HistogramRule histogram_rule = 2;
470
471 // Configuration of named trigger.
472 message NamedRule {
473 enum EventType {
474 UNSPECIFIED = 0;
475 SESSION_RESTORE = 1;
476 NAVIGATION = 2;
477 STARTUP = 3;
478
479 TEST_RULE = 1000;
480 }
481 optional EventType event_type = 1;
482 }
483 optional NamedRule named_rule = 3;
484 }
485
486 // Specifies the rule that caused the trace to be uploaded.
487 optional TriggerRule triggered_rule = 1;
488
489 // List of all active triggers in current session, when trace was triggered.
490 repeated TriggerRule active_rules = 2;
491}
492
493// End of protos/perfetto/trace/chrome/chrome_metadata.proto
494
Hector Dearmane92c6742018-11-22 21:42:39 +0000495// Begin of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100496
Hector Dearmane92c6742018-11-22 21:42:39 +0000497// A snapshot of clock readings to allow for trace alignment.
498message ClockSnapshot {
499 message Clock {
500 enum Type {
501 UNKNOWN = 0;
502 REALTIME = 1;
503 REALTIME_COARSE = 2;
504 MONOTONIC = 3;
505 MONOTONIC_COARSE = 4;
506 MONOTONIC_RAW = 5;
507 BOOTTIME = 6;
508 PROCESS_CPUTIME = 7;
509 THREAD_CPUTIME = 8;
510 }
511 optional Type type = 1;
512 optional uint64 timestamp = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100513 }
Hector Dearmane92c6742018-11-22 21:42:39 +0000514 repeated Clock clocks = 1;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100515}
516
Hector Dearmane92c6742018-11-22 21:42:39 +0000517// End of protos/perfetto/trace/clock_snapshot.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100518
Florian Mayerbeba7262018-04-17 19:05:43 +0100519// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto
520
521// Represents the mapping between inode numbers in a block device and their path
522// on the filesystem
523message InodeFileMap {
524 // Representation of Entry
525 message Entry {
526 optional uint64 inode_number = 1;
527
528 // The path to the file, e.g. "etc/file.xml"
529 // List of strings for multiple hardlinks
530 repeated string paths = 2;
531
532 // The file type
533 enum Type {
534 UNKNOWN = 0;
535 FILE = 1;
536 DIRECTORY = 2;
537 }
538 optional Type type = 3;
539 }
540
541 optional uint64 block_device_id = 1;
542
543 // The mount points of the block device, e.g. ["system"].
544 repeated string mount_points = 2;
545
546 // The list of all the entries from the block device
547 repeated Entry entries = 3;
548}
549
550// End of protos/perfetto/trace/filesystem/inode_file_map.proto
551
Hector Dearmane0e57802018-11-21 16:09:56 +0000552// Begin of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100553
554message BinderTransactionFtraceEvent {
555 optional int32 debug_id = 1;
556 optional int32 target_node = 2;
557 optional int32 to_proc = 3;
558 optional int32 to_thread = 4;
559 optional int32 reply = 5;
560 optional uint32 code = 6;
561 optional uint32 flags = 7;
562}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100563message BinderTransactionReceivedFtraceEvent {
564 optional int32 debug_id = 1;
565}
Hector Dearmane0e57802018-11-21 16:09:56 +0000566message BinderSetPriorityFtraceEvent {
567 optional int32 proc = 1;
568 optional int32 thread = 2;
569 optional uint32 old_prio = 3;
570 optional uint32 new_prio = 4;
571 optional uint32 desired_prio = 5;
572}
573message BinderLockFtraceEvent {
574 optional string tag = 1;
575}
576message BinderLockedFtraceEvent {
577 optional string tag = 1;
578}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100579message BinderUnlockFtraceEvent {
580 optional string tag = 1;
581}
Hector Dearmane0e57802018-11-21 16:09:56 +0000582message BinderTransactionAllocBufFtraceEvent {
583 optional uint64 data_size = 1;
584 optional int32 debug_id = 2;
585 optional uint64 offsets_size = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100586}
587
Hector Dearmane0e57802018-11-21 16:09:56 +0000588// End of protos/perfetto/trace/ftrace/binder.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100589
Hector Dearmane0e57802018-11-21 16:09:56 +0000590// Begin of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100591
592message BlockRqIssueFtraceEvent {
593 optional uint64 dev = 1;
594 optional uint64 sector = 2;
595 optional uint32 nr_sector = 3;
596 optional uint32 bytes = 4;
597 optional string rwbs = 5;
598 optional string comm = 6;
599 optional string cmd = 7;
600}
Hector Dearmane0e57802018-11-21 16:09:56 +0000601message BlockBioBackmergeFtraceEvent {
602 optional uint64 dev = 1;
603 optional uint64 sector = 2;
604 optional uint32 nr_sector = 3;
605 optional string rwbs = 4;
606 optional string comm = 5;
607}
608message BlockBioBounceFtraceEvent {
609 optional uint64 dev = 1;
610 optional uint64 sector = 2;
611 optional uint32 nr_sector = 3;
612 optional string rwbs = 4;
613 optional string comm = 5;
614}
615message BlockBioCompleteFtraceEvent {
616 optional uint64 dev = 1;
617 optional uint64 sector = 2;
618 optional uint32 nr_sector = 3;
619 optional int32 error = 4;
620 optional string rwbs = 5;
621}
622message BlockBioFrontmergeFtraceEvent {
623 optional uint64 dev = 1;
624 optional uint64 sector = 2;
625 optional uint32 nr_sector = 3;
626 optional string rwbs = 4;
627 optional string comm = 5;
628}
629message BlockBioQueueFtraceEvent {
630 optional uint64 dev = 1;
631 optional uint64 sector = 2;
632 optional uint32 nr_sector = 3;
633 optional string rwbs = 4;
634 optional string comm = 5;
635}
636message BlockBioRemapFtraceEvent {
637 optional uint64 dev = 1;
638 optional uint64 sector = 2;
639 optional uint32 nr_sector = 3;
640 optional uint64 old_dev = 4;
641 optional uint64 old_sector = 5;
642 optional string rwbs = 6;
643}
644message BlockDirtyBufferFtraceEvent {
645 optional uint64 dev = 1;
646 optional uint64 sector = 2;
647 optional uint64 size = 3;
648}
649message BlockGetrqFtraceEvent {
650 optional uint64 dev = 1;
651 optional uint64 sector = 2;
652 optional uint32 nr_sector = 3;
653 optional string rwbs = 4;
654 optional string comm = 5;
655}
656message BlockPlugFtraceEvent {
657 optional string comm = 1;
658}
659message BlockRqAbortFtraceEvent {
660 optional uint64 dev = 1;
661 optional uint64 sector = 2;
662 optional uint32 nr_sector = 3;
663 optional int32 errors = 4;
664 optional string rwbs = 5;
665 optional string cmd = 6;
666}
667message BlockRqCompleteFtraceEvent {
668 optional uint64 dev = 1;
669 optional uint64 sector = 2;
670 optional uint32 nr_sector = 3;
671 optional int32 errors = 4;
672 optional string rwbs = 5;
673 optional string cmd = 6;
674}
675message BlockRqInsertFtraceEvent {
676 optional uint64 dev = 1;
677 optional uint64 sector = 2;
678 optional uint32 nr_sector = 3;
679 optional uint32 bytes = 4;
680 optional string rwbs = 5;
681 optional string comm = 6;
682 optional string cmd = 7;
683}
684message BlockRqRemapFtraceEvent {
685 optional uint64 dev = 1;
686 optional uint64 sector = 2;
687 optional uint32 nr_sector = 3;
688 optional uint64 old_dev = 4;
689 optional uint64 old_sector = 5;
690 optional uint32 nr_bios = 6;
691 optional string rwbs = 7;
692}
693message BlockRqRequeueFtraceEvent {
694 optional uint64 dev = 1;
695 optional uint64 sector = 2;
696 optional uint32 nr_sector = 3;
697 optional int32 errors = 4;
698 optional string rwbs = 5;
699 optional string cmd = 6;
700}
701message BlockSleeprqFtraceEvent {
702 optional uint64 dev = 1;
703 optional uint64 sector = 2;
704 optional uint32 nr_sector = 3;
705 optional string rwbs = 4;
706 optional string comm = 5;
707}
708message BlockSplitFtraceEvent {
709 optional uint64 dev = 1;
710 optional uint64 sector = 2;
711 optional uint64 new_sector = 3;
712 optional string rwbs = 4;
713 optional string comm = 5;
714}
715message BlockTouchBufferFtraceEvent {
716 optional uint64 dev = 1;
717 optional uint64 sector = 2;
718 optional uint64 size = 3;
719}
720message BlockUnplugFtraceEvent {
721 optional int32 nr_rq = 1;
722 optional string comm = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100723}
724
Hector Dearmane0e57802018-11-21 16:09:56 +0000725// End of protos/perfetto/trace/ftrace/block.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100726
Hector Dearmane0e57802018-11-21 16:09:56 +0000727// Begin of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100728
Hector Dearmane0e57802018-11-21 16:09:56 +0000729message ClkEnableFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +0100730 optional string name = 1;
Hector Dearmane0e57802018-11-21 16:09:56 +0000731}
732message ClkDisableFtraceEvent {
733 optional string name = 1;
734}
735message ClkSetRateFtraceEvent {
736 optional string name = 1;
737 optional uint64 rate = 2;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100738}
739
Hector Dearmane0e57802018-11-21 16:09:56 +0000740// End of protos/perfetto/trace/ftrace/clk.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100741
Hector Dearmane0e57802018-11-21 16:09:56 +0000742// Begin of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +0100743
744message Ext4DaWriteBeginFtraceEvent {
745 optional uint64 dev = 1;
746 optional uint64 ino = 2;
747 optional int64 pos = 3;
748 optional uint32 len = 4;
749 optional uint32 flags = 5;
750}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100751message Ext4DaWriteEndFtraceEvent {
752 optional uint64 dev = 1;
753 optional uint64 ino = 2;
754 optional int64 pos = 3;
755 optional uint32 len = 4;
756 optional uint32 copied = 5;
757}
Hector Dearmane0e57802018-11-21 16:09:56 +0000758message Ext4SyncFileEnterFtraceEvent {
759 optional uint64 dev = 1;
760 optional uint64 ino = 2;
761 optional uint64 parent = 3;
762 optional int32 datasync = 4;
763}
764message Ext4SyncFileExitFtraceEvent {
765 optional uint64 dev = 1;
766 optional uint64 ino = 2;
767 optional int32 ret = 3;
768}
769message Ext4AllocDaBlocksFtraceEvent {
770 optional uint64 dev = 1;
771 optional uint64 ino = 2;
772 optional uint32 data_blocks = 3;
773 optional uint32 meta_blocks = 4;
774}
775message Ext4AllocateBlocksFtraceEvent {
776 optional uint64 dev = 1;
777 optional uint64 ino = 2;
778 optional uint64 block = 3;
779 optional uint32 len = 4;
780 optional uint32 logical = 5;
781 optional uint32 lleft = 6;
782 optional uint32 lright = 7;
783 optional uint64 goal = 8;
784 optional uint64 pleft = 9;
785 optional uint64 pright = 10;
786 optional uint32 flags = 11;
787}
788message Ext4AllocateInodeFtraceEvent {
789 optional uint64 dev = 1;
790 optional uint64 ino = 2;
791 optional uint64 dir = 3;
792 optional uint32 mode = 4;
793}
794message Ext4BeginOrderedTruncateFtraceEvent {
795 optional uint64 dev = 1;
796 optional uint64 ino = 2;
797 optional int64 new_size = 3;
798}
799message Ext4CollapseRangeFtraceEvent {
800 optional uint64 dev = 1;
801 optional uint64 ino = 2;
802 optional int64 offset = 3;
803 optional int64 len = 4;
804}
805message Ext4DaReleaseSpaceFtraceEvent {
806 optional uint64 dev = 1;
807 optional uint64 ino = 2;
808 optional uint64 i_blocks = 3;
809 optional int32 freed_blocks = 4;
810 optional int32 reserved_data_blocks = 5;
811 optional int32 reserved_meta_blocks = 6;
812 optional int32 allocated_meta_blocks = 7;
813 optional uint32 mode = 8;
814}
815message Ext4DaReserveSpaceFtraceEvent {
816 optional uint64 dev = 1;
817 optional uint64 ino = 2;
818 optional uint64 i_blocks = 3;
819 optional int32 reserved_data_blocks = 4;
820 optional int32 reserved_meta_blocks = 5;
821 optional uint32 mode = 6;
822 optional int32 md_needed = 7;
823}
824message Ext4DaUpdateReserveSpaceFtraceEvent {
825 optional uint64 dev = 1;
826 optional uint64 ino = 2;
827 optional uint64 i_blocks = 3;
828 optional int32 used_blocks = 4;
829 optional int32 reserved_data_blocks = 5;
830 optional int32 reserved_meta_blocks = 6;
831 optional int32 allocated_meta_blocks = 7;
832 optional int32 quota_claim = 8;
833 optional uint32 mode = 9;
834}
835message Ext4DaWritePagesFtraceEvent {
836 optional uint64 dev = 1;
837 optional uint64 ino = 2;
838 optional uint64 first_page = 3;
839 optional int64 nr_to_write = 4;
840 optional int32 sync_mode = 5;
841 optional uint64 b_blocknr = 6;
842 optional uint32 b_size = 7;
843 optional uint32 b_state = 8;
844 optional int32 io_done = 9;
845 optional int32 pages_written = 10;
846}
847message Ext4DaWritePagesExtentFtraceEvent {
848 optional uint64 dev = 1;
849 optional uint64 ino = 2;
850 optional uint64 lblk = 3;
851 optional uint32 len = 4;
852 optional uint32 flags = 5;
853}
854message Ext4DirectIOEnterFtraceEvent {
855 optional uint64 dev = 1;
856 optional uint64 ino = 2;
857 optional int64 pos = 3;
858 optional uint64 len = 4;
859 optional int32 rw = 5;
860}
861message Ext4DirectIOExitFtraceEvent {
862 optional uint64 dev = 1;
863 optional uint64 ino = 2;
864 optional int64 pos = 3;
865 optional uint64 len = 4;
866 optional int32 rw = 5;
867 optional int32 ret = 6;
868}
869message Ext4DiscardBlocksFtraceEvent {
870 optional uint64 dev = 1;
871 optional uint64 blk = 2;
872 optional uint64 count = 3;
873}
874message Ext4DiscardPreallocationsFtraceEvent {
875 optional uint64 dev = 1;
876 optional uint64 ino = 2;
877}
878message Ext4DropInodeFtraceEvent {
879 optional uint64 dev = 1;
880 optional uint64 ino = 2;
881 optional int32 drop = 3;
882}
883message Ext4EsCacheExtentFtraceEvent {
884 optional uint64 dev = 1;
885 optional uint64 ino = 2;
886 optional uint32 lblk = 3;
887 optional uint32 len = 4;
888 optional uint64 pblk = 5;
889 optional uint32 status = 6;
890}
891message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
892 optional uint64 dev = 1;
893 optional uint64 ino = 2;
894 optional uint32 lblk = 3;
895}
896message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
897 optional uint64 dev = 1;
898 optional uint64 ino = 2;
899 optional uint32 lblk = 3;
900 optional uint32 len = 4;
901 optional uint64 pblk = 5;
902 optional uint64 status = 6;
903}
904message Ext4EsInsertExtentFtraceEvent {
905 optional uint64 dev = 1;
906 optional uint64 ino = 2;
907 optional uint32 lblk = 3;
908 optional uint32 len = 4;
909 optional uint64 pblk = 5;
910 optional uint64 status = 6;
911}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100912message Ext4EsLookupExtentEnterFtraceEvent {
913 optional uint64 dev = 1;
914 optional uint64 ino = 2;
915 optional uint32 lblk = 3;
916}
Hector Dearman55ef3e02018-04-11 17:28:55 +0100917message Ext4EsLookupExtentExitFtraceEvent {
918 optional uint64 dev = 1;
919 optional uint64 ino = 2;
920 optional uint32 lblk = 3;
921 optional uint32 len = 4;
922 optional uint64 pblk = 5;
Florian Mayer7c9e3b22018-04-26 11:55:15 +0100923 optional uint64 status = 6;
Hector Dearman55ef3e02018-04-11 17:28:55 +0100924 optional int32 found = 7;
925}
Hector Dearmane0e57802018-11-21 16:09:56 +0000926message Ext4EsRemoveExtentFtraceEvent {
927 optional uint64 dev = 1;
928 optional uint64 ino = 2;
929 optional int64 lblk = 3;
930 optional int64 len = 4;
931}
932message Ext4EsShrinkFtraceEvent {
933 optional uint64 dev = 1;
934 optional int32 nr_shrunk = 2;
935 optional uint64 scan_time = 3;
936 optional int32 nr_skipped = 4;
937 optional int32 retried = 5;
938}
939message Ext4EsShrinkCountFtraceEvent {
940 optional uint64 dev = 1;
941 optional int32 nr_to_scan = 2;
942 optional int32 cache_cnt = 3;
943}
944message Ext4EsShrinkScanEnterFtraceEvent {
945 optional uint64 dev = 1;
946 optional int32 nr_to_scan = 2;
947 optional int32 cache_cnt = 3;
948}
949message Ext4EsShrinkScanExitFtraceEvent {
950 optional uint64 dev = 1;
951 optional int32 nr_shrunk = 2;
952 optional int32 cache_cnt = 3;
953}
954message Ext4EvictInodeFtraceEvent {
955 optional uint64 dev = 1;
956 optional uint64 ino = 2;
957 optional int32 nlink = 3;
958}
959message Ext4ExtConvertToInitializedEnterFtraceEvent {
960 optional uint64 dev = 1;
961 optional uint64 ino = 2;
962 optional uint32 m_lblk = 3;
963 optional uint32 m_len = 4;
964 optional uint32 u_lblk = 5;
965 optional uint32 u_len = 6;
966 optional uint64 u_pblk = 7;
967}
968message Ext4ExtConvertToInitializedFastpathFtraceEvent {
969 optional uint64 dev = 1;
970 optional uint64 ino = 2;
971 optional uint32 m_lblk = 3;
972 optional uint32 m_len = 4;
973 optional uint32 u_lblk = 5;
974 optional uint32 u_len = 6;
975 optional uint64 u_pblk = 7;
976 optional uint32 i_lblk = 8;
977 optional uint32 i_len = 9;
978 optional uint64 i_pblk = 10;
979}
980message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
981 optional uint64 dev = 1;
982 optional uint64 ino = 2;
983 optional int32 flags = 3;
984 optional uint32 lblk = 4;
985 optional uint64 pblk = 5;
986 optional uint32 len = 6;
987 optional uint32 allocated = 7;
988 optional uint64 newblk = 8;
989}
990message Ext4ExtInCacheFtraceEvent {
991 optional uint64 dev = 1;
992 optional uint64 ino = 2;
993 optional uint32 lblk = 3;
994 optional int32 ret = 4;
995}
996message Ext4ExtLoadExtentFtraceEvent {
997 optional uint64 dev = 1;
998 optional uint64 ino = 2;
999 optional uint64 pblk = 3;
1000 optional uint32 lblk = 4;
1001}
1002message Ext4ExtMapBlocksEnterFtraceEvent {
1003 optional uint64 dev = 1;
1004 optional uint64 ino = 2;
1005 optional uint32 lblk = 3;
1006 optional uint32 len = 4;
1007 optional uint32 flags = 5;
1008}
1009message Ext4ExtMapBlocksExitFtraceEvent {
1010 optional uint64 dev = 1;
1011 optional uint64 ino = 2;
1012 optional uint32 flags = 3;
1013 optional uint64 pblk = 4;
1014 optional uint32 lblk = 5;
1015 optional uint32 len = 6;
1016 optional uint32 mflags = 7;
1017 optional int32 ret = 8;
1018}
1019message Ext4ExtPutInCacheFtraceEvent {
1020 optional uint64 dev = 1;
1021 optional uint64 ino = 2;
1022 optional uint32 lblk = 3;
1023 optional uint32 len = 4;
1024 optional uint64 start = 5;
1025}
1026message Ext4ExtRemoveSpaceFtraceEvent {
1027 optional uint64 dev = 1;
1028 optional uint64 ino = 2;
1029 optional uint32 start = 3;
1030 optional uint32 end = 4;
1031 optional int32 depth = 5;
1032}
1033message Ext4ExtRemoveSpaceDoneFtraceEvent {
1034 optional uint64 dev = 1;
1035 optional uint64 ino = 2;
1036 optional uint32 start = 3;
1037 optional uint32 end = 4;
1038 optional int32 depth = 5;
1039 optional int64 partial = 6;
1040 optional uint32 eh_entries = 7;
1041}
1042message Ext4ExtRmIdxFtraceEvent {
1043 optional uint64 dev = 1;
1044 optional uint64 ino = 2;
1045 optional uint64 pblk = 3;
1046}
1047message Ext4ExtRmLeafFtraceEvent {
1048 optional uint64 dev = 1;
1049 optional uint64 ino = 2;
1050 optional int64 partial = 3;
1051 optional uint32 start = 4;
1052 optional uint32 ee_lblk = 5;
1053 optional uint64 ee_pblk = 6;
1054 optional int32 ee_len = 7;
1055}
1056message Ext4ExtShowExtentFtraceEvent {
1057 optional uint64 dev = 1;
1058 optional uint64 ino = 2;
1059 optional uint64 pblk = 3;
1060 optional uint32 lblk = 4;
1061 optional uint32 len = 5;
1062}
1063message Ext4FallocateEnterFtraceEvent {
1064 optional uint64 dev = 1;
1065 optional uint64 ino = 2;
1066 optional int64 offset = 3;
1067 optional int64 len = 4;
1068 optional int32 mode = 5;
1069 optional int64 pos = 6;
1070}
1071message Ext4FallocateExitFtraceEvent {
1072 optional uint64 dev = 1;
1073 optional uint64 ino = 2;
1074 optional int64 pos = 3;
1075 optional uint32 blocks = 4;
1076 optional int32 ret = 5;
1077}
1078message Ext4FindDelallocRangeFtraceEvent {
1079 optional uint64 dev = 1;
1080 optional uint64 ino = 2;
1081 optional uint32 from = 3;
1082 optional uint32 to = 4;
1083 optional int32 reverse = 5;
1084 optional int32 found = 6;
1085 optional uint32 found_blk = 7;
1086}
1087message Ext4ForgetFtraceEvent {
1088 optional uint64 dev = 1;
1089 optional uint64 ino = 2;
1090 optional uint64 block = 3;
1091 optional int32 is_metadata = 4;
1092 optional uint32 mode = 5;
1093}
1094message Ext4FreeBlocksFtraceEvent {
1095 optional uint64 dev = 1;
1096 optional uint64 ino = 2;
1097 optional uint64 block = 3;
1098 optional uint64 count = 4;
1099 optional int32 flags = 5;
1100 optional uint32 mode = 6;
1101}
1102message Ext4FreeInodeFtraceEvent {
1103 optional uint64 dev = 1;
1104 optional uint64 ino = 2;
1105 optional uint32 uid = 3;
1106 optional uint32 gid = 4;
1107 optional uint64 blocks = 5;
1108 optional uint32 mode = 6;
1109}
1110message Ext4GetImpliedClusterAllocExitFtraceEvent {
1111 optional uint64 dev = 1;
1112 optional uint32 flags = 2;
1113 optional uint32 lblk = 3;
1114 optional uint64 pblk = 4;
1115 optional uint32 len = 5;
1116 optional int32 ret = 6;
1117}
1118message Ext4GetReservedClusterAllocFtraceEvent {
1119 optional uint64 dev = 1;
1120 optional uint64 ino = 2;
1121 optional uint32 lblk = 3;
1122 optional uint32 len = 4;
1123}
1124message Ext4IndMapBlocksEnterFtraceEvent {
1125 optional uint64 dev = 1;
1126 optional uint64 ino = 2;
1127 optional uint32 lblk = 3;
1128 optional uint32 len = 4;
1129 optional uint32 flags = 5;
1130}
1131message Ext4IndMapBlocksExitFtraceEvent {
1132 optional uint64 dev = 1;
1133 optional uint64 ino = 2;
1134 optional uint32 flags = 3;
1135 optional uint64 pblk = 4;
1136 optional uint32 lblk = 5;
1137 optional uint32 len = 6;
1138 optional uint32 mflags = 7;
1139 optional int32 ret = 8;
1140}
1141message Ext4InsertRangeFtraceEvent {
1142 optional uint64 dev = 1;
1143 optional uint64 ino = 2;
1144 optional int64 offset = 3;
1145 optional int64 len = 4;
1146}
1147message Ext4InvalidatepageFtraceEvent {
1148 optional uint64 dev = 1;
1149 optional uint64 ino = 2;
1150 optional uint64 index = 3;
1151 optional uint64 offset = 4;
1152 optional uint32 length = 5;
1153}
1154message Ext4JournalStartFtraceEvent {
1155 optional uint64 dev = 1;
1156 optional uint64 ip = 2;
1157 optional int32 blocks = 3;
1158 optional int32 rsv_blocks = 4;
1159 optional int32 nblocks = 5;
1160}
1161message Ext4JournalStartReservedFtraceEvent {
1162 optional uint64 dev = 1;
1163 optional uint64 ip = 2;
1164 optional int32 blocks = 3;
1165}
1166message Ext4JournalledInvalidatepageFtraceEvent {
1167 optional uint64 dev = 1;
1168 optional uint64 ino = 2;
1169 optional uint64 index = 3;
1170 optional uint64 offset = 4;
1171 optional uint32 length = 5;
1172}
1173message Ext4JournalledWriteEndFtraceEvent {
1174 optional uint64 dev = 1;
1175 optional uint64 ino = 2;
1176 optional int64 pos = 3;
1177 optional uint32 len = 4;
1178 optional uint32 copied = 5;
1179}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001180message Ext4LoadInodeFtraceEvent {
1181 optional uint64 dev = 1;
1182 optional uint64 ino = 2;
1183}
Hector Dearmane0e57802018-11-21 16:09:56 +00001184message Ext4LoadInodeBitmapFtraceEvent {
1185 optional uint64 dev = 1;
1186 optional uint32 group = 2;
1187}
1188message Ext4MarkInodeDirtyFtraceEvent {
1189 optional uint64 dev = 1;
1190 optional uint64 ino = 2;
1191 optional uint64 ip = 3;
1192}
1193message Ext4MbBitmapLoadFtraceEvent {
1194 optional uint64 dev = 1;
1195 optional uint32 group = 2;
1196}
1197message Ext4MbBuddyBitmapLoadFtraceEvent {
1198 optional uint64 dev = 1;
1199 optional uint32 group = 2;
1200}
1201message Ext4MbDiscardPreallocationsFtraceEvent {
1202 optional uint64 dev = 1;
1203 optional int32 needed = 2;
1204}
1205message Ext4MbNewGroupPaFtraceEvent {
1206 optional uint64 dev = 1;
1207 optional uint64 ino = 2;
1208 optional uint64 pa_pstart = 3;
1209 optional uint64 pa_lstart = 4;
1210 optional uint32 pa_len = 5;
1211}
1212message Ext4MbNewInodePaFtraceEvent {
1213 optional uint64 dev = 1;
1214 optional uint64 ino = 2;
1215 optional uint64 pa_pstart = 3;
1216 optional uint64 pa_lstart = 4;
1217 optional uint32 pa_len = 5;
1218}
1219message Ext4MbReleaseGroupPaFtraceEvent {
1220 optional uint64 dev = 1;
1221 optional uint64 pa_pstart = 2;
1222 optional uint32 pa_len = 3;
1223}
1224message Ext4MbReleaseInodePaFtraceEvent {
1225 optional uint64 dev = 1;
1226 optional uint64 ino = 2;
1227 optional uint64 block = 3;
1228 optional uint32 count = 4;
1229}
1230message Ext4MballocAllocFtraceEvent {
1231 optional uint64 dev = 1;
1232 optional uint64 ino = 2;
1233 optional uint32 orig_logical = 3;
1234 optional int32 orig_start = 4;
1235 optional uint32 orig_group = 5;
1236 optional int32 orig_len = 6;
1237 optional uint32 goal_logical = 7;
1238 optional int32 goal_start = 8;
1239 optional uint32 goal_group = 9;
1240 optional int32 goal_len = 10;
1241 optional uint32 result_logical = 11;
1242 optional int32 result_start = 12;
1243 optional uint32 result_group = 13;
1244 optional int32 result_len = 14;
1245 optional uint32 found = 15;
1246 optional uint32 groups = 16;
1247 optional uint32 buddy = 17;
1248 optional uint32 flags = 18;
1249 optional uint32 tail = 19;
1250 optional uint32 cr = 20;
1251}
1252message Ext4MballocDiscardFtraceEvent {
1253 optional uint64 dev = 1;
1254 optional uint64 ino = 2;
1255 optional int32 result_start = 3;
1256 optional uint32 result_group = 4;
1257 optional int32 result_len = 5;
1258}
1259message Ext4MballocFreeFtraceEvent {
1260 optional uint64 dev = 1;
1261 optional uint64 ino = 2;
1262 optional int32 result_start = 3;
1263 optional uint32 result_group = 4;
1264 optional int32 result_len = 5;
1265}
1266message Ext4MballocPreallocFtraceEvent {
1267 optional uint64 dev = 1;
1268 optional uint64 ino = 2;
1269 optional uint32 orig_logical = 3;
1270 optional int32 orig_start = 4;
1271 optional uint32 orig_group = 5;
1272 optional int32 orig_len = 6;
1273 optional uint32 result_logical = 7;
1274 optional int32 result_start = 8;
1275 optional uint32 result_group = 9;
1276 optional int32 result_len = 10;
1277}
1278message Ext4OtherInodeUpdateTimeFtraceEvent {
1279 optional uint64 dev = 1;
1280 optional uint64 ino = 2;
1281 optional uint64 orig_ino = 3;
1282 optional uint32 uid = 4;
1283 optional uint32 gid = 5;
1284 optional uint32 mode = 6;
1285}
1286message Ext4PunchHoleFtraceEvent {
1287 optional uint64 dev = 1;
1288 optional uint64 ino = 2;
1289 optional int64 offset = 3;
1290 optional int64 len = 4;
1291 optional int32 mode = 5;
1292}
1293message Ext4ReadBlockBitmapLoadFtraceEvent {
1294 optional uint64 dev = 1;
1295 optional uint32 group = 2;
1296}
1297message Ext4ReadpageFtraceEvent {
1298 optional uint64 dev = 1;
1299 optional uint64 ino = 2;
1300 optional uint64 index = 3;
1301}
1302message Ext4ReleasepageFtraceEvent {
1303 optional uint64 dev = 1;
1304 optional uint64 ino = 2;
1305 optional uint64 index = 3;
1306}
1307message Ext4RemoveBlocksFtraceEvent {
1308 optional uint64 dev = 1;
1309 optional uint64 ino = 2;
1310 optional uint32 from = 3;
1311 optional uint32 to = 4;
1312 optional int64 partial = 5;
1313 optional uint64 ee_pblk = 6;
1314 optional uint32 ee_lblk = 7;
1315 optional uint32 ee_len = 8;
1316}
1317message Ext4RequestBlocksFtraceEvent {
1318 optional uint64 dev = 1;
1319 optional uint64 ino = 2;
1320 optional uint32 len = 3;
1321 optional uint32 logical = 4;
1322 optional uint32 lleft = 5;
1323 optional uint32 lright = 6;
1324 optional uint64 goal = 7;
1325 optional uint64 pleft = 8;
1326 optional uint64 pright = 9;
1327 optional uint32 flags = 10;
1328}
1329message Ext4RequestInodeFtraceEvent {
1330 optional uint64 dev = 1;
1331 optional uint64 dir = 2;
1332 optional uint32 mode = 3;
1333}
1334message Ext4SyncFsFtraceEvent {
1335 optional uint64 dev = 1;
1336 optional int32 wait = 2;
1337}
1338message Ext4TrimAllFreeFtraceEvent {
1339 optional int32 dev_major = 1;
1340 optional int32 dev_minor = 2;
1341 optional uint32 group = 3;
1342 optional int32 start = 4;
1343 optional int32 len = 5;
1344}
1345message Ext4TrimExtentFtraceEvent {
1346 optional int32 dev_major = 1;
1347 optional int32 dev_minor = 2;
1348 optional uint32 group = 3;
1349 optional int32 start = 4;
1350 optional int32 len = 5;
1351}
1352message Ext4TruncateEnterFtraceEvent {
1353 optional uint64 dev = 1;
1354 optional uint64 ino = 2;
1355 optional uint64 blocks = 3;
1356}
1357message Ext4TruncateExitFtraceEvent {
1358 optional uint64 dev = 1;
1359 optional uint64 ino = 2;
1360 optional uint64 blocks = 3;
1361}
1362message Ext4UnlinkEnterFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001363 optional uint64 dev = 1;
1364 optional uint64 ino = 2;
1365 optional uint64 parent = 3;
Hector Dearmane0e57802018-11-21 16:09:56 +00001366 optional int64 size = 4;
Hector Dearman55ef3e02018-04-11 17:28:55 +01001367}
Hector Dearmane0e57802018-11-21 16:09:56 +00001368message Ext4UnlinkExitFtraceEvent {
Hector Dearman55ef3e02018-04-11 17:28:55 +01001369 optional uint64 dev = 1;
1370 optional uint64 ino = 2;
1371 optional int32 ret = 3;
1372}
Hector Dearmane0e57802018-11-21 16:09:56 +00001373message Ext4WriteBeginFtraceEvent {
1374 optional uint64 dev = 1;
1375 optional uint64 ino = 2;
1376 optional int64 pos = 3;
1377 optional uint32 len = 4;
1378 optional uint32 flags = 5;
1379}
1380message Ext4WriteEndFtraceEvent {
1381 optional uint64 dev = 1;
1382 optional uint64 ino = 2;
1383 optional int64 pos = 3;
1384 optional uint32 len = 4;
1385 optional uint32 copied = 5;
1386}
1387message Ext4WritepageFtraceEvent {
1388 optional uint64 dev = 1;
1389 optional uint64 ino = 2;
1390 optional uint64 index = 3;
1391}
1392message Ext4WritepagesFtraceEvent {
1393 optional uint64 dev = 1;
1394 optional uint64 ino = 2;
1395 optional int64 nr_to_write = 3;
1396 optional int64 pages_skipped = 4;
1397 optional int64 range_start = 5;
1398 optional int64 range_end = 6;
1399 optional uint64 writeback_index = 7;
1400 optional int32 sync_mode = 8;
1401 optional uint32 for_kupdate = 9;
1402 optional uint32 range_cyclic = 10;
1403}
1404message Ext4WritepagesResultFtraceEvent {
1405 optional uint64 dev = 1;
1406 optional uint64 ino = 2;
1407 optional int32 ret = 3;
1408 optional int32 pages_written = 4;
1409 optional int64 pages_skipped = 5;
1410 optional uint64 writeback_index = 6;
1411 optional int32 sync_mode = 7;
1412}
1413message Ext4ZeroRangeFtraceEvent {
1414 optional uint64 dev = 1;
1415 optional uint64 ino = 2;
1416 optional int64 offset = 3;
1417 optional int64 len = 4;
1418 optional int32 mode = 5;
1419}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001420
Hector Dearmane0e57802018-11-21 16:09:56 +00001421// End of protos/perfetto/trace/ftrace/ext4.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001422
Hector Dearmane0e57802018-11-21 16:09:56 +00001423// Begin of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001424
Hector Dearmane0e57802018-11-21 16:09:56 +00001425message F2fsDoSubmitBioFtraceEvent {
1426 optional uint64 dev = 1;
1427 optional int32 btype = 2;
1428 optional uint32 sync = 3;
1429 optional uint64 sector = 4;
1430 optional uint32 size = 5;
1431}
1432message F2fsEvictInodeFtraceEvent {
1433 optional uint64 dev = 1;
1434 optional uint64 ino = 2;
1435 optional uint64 pino = 3;
1436 optional uint32 mode = 4;
1437 optional int64 size = 5;
1438 optional uint32 nlink = 6;
1439 optional uint64 blocks = 7;
1440 optional uint32 advise = 8;
1441}
1442message F2fsFallocateFtraceEvent {
1443 optional uint64 dev = 1;
1444 optional uint64 ino = 2;
1445 optional int32 mode = 3;
1446 optional int64 offset = 4;
1447 optional int64 len = 5;
1448 optional int64 size = 6;
1449 optional uint64 blocks = 7;
1450 optional int32 ret = 8;
1451}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001452message F2fsGetDataBlockFtraceEvent {
1453 optional uint64 dev = 1;
1454 optional uint64 ino = 2;
1455 optional uint64 iblock = 3;
1456 optional uint64 bh_start = 4;
1457 optional uint64 bh_size = 5;
1458 optional int32 ret = 6;
1459}
Hector Dearmane0e57802018-11-21 16:09:56 +00001460message F2fsGetVictimFtraceEvent {
1461 optional uint64 dev = 1;
1462 optional int32 type = 2;
1463 optional int32 gc_type = 3;
1464 optional int32 alloc_mode = 4;
1465 optional int32 gc_mode = 5;
1466 optional uint32 victim = 6;
1467 optional uint32 ofs_unit = 7;
1468 optional uint32 pre_victim = 8;
1469 optional uint32 prefree = 9;
1470 optional uint32 free = 10;
1471}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001472message F2fsIgetFtraceEvent {
1473 optional uint64 dev = 1;
1474 optional uint64 ino = 2;
1475 optional uint64 pino = 3;
1476 optional uint32 mode = 4;
1477 optional int64 size = 5;
1478 optional uint32 nlink = 6;
1479 optional uint64 blocks = 7;
1480 optional uint32 advise = 8;
1481}
Hector Dearmane0e57802018-11-21 16:09:56 +00001482message F2fsIgetExitFtraceEvent {
1483 optional uint64 dev = 1;
1484 optional uint64 ino = 2;
1485 optional int32 ret = 3;
1486}
1487message F2fsNewInodeFtraceEvent {
1488 optional uint64 dev = 1;
1489 optional uint64 ino = 2;
1490 optional int32 ret = 3;
1491}
1492message F2fsReadpageFtraceEvent {
1493 optional uint64 dev = 1;
1494 optional uint64 ino = 2;
1495 optional uint64 index = 3;
1496 optional uint64 blkaddr = 4;
1497 optional int32 type = 5;
1498}
1499message F2fsReserveNewBlockFtraceEvent {
1500 optional uint64 dev = 1;
1501 optional uint32 nid = 2;
1502 optional uint32 ofs_in_node = 3;
1503}
1504message F2fsSetPageDirtyFtraceEvent {
1505 optional uint64 dev = 1;
1506 optional uint64 ino = 2;
1507 optional int32 type = 3;
1508 optional int32 dir = 4;
1509 optional uint64 index = 5;
1510 optional int32 dirty = 6;
1511}
1512message F2fsSubmitWritePageFtraceEvent {
1513 optional uint64 dev = 1;
1514 optional uint64 ino = 2;
1515 optional int32 type = 3;
1516 optional uint64 index = 4;
1517 optional uint32 block = 5;
1518}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001519message F2fsSyncFileEnterFtraceEvent {
1520 optional uint64 dev = 1;
1521 optional uint64 ino = 2;
1522 optional uint64 pino = 3;
1523 optional uint32 mode = 4;
1524 optional int64 size = 5;
1525 optional uint32 nlink = 6;
1526 optional uint64 blocks = 7;
1527 optional uint32 advise = 8;
1528}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001529message F2fsSyncFileExitFtraceEvent {
1530 optional uint64 dev = 1;
1531 optional uint64 ino = 2;
1532 optional uint32 need_cp = 3;
1533 optional int32 datasync = 4;
1534 optional int32 ret = 5;
1535}
Hector Dearmane0e57802018-11-21 16:09:56 +00001536message F2fsSyncFsFtraceEvent {
1537 optional uint64 dev = 1;
1538 optional int32 dirty = 2;
1539 optional int32 wait = 3;
1540}
1541message F2fsTruncateFtraceEvent {
1542 optional uint64 dev = 1;
1543 optional uint64 ino = 2;
1544 optional uint64 pino = 3;
1545 optional uint32 mode = 4;
1546 optional int64 size = 5;
1547 optional uint32 nlink = 6;
1548 optional uint64 blocks = 7;
1549 optional uint32 advise = 8;
1550}
1551message F2fsTruncateBlocksEnterFtraceEvent {
1552 optional uint64 dev = 1;
1553 optional uint64 ino = 2;
1554 optional int64 size = 3;
1555 optional uint64 blocks = 4;
1556 optional uint64 from = 5;
1557}
1558message F2fsTruncateBlocksExitFtraceEvent {
1559 optional uint64 dev = 1;
1560 optional uint64 ino = 2;
1561 optional int32 ret = 3;
1562}
1563message F2fsTruncateDataBlocksRangeFtraceEvent {
1564 optional uint64 dev = 1;
1565 optional uint64 ino = 2;
1566 optional uint32 nid = 3;
1567 optional uint32 ofs = 4;
1568 optional int32 free = 5;
1569}
1570message F2fsTruncateInodeBlocksEnterFtraceEvent {
1571 optional uint64 dev = 1;
1572 optional uint64 ino = 2;
1573 optional int64 size = 3;
1574 optional uint64 blocks = 4;
1575 optional uint64 from = 5;
1576}
1577message F2fsTruncateInodeBlocksExitFtraceEvent {
1578 optional uint64 dev = 1;
1579 optional uint64 ino = 2;
1580 optional int32 ret = 3;
1581}
1582message F2fsTruncateNodeFtraceEvent {
1583 optional uint64 dev = 1;
1584 optional uint64 ino = 2;
1585 optional uint32 nid = 3;
1586 optional uint32 blk_addr = 4;
1587}
1588message F2fsTruncateNodesEnterFtraceEvent {
1589 optional uint64 dev = 1;
1590 optional uint64 ino = 2;
1591 optional uint32 nid = 3;
1592 optional uint32 blk_addr = 4;
1593}
1594message F2fsTruncateNodesExitFtraceEvent {
1595 optional uint64 dev = 1;
1596 optional uint64 ino = 2;
1597 optional int32 ret = 3;
1598}
1599message F2fsTruncatePartialNodesFtraceEvent {
1600 optional uint64 dev = 1;
1601 optional uint64 ino = 2;
1602 optional uint32 nid = 3;
1603 optional int32 depth = 4;
1604 optional int32 err = 5;
1605}
1606message F2fsUnlinkEnterFtraceEvent {
1607 optional uint64 dev = 1;
1608 optional uint64 ino = 2;
1609 optional int64 size = 3;
1610 optional uint64 blocks = 4;
1611 optional string name = 5;
1612}
1613message F2fsUnlinkExitFtraceEvent {
1614 optional uint64 dev = 1;
1615 optional uint64 ino = 2;
1616 optional int32 ret = 3;
1617}
1618message F2fsVmPageMkwriteFtraceEvent {
1619 optional uint64 dev = 1;
1620 optional uint64 ino = 2;
1621 optional int32 type = 3;
1622 optional int32 dir = 4;
1623 optional uint64 index = 5;
1624 optional int32 dirty = 6;
1625}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001626message F2fsWriteBeginFtraceEvent {
1627 optional uint64 dev = 1;
1628 optional uint64 ino = 2;
1629 optional int64 pos = 3;
1630 optional uint32 len = 4;
1631 optional uint32 flags = 5;
1632}
Hector Dearmane0e57802018-11-21 16:09:56 +00001633message F2fsWriteCheckpointFtraceEvent {
1634 optional uint64 dev = 1;
1635 optional uint32 is_umount = 2;
1636 optional string msg = 3;
1637}
Hector Dearman55ef3e02018-04-11 17:28:55 +01001638message F2fsWriteEndFtraceEvent {
1639 optional uint64 dev = 1;
1640 optional uint64 ino = 2;
1641 optional int64 pos = 3;
1642 optional uint32 len = 4;
1643 optional uint32 copied = 5;
1644}
1645
Hector Dearmane0e57802018-11-21 16:09:56 +00001646// End of protos/perfetto/trace/ftrace/f2fs.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01001647
Hector Dearmane0e57802018-11-21 16:09:56 +00001648// Begin of protos/perfetto/trace/ftrace/filemap.proto
1649
1650message MmFilemapAddToPageCacheFtraceEvent {
1651 optional uint64 pfn = 1;
1652 optional uint64 i_ino = 2;
1653 optional uint64 index = 3;
1654 optional uint64 s_dev = 4;
1655 optional uint64 page = 5;
1656}
1657message MmFilemapDeleteFromPageCacheFtraceEvent {
1658 optional uint64 pfn = 1;
1659 optional uint64 i_ino = 2;
1660 optional uint64 index = 3;
1661 optional uint64 s_dev = 4;
1662 optional uint64 page = 5;
1663}
1664
1665// End of protos/perfetto/trace/ftrace/filemap.proto
1666
1667// Begin of protos/perfetto/trace/ftrace/ftrace.proto
1668
1669message PrintFtraceEvent {
1670 optional uint64 ip = 1;
1671 optional string buf = 2;
1672}
1673
1674// End of protos/perfetto/trace/ftrace/ftrace.proto
1675
1676// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto
1677
1678message FtraceEvent {
1679 // Nanoseconds since an epoch.
1680 // Epoch is configurable by writing into trace_clock.
1681 // By default this timestamp is CPU local.
1682 // TODO: Figure out a story for reconciling the various clocks.
1683 optional uint64 timestamp = 1;
1684
1685 // Kernel pid (do not confuse with userspace pid aka tgid)
1686 optional uint32 pid = 2;
1687
1688 oneof event {
1689 PrintFtraceEvent print = 3;
1690 SchedSwitchFtraceEvent sched_switch = 4;
1691 // removed field with id 5;
1692 // removed field with id 6;
1693 // removed field with id 7;
1694 // removed field with id 8;
1695 // removed field with id 9;
1696 // removed field with id 10;
1697 CpuFrequencyFtraceEvent cpu_frequency = 11;
1698 CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
1699 CpuIdleFtraceEvent cpu_idle = 13;
1700 ClockEnableFtraceEvent clock_enable = 14;
1701 ClockDisableFtraceEvent clock_disable = 15;
1702 ClockSetRateFtraceEvent clock_set_rate = 16;
1703 SchedWakeupFtraceEvent sched_wakeup = 17;
1704 SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
1705 SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
1706 SchedWakingFtraceEvent sched_waking = 20;
1707 // removed field with id 21
1708 // removed field with id 22
1709 // removed field with id 23
1710 // removed field with id 24
1711 // removed field with id 25
1712 // removed field with id 26
1713 // removed field with id 27
1714 // removed field with id 28
1715 // removed field with id 29
1716 // removed field with id 30
1717 // removed field with id 31
1718 // removed field with id 32
1719 // removed field with id 33
1720 // removed field with id 34
1721 LowmemoryKillFtraceEvent lowmemory_kill = 35;
1722 // removed field with id 36
1723 // removed field with id 37
1724 // removed field with id 38
1725 // removed field with id 39
1726 // removed field with id 40
1727 Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
1728 Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
1729 Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
1730 Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
1731 BlockRqIssueFtraceEvent block_rq_issue = 45;
1732 MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
1733 MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
1734 MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
1735 MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
1736 BinderTransactionFtraceEvent binder_transaction = 50;
1737 BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
1738 BinderSetPriorityFtraceEvent binder_set_priority = 52;
1739 BinderLockFtraceEvent binder_lock = 53;
1740 BinderLockedFtraceEvent binder_locked = 54;
1741 BinderUnlockFtraceEvent binder_unlock = 55;
1742 // removed field with id 56
1743 // removed field with id 57
1744 // removed field with id 58
1745 // removed field with id 59
1746 // removed field with id 60
1747 // removed field with id 61
1748 // removed field with id 62
1749 // removed field with id 63
1750 // removed field with id 64
1751 // removed field with id 65
1752 // removed field with id 66
1753 // removed field with id 67
1754 // removed field with id 68
1755 // removed field with id 69
1756 // removed field with id 70
1757 // removed field with id 71
1758 // removed field with id 72
1759 // removed field with id 73
1760 // removed field with id 74
1761 // removed field with id 75
1762 // removed field with id 76
1763 // removed field with id 77
1764 // removed field with id 78
1765 // removed field with id 79
1766 // removed field with id 80
1767 // removed field with id 81
1768 // removed field with id 82
1769 // removed field with id 83
1770 // removed field with id 84
1771 // removed field with id 85
1772 // removed field with id 86
1773 // removed field with id 87
1774 // removed field with id 88
1775 // removed field with id 89
1776 // removed field with id 90
1777 // removed field with id 91
1778 // removed field with id 92
1779 // removed field with id 93
1780 // removed field with id 94
1781 // removed field with id 95
1782 // removed field with id 96
1783 MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
1784 MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
1785 98;
1786 // removed field with id 99
1787 // removed field with id 100
1788 // removed field with id 101
1789 // removed field with id 102
1790 // removed field with id 103
1791 // removed field with id 104
1792 // removed field with id 105
1793 // removed field with id 106
1794 // removed field with id 107
1795 // removed field with id 108
1796 // removed field with id 109
1797 // removed field with id 110
1798 // removed field with id 111
1799 // removed field with id 112
1800 SuspendResumeFtraceEvent suspend_resume = 113;
1801 SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
1802 BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
1803 BlockBioBounceFtraceEvent block_bio_bounce = 116;
1804 BlockBioCompleteFtraceEvent block_bio_complete = 117;
1805 BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
1806 BlockBioQueueFtraceEvent block_bio_queue = 119;
1807 BlockBioRemapFtraceEvent block_bio_remap = 120;
1808 BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
1809 BlockGetrqFtraceEvent block_getrq = 122;
1810 BlockPlugFtraceEvent block_plug = 123;
1811 BlockRqAbortFtraceEvent block_rq_abort = 124;
1812 BlockRqCompleteFtraceEvent block_rq_complete = 125;
1813 BlockRqInsertFtraceEvent block_rq_insert = 126;
1814 // removed field with id 127;
1815 BlockRqRemapFtraceEvent block_rq_remap = 128;
1816 BlockRqRequeueFtraceEvent block_rq_requeue = 129;
1817 BlockSleeprqFtraceEvent block_sleeprq = 130;
1818 BlockSplitFtraceEvent block_split = 131;
1819 BlockTouchBufferFtraceEvent block_touch_buffer = 132;
1820 BlockUnplugFtraceEvent block_unplug = 133;
1821 Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
1822 Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
1823 Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
1824 Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
1825 Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
1826 Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
1827 Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
1828 Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
1829 Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
1830 Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
1831 Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
1832 Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
1833 Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
1834 Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
1835 Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
1836 Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
1837 Ext4EsFindDelayedExtentRangeEnterFtraceEvent
1838 ext4_es_find_delayed_extent_range_enter = 150;
1839 Ext4EsFindDelayedExtentRangeExitFtraceEvent
1840 ext4_es_find_delayed_extent_range_exit = 151;
1841 Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
1842 Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
1843 Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
1844 Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
1845 Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
1846 Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
1847 Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
1848 Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
1849 Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
1850 Ext4ExtConvertToInitializedEnterFtraceEvent
1851 ext4_ext_convert_to_initialized_enter = 161;
1852 Ext4ExtConvertToInitializedFastpathFtraceEvent
1853 ext4_ext_convert_to_initialized_fastpath = 162;
1854 Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
1855 163;
1856 Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
1857 Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
1858 Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
1859 Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
1860 Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
1861 Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
1862 Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
1863 Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
1864 Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
1865 Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
1866 Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
1867 Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
1868 Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
1869 Ext4ForgetFtraceEvent ext4_forget = 177;
1870 Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
1871 Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
1872 Ext4GetImpliedClusterAllocExitFtraceEvent
1873 ext4_get_implied_cluster_alloc_exit = 180;
1874 Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
1875 181;
1876 Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
1877 Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
1878 Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
1879 Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
1880 Ext4JournalStartFtraceEvent ext4_journal_start = 186;
1881 Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
1882 Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
1883 188;
1884 Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
1885 Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
1886 Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
1887 Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
1888 Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
1889 Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
1890 Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
1891 Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
1892 Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
1893 Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
1894 Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
1895 Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
1896 Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
1897 Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
1898 Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
1899 Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
1900 Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
1901 Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
1902 Ext4ReadpageFtraceEvent ext4_readpage = 207;
1903 Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
1904 Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
1905 Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
1906 Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
1907 Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
1908 Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
1909 Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
1910 Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
1911 Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
1912 Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
1913 Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
1914 Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
1915 // removed field with id 220;
1916 // removed field with id 221;
1917 // removed field with id 222;
1918 // removed field with id 223;
1919 // removed field with id 224;
1920 // removed field with id 225;
1921 // removed field with id 226;
1922 // removed field with id 227;
1923 // removed field with id 228;
1924 // removed field with id 229;
1925 Ext4WriteEndFtraceEvent ext4_write_end = 230;
1926 Ext4WritepageFtraceEvent ext4_writepage = 231;
1927 Ext4WritepagesFtraceEvent ext4_writepages = 232;
1928 Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
1929 Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
1930 TaskNewtaskFtraceEvent task_newtask = 235;
1931 TaskRenameFtraceEvent task_rename = 236;
1932 SchedProcessExecFtraceEvent sched_process_exec = 237;
1933 SchedProcessExitFtraceEvent sched_process_exit = 238;
1934 SchedProcessForkFtraceEvent sched_process_fork = 239;
1935 SchedProcessFreeFtraceEvent sched_process_free = 240;
1936 SchedProcessHangFtraceEvent sched_process_hang = 241;
1937 SchedProcessWaitFtraceEvent sched_process_wait = 242;
1938 F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
1939 F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
1940 F2fsFallocateFtraceEvent f2fs_fallocate = 245;
1941 F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
1942 F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
1943 F2fsIgetFtraceEvent f2fs_iget = 248;
1944 F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
1945 F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
1946 F2fsReadpageFtraceEvent f2fs_readpage = 251;
1947 F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
1948 F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
1949 F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
1950 F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
1951 F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
1952 F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
1953 F2fsTruncateFtraceEvent f2fs_truncate = 258;
1954 F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
1955 F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
1956 F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
1957 261;
1958 F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
1959 262;
1960 F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
1961 263;
1962 F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
1963 F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
1964 F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
1965 F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
1966 F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
1967 F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
1968 F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
1969 F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
1970 F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
1971 F2fsWriteEndFtraceEvent f2fs_write_end = 273;
1972 AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
1973 AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
1974 AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
1975 AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
1976 AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
1977 AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
1978 DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
1979 IommuMapRangeFtraceEvent iommu_map_range = 281;
1980 IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
1981 IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
1982 IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
1983 IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
1984 IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
1985 IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
1986 IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
1987 IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
1988 IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
1989 IonPrefetchingFtraceEvent ion_prefetching = 291;
1990 IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
1991 IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
1992 293;
1993 IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
1994 IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
1995 IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
1996 IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
1997 297;
1998 KfreeFtraceEvent kfree = 298;
1999 KmallocFtraceEvent kmalloc = 299;
2000 KmallocNodeFtraceEvent kmalloc_node = 300;
2001 KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
2002 KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
2003 KmemCacheFreeFtraceEvent kmem_cache_free = 303;
2004 MigratePagesEndFtraceEvent migrate_pages_end = 304;
2005 MigratePagesStartFtraceEvent migrate_pages_start = 305;
2006 MigrateRetryFtraceEvent migrate_retry = 306;
2007 MmPageAllocFtraceEvent mm_page_alloc = 307;
2008 MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
2009 MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
2010 MmPageFreeFtraceEvent mm_page_free = 310;
2011 MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
2012 MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
2013 RssStatFtraceEvent rss_stat = 313;
2014 IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
2015 IonHeapGrowFtraceEvent ion_heap_grow = 315;
2016 // removed field with id 316
2017 // removed field with id 317
2018 // removed field with id 318
2019 // removed field with id 319
2020 ClkEnableFtraceEvent clk_enable = 320;
2021 ClkDisableFtraceEvent clk_disable = 321;
2022 ClkSetRateFtraceEvent clk_set_rate = 322;
2023 BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
2024 SignalDeliverFtraceEvent signal_deliver = 324;
2025 SignalGenerateFtraceEvent signal_generate = 325;
2026 // removed field with id 326
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002027 GenericFtraceEvent generic = 327;
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00002028 MmEventRecordFtraceEvent mm_event_record = 328;
Lalit Magantia73a7252019-01-25 10:32:40 +00002029 SysEnterFtraceEvent sys_enter = 329;
2030 SysExitFtraceEvent sys_exit = 330;
Hector Dearmanbfc24112019-06-04 19:35:51 +01002031 ZeroFtraceEvent zero = 331;
Sidath Senanayake1f5f93a2019-06-06 22:24:15 +01002032 GpuFrequencyFtraceEvent gpu_frequency = 332;
Hector Dearmane0e57802018-11-21 16:09:56 +00002033 }
2034}
2035
2036// End of protos/perfetto/trace/ftrace/ftrace_event.proto
2037
2038// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
2039
2040message FtraceEventBundle {
2041 optional uint32 cpu = 1;
2042 repeated FtraceEvent event = 2;
2043 // Total of all overwrite fields from the headers of all kernel
2044 // ftrace pages we parsed into this FtraceEventBundle. Zero if
2045 // no overwriting occurred, a number larger than zero if some overwriting
2046 // occurred.
2047 optional uint32 overwrite_count = 3;
2048}
2049
2050// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
2051
2052// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto
2053
2054// Per-CPU stats for the ftrace data source gathered from the kernel from
2055// /sys/kernel/debug/tracing/per_cpu/cpuX/stats.
2056message FtraceCpuStats {
2057 // CPU index.
2058 optional uint64 cpu = 1;
2059
2060 // Number of entries still in the kernel buffer. Ideally this should be close
2061 // to zero, as events are consumed regularly and moved into the userspace
2062 // buffers (or file).
2063 optional uint64 entries = 2;
2064
2065 // Number of events lost in kernel buffers due to overwriting of old events
2066 // before userspace had a chance to drain them.
2067 optional uint64 overrun = 3;
2068
2069 // This should always be zero. If not the buffer size is way too small or
2070 // something went wrong with the tracer.
2071 optional uint64 commit_overrun = 4;
2072
2073 // Bytes actually read (not overwritten).
2074 optional uint64 bytes_read = 5;
2075
2076 // The timestamp for the oldest event still in the ring buffer.
2077 optional double oldest_event_ts = 6;
2078
2079 // The current timestamp.
2080 optional double now_ts = 7;
2081
2082 // If the kernel buffer has overwrite mode disabled, this will show the number
2083 // of new events that were lost because the buffer was full. This is similar
2084 // to |overrun| but only for the overwrite=false case.
2085 optional uint64 dropped_events = 8;
2086
2087 // The number of events read.
2088 optional uint64 read_events = 9;
2089}
2090
2091// Ftrace stats for all CPUs.
2092message FtraceStats {
2093 enum Phase {
2094 UNSPECIFIED = 0;
2095 START_OF_TRACE = 1;
2096 END_OF_TRACE = 2;
2097 }
2098
2099 // Tells when stats were sampled. There should be one sample at the beginning
2100 // of the trace and one sample at the end.
2101 optional Phase phase = 1;
2102
2103 // Per-CPU stats (one entry for each CPU).
2104 repeated FtraceCpuStats cpu_stats = 2;
2105}
2106
2107// End of protos/perfetto/trace/ftrace/ftrace_stats.proto
2108
Hector Dearmane92c6742018-11-22 21:42:39 +00002109// Begin of protos/perfetto/trace/ftrace/generic.proto
2110
2111// This generic proto is used to output events in the trace
2112// when a specific proto for that event does not exist.
2113message GenericFtraceEvent {
2114 message Field {
2115 optional string name = 1;
2116 oneof value {
2117 string str_value = 3;
2118 int64 int_value = 4;
2119 uint64 uint_value = 5;
2120 }
2121 }
2122
2123 optional string event_name = 1;
2124 repeated Field field = 2;
2125}
2126
2127// End of protos/perfetto/trace/ftrace/generic.proto
2128
Hector Dearmane0e57802018-11-21 16:09:56 +00002129// Begin of protos/perfetto/trace/ftrace/kmem.proto
2130
2131message AllocPagesIommuEndFtraceEvent {
2132 optional uint32 gfp_flags = 1;
2133 optional uint32 order = 2;
2134}
2135message AllocPagesIommuFailFtraceEvent {
2136 optional uint32 gfp_flags = 1;
2137 optional uint32 order = 2;
2138}
2139message AllocPagesIommuStartFtraceEvent {
2140 optional uint32 gfp_flags = 1;
2141 optional uint32 order = 2;
2142}
2143message AllocPagesSysEndFtraceEvent {
2144 optional uint32 gfp_flags = 1;
2145 optional uint32 order = 2;
2146}
2147message AllocPagesSysFailFtraceEvent {
2148 optional uint32 gfp_flags = 1;
2149 optional uint32 order = 2;
2150}
2151message AllocPagesSysStartFtraceEvent {
2152 optional uint32 gfp_flags = 1;
2153 optional uint32 order = 2;
2154}
2155message DmaAllocContiguousRetryFtraceEvent {
2156 optional int32 tries = 1;
2157}
2158message IommuMapRangeFtraceEvent {
2159 optional uint64 chunk_size = 1;
2160 optional uint64 len = 2;
2161 optional uint64 pa = 3;
2162 optional uint64 va = 4;
2163}
2164message IommuSecPtblMapRangeEndFtraceEvent {
2165 optional uint64 len = 1;
2166 optional int32 num = 2;
2167 optional uint32 pa = 3;
2168 optional int32 sec_id = 4;
2169 optional uint64 va = 5;
2170}
2171message IommuSecPtblMapRangeStartFtraceEvent {
2172 optional uint64 len = 1;
2173 optional int32 num = 2;
2174 optional uint32 pa = 3;
2175 optional int32 sec_id = 4;
2176 optional uint64 va = 5;
2177}
2178message IonAllocBufferEndFtraceEvent {
2179 optional string client_name = 1;
2180 optional uint32 flags = 2;
2181 optional string heap_name = 3;
2182 optional uint64 len = 4;
2183 optional uint32 mask = 5;
2184}
2185message IonAllocBufferFailFtraceEvent {
2186 optional string client_name = 1;
2187 optional int64 error = 2;
2188 optional uint32 flags = 3;
2189 optional string heap_name = 4;
2190 optional uint64 len = 5;
2191 optional uint32 mask = 6;
2192}
2193message IonAllocBufferFallbackFtraceEvent {
2194 optional string client_name = 1;
2195 optional int64 error = 2;
2196 optional uint32 flags = 3;
2197 optional string heap_name = 4;
2198 optional uint64 len = 5;
2199 optional uint32 mask = 6;
2200}
2201message IonAllocBufferStartFtraceEvent {
2202 optional string client_name = 1;
2203 optional uint32 flags = 2;
2204 optional string heap_name = 3;
2205 optional uint64 len = 4;
2206 optional uint32 mask = 5;
2207}
2208message IonCpAllocRetryFtraceEvent {
2209 optional int32 tries = 1;
2210}
2211message IonCpSecureBufferEndFtraceEvent {
2212 optional uint64 align = 1;
2213 optional uint64 flags = 2;
2214 optional string heap_name = 3;
2215 optional uint64 len = 4;
2216}
2217message IonCpSecureBufferStartFtraceEvent {
2218 optional uint64 align = 1;
2219 optional uint64 flags = 2;
2220 optional string heap_name = 3;
2221 optional uint64 len = 4;
2222}
2223message IonPrefetchingFtraceEvent {
2224 optional uint64 len = 1;
2225}
2226message IonSecureCmaAddToPoolEndFtraceEvent {
2227 optional uint32 is_prefetch = 1;
2228 optional uint64 len = 2;
2229 optional int32 pool_total = 3;
2230}
2231message IonSecureCmaAddToPoolStartFtraceEvent {
2232 optional uint32 is_prefetch = 1;
2233 optional uint64 len = 2;
2234 optional int32 pool_total = 3;
2235}
2236message IonSecureCmaAllocateEndFtraceEvent {
2237 optional uint64 align = 1;
2238 optional uint64 flags = 2;
2239 optional string heap_name = 3;
2240 optional uint64 len = 4;
2241}
2242message IonSecureCmaAllocateStartFtraceEvent {
2243 optional uint64 align = 1;
2244 optional uint64 flags = 2;
2245 optional string heap_name = 3;
2246 optional uint64 len = 4;
2247}
2248message IonSecureCmaShrinkPoolEndFtraceEvent {
2249 optional uint64 drained_size = 1;
2250 optional uint64 skipped_size = 2;
2251}
2252message IonSecureCmaShrinkPoolStartFtraceEvent {
2253 optional uint64 drained_size = 1;
2254 optional uint64 skipped_size = 2;
2255}
2256message KfreeFtraceEvent {
2257 optional uint64 call_site = 1;
2258 optional uint64 ptr = 2;
2259}
2260message KmallocFtraceEvent {
2261 optional uint64 bytes_alloc = 1;
2262 optional uint64 bytes_req = 2;
2263 optional uint64 call_site = 3;
2264 optional uint32 gfp_flags = 4;
2265 optional uint64 ptr = 5;
2266}
2267message KmallocNodeFtraceEvent {
2268 optional uint64 bytes_alloc = 1;
2269 optional uint64 bytes_req = 2;
2270 optional uint64 call_site = 3;
2271 optional uint32 gfp_flags = 4;
2272 optional int32 node = 5;
2273 optional uint64 ptr = 6;
2274}
2275message KmemCacheAllocFtraceEvent {
2276 optional uint64 bytes_alloc = 1;
2277 optional uint64 bytes_req = 2;
2278 optional uint64 call_site = 3;
2279 optional uint32 gfp_flags = 4;
2280 optional uint64 ptr = 5;
2281}
2282message KmemCacheAllocNodeFtraceEvent {
2283 optional uint64 bytes_alloc = 1;
2284 optional uint64 bytes_req = 2;
2285 optional uint64 call_site = 3;
2286 optional uint32 gfp_flags = 4;
2287 optional int32 node = 5;
2288 optional uint64 ptr = 6;
2289}
2290message KmemCacheFreeFtraceEvent {
2291 optional uint64 call_site = 1;
2292 optional uint64 ptr = 2;
2293}
2294message MigratePagesEndFtraceEvent {
2295 optional int32 mode = 1;
2296}
2297message MigratePagesStartFtraceEvent {
2298 optional int32 mode = 1;
2299}
2300message MigrateRetryFtraceEvent {
2301 optional int32 tries = 1;
2302}
2303message MmPageAllocFtraceEvent {
2304 optional uint32 gfp_flags = 1;
2305 optional int32 migratetype = 2;
2306 optional uint32 order = 3;
2307 optional uint64 page = 4;
2308 optional uint64 pfn = 5;
2309}
2310message MmPageAllocExtfragFtraceEvent {
2311 optional int32 alloc_migratetype = 1;
2312 optional int32 alloc_order = 2;
2313 optional int32 fallback_migratetype = 3;
2314 optional int32 fallback_order = 4;
2315 optional uint64 page = 5;
2316 optional int32 change_ownership = 6;
2317 optional uint64 pfn = 7;
2318}
2319message MmPageAllocZoneLockedFtraceEvent {
2320 optional int32 migratetype = 1;
2321 optional uint32 order = 2;
2322 optional uint64 page = 3;
2323 optional uint64 pfn = 4;
2324}
2325message MmPageFreeFtraceEvent {
2326 optional uint32 order = 1;
2327 optional uint64 page = 2;
2328 optional uint64 pfn = 3;
2329}
2330message MmPageFreeBatchedFtraceEvent {
2331 optional int32 cold = 1;
2332 optional uint64 page = 2;
2333 optional uint64 pfn = 3;
2334}
2335message MmPagePcpuDrainFtraceEvent {
2336 optional int32 migratetype = 1;
2337 optional uint32 order = 2;
2338 optional uint64 page = 3;
2339 optional uint64 pfn = 4;
2340}
2341message RssStatFtraceEvent {
2342 optional int32 member = 1;
2343 optional int64 size = 2;
2344}
2345message IonHeapShrinkFtraceEvent {
2346 optional string heap_name = 1;
2347 optional uint64 len = 2;
2348 optional int64 total_allocated = 3;
2349}
2350message IonHeapGrowFtraceEvent {
2351 optional string heap_name = 1;
2352 optional uint64 len = 2;
2353 optional int64 total_allocated = 3;
2354}
2355
2356// End of protos/perfetto/trace/ftrace/kmem.proto
2357
2358// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002359
2360message LowmemoryKillFtraceEvent {
2361 optional string comm = 1;
2362 optional int32 pid = 2;
2363 optional int64 pagecache_size = 3;
2364 optional int64 pagecache_limit = 4;
2365 optional int64 free = 5;
2366}
2367
Hector Dearmane0e57802018-11-21 16:09:56 +00002368// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002369
Lalit Maganti3bd67ef2019-01-18 17:44:09 +00002370// Begin of protos/perfetto/trace/ftrace/mm_event.proto
2371
2372message MmEventRecordFtraceEvent {
2373 optional uint32 avg_lat = 1;
2374 optional uint32 count = 2;
2375 optional uint32 max_lat = 3;
2376 optional uint32 type = 4;
2377}
2378
2379// End of protos/perfetto/trace/ftrace/mm_event.proto
2380
Hector Dearmane0e57802018-11-21 16:09:56 +00002381// Begin of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002382
Hector Dearmane0e57802018-11-21 16:09:56 +00002383message CpuFrequencyFtraceEvent {
2384 optional uint32 state = 1;
2385 optional uint32 cpu_id = 2;
2386}
2387message CpuFrequencyLimitsFtraceEvent {
2388 optional uint32 min_freq = 1;
2389 optional uint32 max_freq = 2;
2390 optional uint32 cpu_id = 3;
2391}
2392message CpuIdleFtraceEvent {
2393 optional uint32 state = 1;
2394 optional uint32 cpu_id = 2;
2395}
2396message ClockEnableFtraceEvent {
2397 optional string name = 1;
2398 optional uint64 state = 2;
2399 optional uint64 cpu_id = 3;
2400}
2401message ClockDisableFtraceEvent {
2402 optional string name = 1;
2403 optional uint64 state = 2;
2404 optional uint64 cpu_id = 3;
2405}
2406message ClockSetRateFtraceEvent {
2407 optional string name = 1;
2408 optional uint64 state = 2;
2409 optional uint64 cpu_id = 3;
2410}
2411message SuspendResumeFtraceEvent {
2412 optional string action = 1;
2413 optional int32 val = 2;
2414 optional uint32 start = 3;
Hector Dearman55ef3e02018-04-11 17:28:55 +01002415}
Sidath Senanayake1f5f93a2019-06-06 22:24:15 +01002416message GpuFrequencyFtraceEvent {
2417 optional uint32 gpu_id = 1;
2418 optional uint32 state = 2;
2419}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002420
Hector Dearmane0e57802018-11-21 16:09:56 +00002421// End of protos/perfetto/trace/ftrace/power.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002422
Lalit Magantia73a7252019-01-25 10:32:40 +00002423// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto
2424
2425message SysEnterFtraceEvent {
2426 optional int64 id = 1;
2427}
2428message SysExitFtraceEvent {
2429 optional int64 id = 1;
2430 optional int64 ret = 2;
2431}
2432
2433// End of protos/perfetto/trace/ftrace/raw_syscalls.proto
2434
Hector Dearmane0e57802018-11-21 16:09:56 +00002435// Begin of protos/perfetto/trace/ftrace/sched.proto
Hector Dearman55ef3e02018-04-11 17:28:55 +01002436
2437message SchedSwitchFtraceEvent {
2438 optional string prev_comm = 1;
2439 optional int32 prev_pid = 2;
2440 optional int32 prev_prio = 3;
2441 optional int64 prev_state = 4;
2442 optional string next_comm = 5;
2443 optional int32 next_pid = 6;
2444 optional int32 next_prio = 7;
2445}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002446message SchedWakeupFtraceEvent {
2447 optional string comm = 1;
2448 optional int32 pid = 2;
2449 optional int32 prio = 3;
2450 optional int32 success = 4;
2451 optional int32 target_cpu = 5;
2452}
Hector Dearmane0e57802018-11-21 16:09:56 +00002453message SchedBlockedReasonFtraceEvent {
2454 optional int32 pid = 1;
2455 optional uint64 caller = 2;
2456 optional uint32 io_wait = 3;
2457}
2458message SchedCpuHotplugFtraceEvent {
2459 optional int32 affected_cpu = 1;
2460 optional int32 error = 2;
2461 optional int32 status = 3;
2462}
2463message SchedWakingFtraceEvent {
2464 optional string comm = 1;
2465 optional int32 pid = 2;
2466 optional int32 prio = 3;
2467 optional int32 success = 4;
2468 optional int32 target_cpu = 5;
2469}
2470message SchedWakeupNewFtraceEvent {
2471 optional string comm = 1;
2472 optional int32 pid = 2;
2473 optional int32 prio = 3;
2474 optional int32 success = 4;
2475 optional int32 target_cpu = 5;
2476}
2477message SchedProcessExecFtraceEvent {
2478 optional string filename = 1;
2479 optional int32 pid = 2;
2480 optional int32 old_pid = 3;
2481}
2482message SchedProcessExitFtraceEvent {
2483 optional string comm = 1;
2484 optional int32 pid = 2;
2485 optional int32 tgid = 3;
2486 optional int32 prio = 4;
2487}
2488message SchedProcessForkFtraceEvent {
2489 optional string parent_comm = 1;
2490 optional int32 parent_pid = 2;
2491 optional string child_comm = 3;
2492 optional int32 child_pid = 4;
2493}
2494message SchedProcessFreeFtraceEvent {
2495 optional string comm = 1;
2496 optional int32 pid = 2;
2497 optional int32 prio = 3;
2498}
2499message SchedProcessHangFtraceEvent {
2500 optional string comm = 1;
2501 optional int32 pid = 2;
2502}
2503message SchedProcessWaitFtraceEvent {
2504 optional string comm = 1;
2505 optional int32 pid = 2;
2506 optional int32 prio = 3;
2507}
Hector Dearman55ef3e02018-04-11 17:28:55 +01002508
Hector Dearmane0e57802018-11-21 16:09:56 +00002509// End of protos/perfetto/trace/ftrace/sched.proto
2510
2511// Begin of protos/perfetto/trace/ftrace/signal.proto
2512
2513message SignalDeliverFtraceEvent {
2514 optional int32 code = 1;
2515 optional uint64 sa_flags = 2;
2516 optional int32 sig = 3;
2517}
2518message SignalGenerateFtraceEvent {
2519 optional int32 code = 1;
2520 optional string comm = 2;
2521 optional int32 group = 3;
2522 optional int32 pid = 4;
2523 optional int32 result = 5;
2524 optional int32 sig = 6;
2525}
2526
2527// End of protos/perfetto/trace/ftrace/signal.proto
2528
Hector Dearmanbfc24112019-06-04 19:35:51 +01002529// Begin of protos/perfetto/trace/ftrace/systrace.proto
2530
2531message ZeroFtraceEvent {
2532 optional int32 flag = 1;
2533 optional string name = 2;
2534 optional int32 pid = 3;
2535 optional int64 value = 4;
2536}
2537
2538// End of protos/perfetto/trace/ftrace/systrace.proto
2539
Hector Dearmane0e57802018-11-21 16:09:56 +00002540// Begin of protos/perfetto/trace/ftrace/task.proto
2541
2542message TaskNewtaskFtraceEvent {
2543 optional int32 pid = 1;
2544 optional string comm = 2;
2545 optional uint64 clone_flags = 3;
2546 optional int32 oom_score_adj = 4;
2547}
2548message TaskRenameFtraceEvent {
2549 optional int32 pid = 1;
2550 optional string oldcomm = 2;
2551 optional string newcomm = 3;
2552 optional int32 oom_score_adj = 4;
2553}
2554
2555// End of protos/perfetto/trace/ftrace/task.proto
2556
2557// Begin of protos/perfetto/trace/ftrace/vmscan.proto
2558
2559message MmVmscanDirectReclaimBeginFtraceEvent {
2560 optional int32 order = 1;
2561 optional int32 may_writepage = 2;
2562 optional uint32 gfp_flags = 3;
2563}
2564message MmVmscanDirectReclaimEndFtraceEvent {
2565 optional uint64 nr_reclaimed = 1;
2566}
2567message MmVmscanKswapdWakeFtraceEvent {
2568 optional int32 nid = 1;
2569 optional int32 order = 2;
2570}
2571message MmVmscanKswapdSleepFtraceEvent {
2572 optional int32 nid = 1;
2573}
2574
2575// End of protos/perfetto/trace/ftrace/vmscan.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002576
Eric Secklerc73ef062019-02-25 12:30:35 +00002577// Begin of protos/perfetto/trace/interned_data/interned_data.proto
2578
2579// ------------------------------ DATA INTERNING: ------------------------------
2580// Interning indexes are built up gradually by adding the entries contained in
2581// each TracePacket of the same packet sequence (packets emitted by the same
2582// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
2583// can only refer to interned data from other packets in the same sequence.
2584//
2585// The writer will emit new entries when it encounters new internable values
2586// that aren't yet in the index. Data in current and subsequent TracePackets can
2587// then refer to the entry by its position (interning ID, abbreviated "iid") in
Eric Seckler612d1d02019-05-01 15:04:02 +01002588// its index. An interning ID with value 0 is considered invalid (not set).
Eric Secklerc73ef062019-02-25 12:30:35 +00002589//
2590// Because of the incremental build-up, the interning index will miss data when
2591// TracePackets are lost, e.g. because a chunk was overridden in the central
2592// ring buffer. To avoid invalidation of the whole trace in such a case, the
2593// index is periodically reset (see |incremental_state_cleared| in TracePacket).
2594// When packet loss occurs, the reader will only lose interning data up to the
2595// next reset.
2596// -----------------------------------------------------------------------------
2597
2598// Message that contains new entries for the interning indices of a packet
2599// sequence.
2600//
2601// The writer will usually emit new entries in the same TracePacket that first
2602// refers to them (since the last reset of interning state). They may also be
2603// emitted proactively in advance of referring to them in later packets.
2604//
Siddhartha S06add2b2019-06-20 02:58:50 -07002605// Next reserved id: 8 (up to 15).
2606// Next id: 20.
Eric Secklerc73ef062019-02-25 12:30:35 +00002607message InternedData {
2608 // Each field's message type needs to specify an |iid| field, which is the ID
2609 // of the entry in the field's interning index. Each field constructs its own
2610 // index, thus interning IDs are scoped to the tracing session and field
2611 // (usually as a counter for efficient var-int encoding). It is illegal to
2612 // override entries in an index (using the same iid for two different values)
2613 // within the same tracing session, even after a reset of the emitted
2614 // interning state.
2615 repeated EventCategory event_categories = 1;
2616 repeated LegacyEventName legacy_event_names = 2;
2617 repeated DebugAnnotationName debug_annotation_names = 3;
2618 repeated SourceLocation source_locations = 4;
Florian Mayerd0ee6322019-06-07 12:15:48 +01002619
Eric Secklerc73ef062019-02-25 12:30:35 +00002620 // Note: field IDs up to 15 should be used for frequent data only.
Florian Mayerd0ee6322019-06-07 12:15:48 +01002621
2622 // Build IDs of exectuable files.
2623 repeated InternedString build_ids = 16;
2624 // Paths to executable files.
2625 repeated InternedString mapping_paths = 17;
2626 // Names of functions used in frames below.
2627 repeated InternedString function_names = 5;
2628
2629 // Executable files mapped into processes.
2630 repeated Mapping mappings = 19;
2631 // Frames of callstacks of a program.
2632 repeated Frame frames = 6;
2633 // A callstack of a program.
2634 repeated Callstack callstacks = 7;
Eric Secklerc73ef062019-02-25 12:30:35 +00002635}
2636
2637// End of protos/perfetto/trace/interned_data/interned_data.proto
2638
Primiano Tuccib02d8dc2019-06-04 11:46:43 +01002639// Begin of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
2640
2641// Used to trace the execution of perfetto itself.
2642message PerfettoMetatrace {
2643 // See base/metatrace_events.h for definitions.
2644 oneof record_type {
2645 uint32 event_id = 1;
2646 uint32 counter_id = 2;
2647 }
2648
2649 // Only when using |event_id|.
2650 optional uint32 event_duration_ns = 3;
2651
2652 // Only when using |counter_id|.
2653 optional int32 counter_value = 4;
2654
2655 // ID of the thread that emitted the event.
2656 optional uint32 thread_id = 5;
2657
2658 // If true the meta-tracing ring buffer had overruns and hence some data is
2659 // missing from this point.
2660 optional bool has_overruns = 6;
2661}
2662
2663// End of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
2664
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01002665// Begin of protos/perfetto/trace/power/battery_counters.proto
2666
2667message BatteryCounters {
2668 // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
2669 optional int64 charge_counter_uah = 1;
2670
2671 // Remaining battery capacity percentage of total capacity
2672 optional float capacity_percent = 2;
2673
2674 // Instantaneous battery current in microamperes(µA).
2675 // Positive values indicate net current entering the battery from a charge
2676 // source, negative values indicate net current discharging from the battery.
2677 optional int64 current_ua = 3;
2678
2679 // Instantaneous battery current in microamperes(µA).
2680 optional int64 current_avg_ua = 4;
2681}
2682
2683// End of protos/perfetto/trace/power/battery_counters.proto
2684
Esteban Talavera7714cec2019-01-31 15:53:34 +00002685// Begin of protos/perfetto/trace/power/power_rails.proto
2686
2687message PowerRails {
2688
2689 message RailDescriptor {
2690 // Index corresponding to the rail
2691 optional uint32 index = 1;
2692 // Name of the rail
2693 optional string rail_name = 2;
2694 // Name of the subsystem to which this rail belongs
2695 optional string subsys_name = 3;
2696 // Hardware sampling rate
2697 optional uint32 sampling_rate = 4;
2698 }
2699
2700 // This is only emitted at the beginning of the trace.
2701 repeated RailDescriptor rail_descriptor = 1;
2702
2703 message EnergyData {
2704 // Index corresponding to RailDescriptor.index
2705 optional uint32 index = 1;
2706 // Time since device boot(CLOCK_BOOTTIME) in milli-seconds
2707 optional uint64 timestamp_ms = 2;
2708 // Accumulated energy since device boot in microwatt-seconds (uWs)
2709 optional uint64 energy = 3;
2710 }
2711
2712 repeated EnergyData energy_data = 2;
2713}
2714
2715// End of protos/perfetto/trace/power/power_rails.proto
2716
Florian Mayer93d16ec2019-06-05 09:51:58 +01002717// Begin of protos/perfetto/trace/profiling/profile_common.proto
2718
Siddhartha S545776e2019-06-12 19:30:19 -07002719// The interning fields in this file can refer to 2 different intern tables,
2720// depending on the message they are used in. If the interned fields are present
2721// in ProfilePacket proto, then the intern tables included in the ProfilePacket
2722// should be used. If the intered fields are present in the
2723// StreamingProfilePacket proto, then the intern tables included in all of the
2724// previous InternedData message with same sequence ID should be used.
2725// TODO(fmayer): Move to the intern tables to a common location.
Florian Mayerd0ee6322019-06-07 12:15:48 +01002726message InternedString {
2727 optional uint64 iid = 1;
2728 optional bytes str = 2;
2729}
2730
Siddhartha S545776e2019-06-12 19:30:19 -07002731// A symbol field that is emitted after the trace is written. These tables would
2732// be appended as the last packets in the trace that the profiler will use, so
2733// that the actual trace need not be rewritten to symbolize the profiles.
Siddhartha S06add2b2019-06-20 02:58:50 -07002734message ProfiledFrameSymbols {
Siddhartha S545776e2019-06-12 19:30:19 -07002735 // Use the frame id as the interning key for the symbols.
Siddhartha S06add2b2019-06-20 02:58:50 -07002736 optional int64 frame_iid = 1;
Siddhartha S545776e2019-06-12 19:30:19 -07002737
2738 optional int64 function_name_id = 2; // key to InternedString
2739 optional int64 file_name_id = 3; // key to InternedString
2740 optional int32 line_number = 4;
2741}
2742
Florian Mayer93d16ec2019-06-05 09:51:58 +01002743message Mapping {
Florian Mayerd0ee6322019-06-07 12:15:48 +01002744 optional uint64 iid = 1; // Interning key.
Florian Mayer93d16ec2019-06-05 09:51:58 +01002745 optional uint64 build_id = 2; // Interning key.
Florian Mayer12655732019-07-02 15:08:26 +01002746 // TODO(fmayer): Document difference between those two.
2747 optional uint64 exact_offset = 8;
2748 optional uint64 start_offset = 3;
Florian Mayer93d16ec2019-06-05 09:51:58 +01002749 optional uint64 start = 4;
2750 optional uint64 end = 5;
2751 optional uint64 load_bias = 6;
2752 // E.g. ["system", "lib64", "libc.so"]
2753 repeated uint64 path_string_ids = 7; // id of string.
2754}
2755
2756message Frame {
Florian Mayerd0ee6322019-06-07 12:15:48 +01002757 optional uint64 iid = 1; // Interning key
Florian Mayer93d16ec2019-06-05 09:51:58 +01002758 // E.g. "fopen"
2759 optional uint64 function_name_id = 2; // id of string.
2760 optional uint64 mapping_id = 3;
2761 optional uint64 rel_pc = 4;
2762}
2763
2764message Callstack {
Florian Mayerd0ee6322019-06-07 12:15:48 +01002765 optional uint64 iid = 1;
Florian Mayer93d16ec2019-06-05 09:51:58 +01002766 // Frames of this callstack. Bottom frame first.
2767 repeated uint64 frame_ids = 2;
2768}
2769
2770// End of protos/perfetto/trace/profiling/profile_common.proto
2771
Hector Dearman685f7522019-03-12 14:28:56 +00002772// Begin of protos/perfetto/trace/profiling/profile_packet.proto
2773
2774message ProfilePacket {
Florian Mayer5716fc12019-06-24 11:50:51 -07002775 // The following interning tables are only used in Android version Q.
2776 // In newer versions, these tables are in InternedData
2777 // (see protos/perfetto/trace/interned_data) and are shared across
2778 // multiple ProfilePackets.
2779 // For backwards compatibility, consumers need to first look up interned
2780 // data in the tables within the ProfilePacket, and then, if they are empty,
2781 // look up in the InternedData instead.
Hector Dearman685f7522019-03-12 14:28:56 +00002782 repeated InternedString strings = 1;
Florian Mayerdc642fa2019-04-16 20:20:12 +01002783 repeated Mapping mappings = 4;
Hector Dearman685f7522019-03-12 14:28:56 +00002784 repeated Frame frames = 2;
Hector Dearman685f7522019-03-12 14:28:56 +00002785 repeated Callstack callstacks = 3;
Hector Dearman685f7522019-03-12 14:28:56 +00002786
Hector Dearman685f7522019-03-12 14:28:56 +00002787 message HeapSample {
2788 optional uint64 callstack_id = 1;
Florian Mayer78760f22019-05-15 18:05:53 +01002789 // bytes allocated at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002790 optional uint64 self_allocated = 2;
Florian Mayer78760f22019-05-15 18:05:53 +01002791 // bytes allocated at this callstack that have been freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002792 optional uint64 self_freed = 3;
Florian Mayer7142c7c2019-05-20 18:11:41 +01002793 // bytes allocated at this callstack but not used since the last
2794 // clear_refs.
2795 // See documentation of idle_allocations in HeapprofdConfig for more
2796 // details.
2797 optional uint64 self_idle = 7;
Hector Dearman685f7522019-03-12 14:28:56 +00002798 optional uint64 timestamp = 4; // timestamp [opt]
Florian Mayer78760f22019-05-15 18:05:53 +01002799 // Number of allocations that were sampled at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002800 optional uint64 alloc_count = 5;
Florian Mayer78760f22019-05-15 18:05:53 +01002801 // Number of allocations that were sampled at this callstack that have been
2802 // freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002803 optional uint64 free_count = 6;
2804 }
2805
Florian Mayer096bbe32019-04-03 12:10:53 +01002806 message Histogram {
2807 message Bucket {
2808 // This bucket counts values from the previous bucket's (or -infinity if
2809 // this is the first bucket) upper_limit (inclusive) to this upper_limit
2810 // (exclusive).
2811 optional uint64 upper_limit = 1;
2812 // This is the highest bucket. This is set instead of the upper_limit. Any
2813 // values larger or equal to the previous bucket's upper_limit are counted
2814 // in this bucket.
2815 optional bool max_bucket = 2;
2816 // Number of values that fall into this range.
2817 optional uint64 count = 3;
2818 }
2819 repeated Bucket buckets = 1;
2820 }
Florian Mayerdc642fa2019-04-16 20:20:12 +01002821
Florian Mayerdba63f72019-03-27 10:20:46 +00002822 message ProcessStats {
2823 optional uint64 unwinding_errors = 1;
2824 optional uint64 heap_samples = 2;
2825 optional uint64 map_reparses = 3;
Florian Mayer096bbe32019-04-03 12:10:53 +01002826 optional Histogram unwinding_time_us = 4;
Florian Mayer9fe278d2019-04-04 19:20:41 +01002827 optional uint64 total_unwinding_time_us = 5;
Florian Mayerdba63f72019-03-27 10:20:46 +00002828 }
Florian Mayerd0335fe2019-03-27 10:20:22 +00002829
Florian Mayerdc642fa2019-04-16 20:20:12 +01002830 repeated ProcessHeapSamples process_dumps = 5;
Hector Dearman685f7522019-03-12 14:28:56 +00002831 message ProcessHeapSamples {
2832 optional uint64 pid = 1;
Florian Mayerd0335fe2019-03-27 10:20:22 +00002833
2834 // This process was profiled from startup.
2835 // If false, this process was already running when profiling started.
2836 optional bool from_startup = 3;
2837
2838 // This process was not profiled because a concurrent session was active.
2839 // If this is true, samples will be empty.
2840 optional bool rejected_concurrent = 4;
Florian Mayer22e08dc2019-03-28 11:36:02 +00002841
2842 // This process disconnected while it was profiled.
2843 // If false, the process outlived the profiling session.
2844 optional bool disconnected = 6;
2845
Florian Mayerf6680532019-04-10 17:39:31 +01002846 // If disconnected, this disconnect was caused by the client overrunning
2847 // the buffer.
2848 optional bool buffer_overran = 7;
2849
Florian Mayere32b4fd2019-04-15 14:37:52 +01002850 // If disconnected, this disconnected was caused by the shared memory
2851 // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT
2852 // MEMORY CORRUPTION.
2853 optional bool buffer_corrupted = 8;
2854
Florian Mayer5bd65f42019-05-02 16:20:38 +01002855 // Timestamp of the state of the target process that this dump represents.
2856 // This can be different to the timestamp of the TracePackets for various
2857 // reasons:
2858 // * If disconnected is set above, this is the timestamp of last state
2859 // heapprofd had of the process before it disconnected.
2860 // * Otherwise, if the rate of events produced by the process is high,
2861 // heapprofd might be behind.
2862 //
2863 // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock
2864 // to have a type enum that we can reuse here.
2865 optional uint64 timestamp = 9;
2866
Florian Mayerd0335fe2019-03-27 10:20:22 +00002867 optional ProcessStats stats = 5;
2868
Hector Dearman685f7522019-03-12 14:28:56 +00002869 repeated HeapSample samples = 2;
2870 }
2871
2872 optional bool continued = 6;
Florian Mayer638a1162019-07-12 10:42:56 +00002873 optional uint64 index = 7;
Hector Dearman685f7522019-03-12 14:28:56 +00002874}
2875
Oystein Eftevaagcba56412019-06-13 10:32:01 -07002876// Message used to represent individual stack samples sampled at discrete
2877// points in time, rather than aggregated over an interval.
2878message StreamingProfilePacket {
2879 repeated uint64 callstack_iid = 1; // Index into InternedData.callstacks
2880 repeated int64 timestamp_delta_us = 2;
2881}
2882
Hector Dearman685f7522019-03-12 14:28:56 +00002883// End of protos/perfetto/trace/profiling/profile_packet.proto
2884
Hector Dearmane92c6742018-11-22 21:42:39 +00002885// Begin of protos/perfetto/trace/ps/process_stats.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002886
Hector Dearmane92c6742018-11-22 21:42:39 +00002887// Per-process periodically sampled stats. These samples are wrapped in a
2888// dedicated message (as opposite to be fields in process_tree.proto) because
2889// they are dumped at a different rate than cmdline and thread list.
Lalit Maganti999355c2019-03-27 18:17:08 +00002890// Note: not all of these stats will be present in every ProcessStats message
2891// and sometimes processes may be missing . This is because counters are
2892// cached to reduce emission of counters which do not change.
Hector Dearmane92c6742018-11-22 21:42:39 +00002893message ProcessStats {
Lalit Maganti6820abc2019-01-21 11:12:23 +00002894 message Process {
Hector Dearmane92c6742018-11-22 21:42:39 +00002895 optional int32 pid = 1;
Lalit Maganti6820abc2019-01-21 11:12:23 +00002896
2897 // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
Hector Dearmane92c6742018-11-22 21:42:39 +00002898 optional uint64 vm_size_kb = 2;
2899 optional uint64 vm_rss_kb = 3;
2900 optional uint64 rss_anon_kb = 4;
2901 optional uint64 rss_file_kb = 5;
2902 optional uint64 rss_shmem_kb = 6;
2903 optional uint64 vm_swap_kb = 7;
2904 optional uint64 vm_locked_kb = 8;
2905 optional uint64 vm_hwm_kb = 9;
2906 // When adding a new field remember to update kProcMemCounterSize in
2907 // the trace processor.
Lalit Maganti6820abc2019-01-21 11:12:23 +00002908
2909 optional int64 oom_score_adj = 10;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002910 }
Lalit Maganti6820abc2019-01-21 11:12:23 +00002911 repeated Process processes = 1;
Daniel Colascione4fe75a52019-05-30 12:39:12 -07002912
2913 // The time at which we finish collecting this batch of samples;
2914 // the top-level packet timestamp is the time at which
2915 // we begin collection.
2916 // TODO(dancol): analysis might be improved by
2917 // time-bracketing each sample as well as the whole
2918 // ProcessStats, but doing that is probably gated on
2919 // a vdso for CLOCK_BOOTTIME.
2920 optional uint64 collection_end_timestamp = 2;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002921}
2922
Hector Dearmane92c6742018-11-22 21:42:39 +00002923// End of protos/perfetto/trace/ps/process_stats.proto
2924
2925// Begin of protos/perfetto/trace/ps/process_tree.proto
2926
2927message ProcessTree {
2928 // Representation of a thread.
2929 message Thread {
2930 // The thread id (as per gettid())
2931 optional int32 tid = 1;
2932
2933 // Thread group id (i.e. the PID of the process, == TID of the main thread)
2934 optional int32 tgid = 3;
2935
2936 // The name of the thread.
2937 optional string name = 2;
2938 }
2939
2940 // Representation of a process.
2941 message Process {
2942 // The UNIX process ID, aka thread group ID (as per getpid()).
2943 optional int32 pid = 1;
2944
2945 // The parent process ID, as per getppid().
2946 optional int32 ppid = 2;
2947
2948 // The command line for the process, as per /proc/pid/cmdline.
2949 // If it is a kernel thread there will only be one cmdline field
2950 // and it will contain /proc/pid/comm.
2951 repeated string cmdline = 3;
2952
2953 // No longer used as of Apr 2018, when the dedicated |threads| field was
2954 // introduced in ProcessTree.
2955 repeated Thread threads_deprecated = 4 [deprecated = true];
2956 }
2957
2958 // List of processes and threads in the client. These lists are incremental
2959 // and not exhaustive. A process and its threads might show up separately in
2960 // different ProcessTree messages. A thread might event not show up at all, if
2961 // no sched_switch activity was detected, for instance:
2962 // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
2963 // #1 { threads: [{pid: 12, tgid: 10}] }
2964 // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
2965 repeated Process processes = 1;
2966 repeated Thread threads = 2;
Daniel Colascione4fe75a52019-05-30 12:39:12 -07002967
2968 // The time at which we finish collecting this process tree;
2969 // the top-level packet timestamp is the time at which
2970 // we begin collection.
2971 optional uint64 collection_end_timestamp = 3;
Hector Dearmane92c6742018-11-22 21:42:39 +00002972}
2973
2974// End of protos/perfetto/trace/ps/process_tree.proto
2975
2976// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
2977
2978// Various Linux system stat counters from /proc.
2979// The fields in this message can be reported at different rates and with
2980// different granularity. See sys_stats_config.proto.
2981message SysStats {
2982 // Counters from /proc/meminfo. Values are in KB.
2983 message MeminfoValue {
2984 optional MeminfoCounters key = 1;
2985 optional uint64 value = 2;
2986 };
2987 repeated MeminfoValue meminfo = 1;
2988
2989 // Counter from /proc/vmstat. Units are often pages, not KB.
2990 message VmstatValue {
2991 optional VmstatCounters key = 1;
2992 optional uint64 value = 2;
2993 };
2994 repeated VmstatValue vmstat = 2;
2995
2996 // Times in each mode, since boot. Unit: nanoseconds.
2997 message CpuTimes {
2998 optional uint32 cpu_id = 1;
2999 optional uint64 user_ns = 2; // Time spent in user mode.
3000 optional uint64 user_ice_ns = 3; // Time spent in user mode (low prio).
3001 optional uint64 system_mode_ns = 4; // Time spent in system mode.
3002 optional uint64 idle_ns = 5; // Time spent in the idle task.
3003 optional uint64 io_wait_ns = 6; // Time spent waiting for I/O.
3004 optional uint64 irq_ns = 7; // Time spent servicing interrupts.
3005 optional uint64 softirq_ns = 8; // Time spent servicing softirqs.
3006 }
3007 repeated CpuTimes cpu_stat = 3; // One entry per cpu.
3008
3009 // Num processes forked since boot.
3010 // Populated only if FORK_COUNT in config.stat_counters.
3011 optional uint64 num_forks = 4;
3012
3013 message InterruptCount {
3014 optional int32 irq = 1;
3015 optional uint64 count = 2;
3016 }
3017
3018 // Number of interrupts, broken by IRQ number.
3019 // Populated only if IRQ_COUNTS in config.stat_counters.
3020 optional uint64 num_irq_total = 5; // Total num of irqs serviced since boot.
3021 repeated InterruptCount num_irq = 6;
3022
3023 // Number of softirqs, broken by softirq number.
3024 // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
3025 optional uint64 num_softirq_total = 7; // Total num of softirqs since boot.
3026 repeated InterruptCount num_softirq = 8; // Per-softirq count.
Daniel Colascione4fe75a52019-05-30 12:39:12 -07003027
3028 // The time at which we finish collecting this set of samples;
3029 // the top-level packet timestamp is the time at which
3030 // we begin collection.
3031 optional uint64 collection_end_timestamp = 9;
Hector Dearmane92c6742018-11-22 21:42:39 +00003032}
3033
3034// End of protos/perfetto/trace/sys_stats/sys_stats.proto
3035
Hector Dearman685f7522019-03-12 14:28:56 +00003036// Begin of protos/perfetto/trace/system_info.proto
3037
3038message Utsname {
3039 optional string sysname = 1;
3040 optional string version = 2;
3041 optional string release = 3;
3042 optional string machine = 4;
3043}
3044
3045message SystemInfo {
3046 optional Utsname utsname = 1;
3047}
3048
3049// End of protos/perfetto/trace/system_info.proto
3050
Hector Dearmane92c6742018-11-22 21:42:39 +00003051// Begin of protos/perfetto/trace/trace.proto
3052
3053message Trace {
3054 repeated TracePacket packet = 1;
3055
3056 // Do NOT add any other field here. This is just a convenience wrapper for
3057 // the use case of a trace being saved to a file. There are other cases
3058 // (streaming) where TracePacket are directly streamed without being wrapped
3059 // in a Trace proto. Nothing should ever rely on the full trace, all the
3060 // logic should be based on TracePacket(s).
3061}
3062
3063// End of protos/perfetto/trace/trace.proto
3064
3065// Begin of protos/perfetto/trace/trace_packet.proto
3066
3067// The root object emitted by Perfetto. A perfetto trace is just a stream of
3068// TracePacket(s).
3069//
Eric Secklerc73ef062019-02-25 12:30:35 +00003070// Next reserved id: 13 (up to 15).
Siddhartha S06add2b2019-06-20 02:58:50 -07003071// Next id: 56.
Hector Dearmane92c6742018-11-22 21:42:39 +00003072message TracePacket {
Lalit Maganti64bcc242018-12-05 13:35:08 +00003073 // TODO(primiano): in future we should add a timestamp_clock_domain field to
Hector Dearmane92c6742018-11-22 21:42:39 +00003074 // allow mixing timestamps from different clock domains.
3075 optional uint64 timestamp = 8; // Timestamp [ns].
3076
3077 oneof data {
3078 FtraceEventBundle ftrace_events = 1;
3079 ProcessTree process_tree = 2;
3080 ProcessStats process_stats = 9;
3081 InodeFileMap inode_file_map = 4;
3082 // removed field with id 5
3083 ClockSnapshot clock_snapshot = 6;
3084 SysStats sys_stats = 7;
Eric Secklerc73ef062019-02-25 12:30:35 +00003085 TrackEvent track_event = 11;
Hector Dearmane92c6742018-11-22 21:42:39 +00003086
Eric Secklerc73ef062019-02-25 12:30:35 +00003087 // IDs up to 15 are reserved. They take only one byte to encode their
3088 // preamble so should be used for freqeuent events.
Hector Dearmane92c6742018-11-22 21:42:39 +00003089
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003090 TraceConfig trace_config = 33;
Hector Dearmane92c6742018-11-22 21:42:39 +00003091 FtraceStats ftrace_stats = 34;
Ryan Savitski41ce4592019-05-02 14:43:59 +01003092 TraceStats trace_stats = 35;
Florian Mayer84113672019-01-21 14:48:27 +00003093 ProfilePacket profile_packet = 37;
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01003094 BatteryCounters battery = 38;
Esteban Talavera7714cec2019-01-31 15:53:34 +00003095 PowerRails power_rails = 40;
Primiano Tucci64df2ca2019-01-03 22:26:47 +00003096 AndroidLogPacket android_log = 39;
Hector Dearman685f7522019-03-12 14:28:56 +00003097 SystemInfo system_info = 45;
Stephen Nusko70ea3302019-04-01 19:44:40 +01003098 Trigger trigger = 46;
Florian Mayer12f0f8e2019-04-02 12:31:13 +01003099 PackagesList packages_list = 47;
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +01003100 ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
Primiano Tuccib02d8dc2019-06-04 11:46:43 +01003101 PerfettoMetatrace perfetto_metatrace = 49;
Siddhartha S1239fb32019-06-06 11:17:13 -07003102 ChromeMetadataPacket chrome_metadata = 51;
Ryan Savitski89bd9222019-06-13 14:39:30 +01003103 GpuCounterEvent gpu_counter_event = 52;
3104 GpuRenderStageEvent gpu_render_stage_event = 53;
Oystein Eftevaagcba56412019-06-13 10:32:01 -07003105 StreamingProfilePacket streaming_profile_packet = 54;
Hector Dearmane92c6742018-11-22 21:42:39 +00003106
Siddhartha S06add2b2019-06-20 02:58:50 -07003107 // Only used in profile packets.
3108 ProfiledFrameSymbols profiled_frame_symbols = 55;
3109
Eric Secklerc73ef062019-02-25 12:30:35 +00003110 // Only used by TrackEvent.
3111 ProcessDescriptor process_descriptor = 43;
3112 ThreadDescriptor thread_descriptor = 44;
3113
Hector Dearmane92c6742018-11-22 21:42:39 +00003114 // This field is emitted at periodic intervals (~10s) and
3115 // contains always the binary representation of the UUID
3116 // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
3117 // efficiently partition long traces without having to fully parse them.
3118 bytes synchronization_marker = 36;
3119
Hector Dearman554627f2019-06-04 17:58:22 +01003120 // Zero or more proto encoded trace packets compressed using deflate.
3121 // Each compressed_packets TracePacket (including the two field ids and
3122 // sizes) should be less than 512KB.
3123 bytes compressed_packets = 50;
3124
Hector Dearmane92c6742018-11-22 21:42:39 +00003125 // This field is only used for testing.
Hector Dearman248241e2019-05-10 18:28:45 +01003126 // In previous versions of this proto this field had the id 268435455
3127 // This caused many problems:
3128 // - protozero decoder does not handle field ids larger than 999.
3129 // - old versions of protoc produce Java bindings with syntax errors when
3130 // the field id is large enough.
3131 // removed field with id 900
Hector Dearmane92c6742018-11-22 21:42:39 +00003132 }
3133
3134 // Trusted user id of the producer which generated this packet. Keep in sync
3135 // with TrustedPacket.trusted_uid.
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00003136 //
3137 // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
3138 // instead.
Hector Dearmane92c6742018-11-22 21:42:39 +00003139 oneof optional_trusted_uid { int32 trusted_uid = 3; };
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00003140
3141 // Service-assigned identifier of the packet sequence this packet belongs to.
3142 // Uniquely identifies a producer + writer pair within the tracing session. A
3143 // value of zero denotes an invalid ID. Keep in sync with
3144 // TrustedPacket.trusted_packet_sequence_id.
3145 oneof optional_trusted_packet_sequence_id {
3146 uint32 trusted_packet_sequence_id = 10;
3147 }
Eric Secklerc73ef062019-02-25 12:30:35 +00003148
3149 // Incrementally emitted interned data, valid only on the packet's sequence
3150 // (packets with the same |trusted_packet_sequence_id|). The writer will
3151 // usually emit new interned data in the same TracePacket that first refers to
3152 // it (since the last reset of interning state). It may also be emitted
3153 // proactively in advance of referring to them in later packets.
3154 optional InternedData interned_data = 12;
3155
3156 // Set to true by the writer to indicate that it will re-emit any incremental
3157 // data for the packet's sequence before referring to it again. This includes
3158 // interned data as well as periodically emitted data like
3159 // Process/ThreadDescriptors. This flag only affects the current packet
3160 // sequence (see |trusted_packet_sequence_id|).
3161 //
3162 // When set to true, this TracePacket and subsequent TracePackets on the same
3163 // sequence will not refer to any incremental data emitted before this
3164 // TracePacket. For example, previously emitted interned data will be
3165 // re-emitted if it is referred to again.
3166 //
3167 // When the reader detects packet loss (|previous_packet_dropped|), it needs
3168 // to skip packets in the sequence until the next one with this flag set, to
3169 // ensure intact incremental data.
3170 optional bool incremental_state_cleared = 41;
3171
Ryan Savitskia9097812019-03-26 16:13:25 +00003172 // Flag set by the service if, for the current packet sequence (see
3173 // |trusted_packet_sequence_id|), either:
3174 // * this is the first packet, or
3175 // * one or multiple packets were dropped since the last packet that the
3176 // consumer read from the sequence. This can happen if chunks in the trace
3177 // buffer are overridden before the consumer could read them when the trace
3178 // is configured in ring buffer mode.
Eric Secklerc73ef062019-02-25 12:30:35 +00003179 //
3180 // When packet loss occurs, incrementally emitted data (including interned
3181 // data) on the sequence should be considered invalid up until the next packet
Ryan Savitskia9097812019-03-26 16:13:25 +00003182 // with |incremental_state_cleared| set.
Eric Secklerc73ef062019-02-25 12:30:35 +00003183 optional bool previous_packet_dropped = 42;
Hector Dearmane92c6742018-11-22 21:42:39 +00003184}
3185
3186// End of protos/perfetto/trace/trace_packet.proto
Florian Mayer84113672019-01-21 14:48:27 +00003187
Eric Secklerc73ef062019-02-25 12:30:35 +00003188// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
3189
3190// Key/value annotations provided in untyped TRACE_EVENT macros. These
3191// annotations are intended for debug use and are not considered a stable API
3192// surface. As such, they should not be relied upon to implement (new) metrics.
3193message DebugAnnotation {
3194 message NestedValue {
3195 enum NestedType {
3196 UNSPECIFIED = 0; // leaf value.
3197 DICT = 1;
3198 ARRAY = 2;
3199 }
3200 optional NestedType nested_type = 1;
3201
3202 repeated string dict_keys = 2;
3203 repeated NestedValue dict_values = 3;
3204 repeated NestedValue array_values = 4;
3205 optional int64 int_value = 5;
3206 optional double double_value = 6;
3207 optional bool bool_value = 7;
3208 optional string string_value = 8;
3209 }
3210
Florian Mayer5716fc12019-06-24 11:50:51 -07003211 optional uint64 name_iid = 1; // interned DebugAnnotationName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003212
3213 oneof value {
3214 bool bool_value = 2;
3215 uint64 uint_value = 3;
3216 int64 int_value = 4;
3217 double double_value = 5;
3218 string string_value = 6;
3219 // Pointers are stored in a separate type as the JSON output treats them
3220 // differently from other uint64 values.
3221 uint64 pointer_value = 7;
3222 NestedValue nested_value = 8;
3223
3224 // Legacy instrumentation may not support conversion of nested data to
3225 // NestedValue yet.
3226 string legacy_json_value = 9;
3227 }
3228}
3229
3230// --------------------
3231// Interned data types:
3232// --------------------
3233
3234message DebugAnnotationName {
Florian Mayer5716fc12019-06-24 11:50:51 -07003235 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003236 optional string name = 2;
3237}
3238
3239// End of protos/perfetto/trace/track_event/debug_annotation.proto
3240
3241// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
3242
3243// Process-wide data that is periodically emitted by one thread per process.
3244// Valid for all events in packet sequences emitted by the same process.
3245//
3246// Next id: 5.
3247message ProcessDescriptor {
3248 optional int32 pid = 1;
3249 repeated string cmdline = 2;
3250
3251 // To support old UI. New UI should determine default sorting by process_type.
3252 optional int32 legacy_sort_index = 3;
3253
3254 // See chromium's content::ProcessType.
3255 enum ChromeProcessType {
Eric Seckler59945762019-03-04 11:48:25 +00003256 PROCESS_UNSPECIFIED = 0;
3257 PROCESS_BROWSER = 1;
3258 PROCESS_RENDERER = 2;
3259 PROCESS_UTILITY = 3;
3260 PROCESS_ZYGOTE = 4;
3261 PROCESS_SANDBOX_HELPER = 5;
3262 PROCESS_GPU = 6;
3263 PROCESS_PPAPI_PLUGIN = 7;
3264 PROCESS_PPAPI_BROKER = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00003265 }
3266 optional ChromeProcessType chrome_process_type = 4;
Oystein Eftevaagcba56412019-06-13 10:32:01 -07003267 optional int32 process_priority = 5;
Eric Secklerc73ef062019-02-25 12:30:35 +00003268}
3269
3270// End of protos/perfetto/trace/track_event/process_descriptor.proto
3271
3272// Begin of protos/perfetto/trace/track_event/task_execution.proto
3273
3274// TrackEvent arguments describing the execution of a task.
3275message TaskExecution {
3276 // Source location that the task was posted from.
Florian Mayer5716fc12019-06-24 11:50:51 -07003277 optional uint64 posted_from_iid = 1; // interned SourceLocation.
Eric Secklerc73ef062019-02-25 12:30:35 +00003278}
3279
3280// --------------------
3281// Interned data types:
3282// --------------------
3283
3284message SourceLocation {
Florian Mayer5716fc12019-06-24 11:50:51 -07003285 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003286
3287 // We intend to add a binary symbol version of this in the future.
3288 optional string file_name = 2;
3289 optional string function_name = 3;
3290}
3291
3292// End of protos/perfetto/trace/track_event/task_execution.proto
3293
3294// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
3295
3296// Periodically emitted data that's common to all events emitted by the same
3297// thread, i.e. all events in the same packet sequence. Valid for all subsequent
3298// events in the same sequence.
3299//
Eric Seckler1fe18c92019-05-30 10:27:54 +01003300// Next id: 9.
Eric Secklerc73ef062019-02-25 12:30:35 +00003301message ThreadDescriptor {
3302 optional int32 pid = 1;
3303 optional int32 tid = 2;
3304
3305 // To support old UI. New UI should determine default sorting by thread_type.
3306 optional int32 legacy_sort_index = 3;
3307
3308 enum ChromeThreadType {
Siddhartha Sd892f882019-06-03 11:48:42 -07003309 CHROME_THREAD_UNSPECIFIED = 0;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003310
Siddhartha Sd892f882019-06-03 11:48:42 -07003311 CHROME_THREAD_MAIN = 1;
3312 CHROME_THREAD_IO = 2;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003313
3314 // Scheduler:
Siddhartha Sd892f882019-06-03 11:48:42 -07003315 CHROME_THREAD_POOL_BG_WORKER = 3;
3316 CHROME_THREAD_POOL_FG_WORKER = 4;
3317 CHROME_THREAD_POOL_FB_BLOCKING = 5;
3318 CHROME_THREAD_POOL_BG_BLOCKING = 6;
3319 CHROME_THREAD_POOL_SERVICE = 7;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003320
3321 // Compositor:
Siddhartha Sd892f882019-06-03 11:48:42 -07003322 CHROME_THREAD_COMPOSITOR = 8;
3323 CHROME_THREAD_VIZ_COMPOSITOR = 9;
3324 CHROME_THREAD_COMPOSITOR_WORKER = 10;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003325
3326 // Renderer:
Siddhartha Sd892f882019-06-03 11:48:42 -07003327 CHROME_THREAD_SERVICE_WORKER = 11;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003328
3329 // Tracing related threads:
Siddhartha Sd892f882019-06-03 11:48:42 -07003330 CHROME_THREAD_MEMORY_INFRA = 50;
3331 CHROME_THREAD_SAMPLING_PROFILER = 51;
Eric Secklerc73ef062019-02-25 12:30:35 +00003332 };
Eric Seckler14167852019-03-26 09:20:09 +00003333 optional ChromeThreadType chrome_thread_type = 4;
Eric Secklerc73ef062019-02-25 12:30:35 +00003334
3335 // TODO(eseckler): Replace this with ChromeThreadType where possible.
3336 optional string thread_name = 5;
3337
3338 // Absolute reference values. Clock values in subsequent TrackEvents can be
3339 // encoded accumulatively and relative to these. This reduces their var-int
3340 // encoding size.
3341 optional int64 reference_timestamp_us = 6;
3342 optional int64 reference_thread_time_us = 7;
Eric Seckler1fe18c92019-05-30 10:27:54 +01003343 optional int64 reference_thread_instruction_count = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00003344}
3345
3346// End of protos/perfetto/trace/track_event/thread_descriptor.proto
3347
3348// Begin of protos/perfetto/trace/track_event/track_event.proto
3349
3350// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
3351// which describe activity on a track, such as a thread, task sequence, or
3352// asynchronous track.
3353//
3354// This message is optimized for writing and makes heavy use of data interning
3355// and delta encoding (e.g. of timestamps) to reduce data repetition and encoded
3356// data size.
3357//
3358// A TrackEvent exists in the context of its packet sequence (TracePackets
3359// emitted by the same producer + writer) and refers to data in preceding
3360// TracePackets emitted on the same sequence, both directly and indirectly. For
3361// example, interned data entries are emitted as part of a TracePacket and
3362// directly referred to from TrackEvents by their interning IDs. Attributes
3363// shared by all events on the same sequence (e.g. their thread and process
3364// association) are emitted as part of ProcessDescriptor and ThreadDescriptor
3365// messages in separate TracePackets instead.
3366//
Eric Seckler1fe18c92019-05-30 10:27:54 +01003367// Next reserved id: 8 (up to 15).
Andrew Comminos195e9352019-05-14 16:56:47 -07003368// Next id: 21.
Eric Secklerc73ef062019-02-25 12:30:35 +00003369message TrackEvent {
3370 // Timestamp in microseconds (usually CLOCK_MONOTONIC).
3371 oneof timestamp {
3372 // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
3373 // calculate the absolute timestamp value, sum up all delta values of the
3374 // preceding TrackEvents since the last ThreadDescriptor and add the sum to
3375 // the |reference_timestamp| in ThreadDescriptor. This value should always
3376 // be positive.
3377 int64 timestamp_delta_us = 1;
3378 // Absolute value (e.g. a manually specified timestamp in the macro).
3379 // This is a one-off value that does not affect delta timestamp computation
3380 // in subsequent TrackEvents.
3381 int64 timestamp_absolute_us = 16;
3382 }
3383
3384 // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
3385 // microseconds.
3386 oneof thread_time {
3387 // Same encoding as |timestamp| fields above.
3388 int64 thread_time_delta_us = 2;
3389 // TODO(eseckler): Consider removing absolute thread time support. It's
3390 // currently required to support writing PHASE_COMPLETE events out-of-order,
3391 // but shouldn't be required anymore when we split them into begin/end.
3392 int64 thread_time_absolute_us = 17;
3393 }
3394
Eric Seckler1fe18c92019-05-30 10:27:54 +01003395 // Value of the instruction counter for the current thread.
3396 oneof thread_instruction_count {
3397 // Same encoding as |timestamp| fields above.
3398 int64 thread_instruction_count_delta = 8;
3399 // TODO(eseckler): Consider removing absolute thread instruction count
3400 // support. It's currently required to support writing PHASE_COMPLETE events
3401 // out-of-order, but shouldn't be required anymore when we split them into
3402 // begin/end.
3403 int64 thread_instruction_count_absolute = 20;
3404 }
Andrew Comminos195e9352019-05-14 16:56:47 -07003405
Eric Secklerc73ef062019-02-25 12:30:35 +00003406 // We intend to add a binary symbol version of this in the future.
Florian Mayer5716fc12019-06-24 11:50:51 -07003407 repeated uint64 category_iids = 3; // interned EventCategoryName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003408
3409 // TODO(eseckler): May also want a debug_name for untyped debug-only events.
3410
3411 // Unstable key/value annotations shown in the trace viewer but not intended
3412 // for metrics use.
3413 repeated DebugAnnotation debug_annotations = 4;
3414
3415 // Typed event arguments:
3416 optional TaskExecution task_execution = 5;
3417 // TODO(eseckler): New argument types go here :)
3418
3419 // Apart from {category, time, thread time, tid, pid}, other legacy trace
3420 // event attributes are initially simply proxied for conversion to a JSON
3421 // trace. We intend to gradually transition these attributes to similar native
3422 // features in TrackEvent (e.g. async + flow events), or deprecate them
3423 // without replacement where transition is unsuitable.
Eric Seckler59945762019-03-04 11:48:25 +00003424 //
Eric Seckler1fe18c92019-05-30 10:27:54 +01003425 // Next reserved id: 16 (up to 16).
Eric Seckler59945762019-03-04 11:48:25 +00003426 // Next id: 20.
Eric Secklerc73ef062019-02-25 12:30:35 +00003427 message LegacyEvent {
Florian Mayer5716fc12019-06-24 11:50:51 -07003428 optional uint64 name_iid = 1; // interned LegacyEventName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003429 optional int32 phase = 2;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003430 optional int64 duration_us = 3;
3431 optional int64 thread_duration_us = 4;
Eric Seckler59945762019-03-04 11:48:25 +00003432
Eric Seckler1fe18c92019-05-30 10:27:54 +01003433 // Elapsed retired instruction count during the event.
3434 optional int64 thread_instruction_delta = 15;
3435
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003436 reserved 5; // used to be |flags|.
Eric Seckler59945762019-03-04 11:48:25 +00003437
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003438 oneof id {
3439 uint64 unscoped_id = 6;
3440 uint64 local_id = 10;
3441 uint64 global_id = 11;
3442 }
3443 // Additional optional scope for |id|.
3444 optional string id_scope = 7;
Eric Seckler59945762019-03-04 11:48:25 +00003445
3446 // Consider the thread timestamps for async BEGIN/END event pairs as valid.
3447 optional bool use_async_tts = 9;
3448
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003449 // Idenfifies a flow. Flow events with the same bind_id are connected.
Eric Secklerc73ef062019-02-25 12:30:35 +00003450 optional uint64 bind_id = 8;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003451 // Use the enclosing slice as binding point for a flow end event instead of
3452 // the next slice. Flow start/step events always bind to the enclosing
3453 // slice.
Eric Seckler59945762019-03-04 11:48:25 +00003454 optional bool bind_to_enclosing = 12;
3455
3456 enum FlowDirection {
3457 FLOW_UNSPECIFIED = 0;
3458 FLOW_IN = 1;
3459 FLOW_OUT = 2;
3460 FLOW_INOUT = 3;
3461 }
3462 optional FlowDirection flow_direction = 13;
3463
3464 enum InstantEventScope {
3465 SCOPE_UNSPECIFIED = 0;
3466 SCOPE_GLOBAL = 1;
3467 SCOPE_PROCESS = 2;
3468 SCOPE_THREAD = 3;
3469 }
3470 optional InstantEventScope instant_event_scope = 14;
Eric Secklerc73ef062019-02-25 12:30:35 +00003471
3472 // Override the pid/tid if the writer needs to emit events on behalf of
3473 // another process/thread. This should be the exception. Normally, the
3474 // pid+tid from ThreadDescriptor is used.
3475 optional int32 pid_override = 18;
3476 optional int32 tid_override = 19;
3477 }
3478
3479 optional LegacyEvent legacy_event = 6;
3480}
3481
3482// --------------------
3483// Interned data types:
3484// --------------------
3485
3486message EventCategory {
Florian Mayer5716fc12019-06-24 11:50:51 -07003487 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003488 optional string name = 2;
3489}
3490
3491message LegacyEventName {
Florian Mayer5716fc12019-06-24 11:50:51 -07003492 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003493 optional string name = 2;
3494}
3495
3496// End of protos/perfetto/trace/track_event/track_event.proto
3497
Stephen Nusko70ea3302019-04-01 19:44:40 +01003498// Begin of protos/perfetto/trace/trigger.proto
3499
3500// When a TracingSession receives a trigger it records the boot time nanoseconds
3501// in the TracePacket's timestamp field as well as the name of the producer that
3502// triggered it. We emit this data so filtering can be done on triggers received
3503// in the trace.
3504message Trigger {
3505 // Name of the trigger which was received.
3506 optional string trigger_name = 1;
3507 // The actual producer that activated |trigger|.
3508 optional string producer_name = 2;
3509 // The verified UID of the producer.
3510 optional int32 trusted_producer_uid = 3;
3511}
3512
3513// End of protos/perfetto/trace/trigger.proto
3514
Ryan Savitski89bd9222019-06-13 14:39:30 +01003515// Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto
3516
3517message GpuCounterEvent {
3518 // The first trace packet of each session should include counter_spec.
Florian Mayerb5751122019-07-02 14:07:03 +01003519 optional GpuCounterDescriptor counter_descriptor = 1;
Ryan Savitski89bd9222019-06-13 14:39:30 +01003520
3521 message GpuCounter {
3522 // required. Identifier for counter.
3523 optional uint32 counter_id = 1;
3524 // required. Value of the counter.
Florian Mayerb5751122019-07-02 14:07:03 +01003525 oneof value {
3526 int64 int_value = 2;
3527 double double_value = 3;
3528 }
Ryan Savitski89bd9222019-06-13 14:39:30 +01003529 }
3530 repeated GpuCounter counters = 2;
3531}
3532
3533// End of protos/perfetto/trace/gpu/gpu_counter_event.proto
3534
3535// Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
3536
3537message GpuRenderStageEvent {
3538 // required. Unique ID for the event.
3539 optional uint64 event_id = 1;
3540
3541 // required. Start time of event in GPU clock.
3542 optional uint64 start_time = 2;
3543
3544 // optional. Duration in GPU clock. If unset, this is a single time point
3545 // event.
3546 optional uint64 duration = 3;
3547
3548 // required. ID to a hardware queue description in the specifications.
3549 optional int32 hw_queue_id = 4;
3550
3551 // required. ID to a render stage description in the specifications.
3552 optional int32 stage_id = 5;
3553
3554 // required. GL context/VK device.
3555 optional uint64 context = 6;
3556
3557 // optional. Additional data for the user. This may include attribs for
3558 // the event like resource ids, shaders etc
3559 message ExtraData {
3560 optional string name = 1;
3561 optional string value = 2;
3562 }
3563 repeated ExtraData extra_data = 7;
3564
3565 // The first trace packet of each session should include a Specifications
3566 // to enumerate all IDs that will be used.
3567 message Specifications {
3568 message ContextSpec {
3569 optional uint64 context = 1;
3570 optional int32 pid = 2;
3571 }
3572 optional ContextSpec context_spec = 1;
3573
3574 message Description {
3575 optional int32 id = 1;
3576 optional string name = 2;
3577 optional string description = 3;
3578 }
3579
3580 // Labels to categorize the hw Queue this event goes on
3581 repeated Description hw_queue = 2;
3582
3583 // Labels to categorize render stage(binning, render, compute etc)
3584 repeated Description stage = 3;
3585 }
3586 optional Specifications specifications = 8;
3587
3588 // Extension for vendor's custom proto.
3589 extensions 100 to 200;
3590}
3591
3592// End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
3593
Florian Mayerb5751122019-07-02 14:07:03 +01003594// Begin of protos/perfetto/common/gpu_counter_descriptor.proto
3595
3596// Description of GPU counters.
3597// This message is sent by a GPU counter producer to specify the counters available in the hardware.
3598message GpuCounterDescriptor {
3599 message GpuCounterSpec {
3600 optional uint32 counter_id = 1;
3601 optional string name = 2;
3602 optional string description = 3;
3603 }
3604 repeated GpuCounterSpec specs = 1;
3605}
3606
3607// End of protos/perfetto/common/gpu_counter_descriptor.proto
3608
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003609// Begin of protos/perfetto/config/android/android_log_config.proto
3610
3611message AndroidLogConfig {
3612 repeated AndroidLogId log_ids = 1;
3613
3614 reserved 2; // Was |poll_ms|, deprecated.
3615
3616 // If set ignores all log messages whose prio is < the given value.
3617 optional AndroidLogPriority min_prio = 3;
3618
3619 // If non-empty ignores all log messages whose tag doesn't match one of the
3620 // specified values.
3621 repeated string filter_tags = 4;
3622}
3623
3624// End of protos/perfetto/config/android/android_log_config.proto
3625
3626// Begin of protos/perfetto/config/chrome/chrome_config.proto
3627
3628// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3629// to reflect changes in the corresponding C++ headers.
3630
3631message ChromeConfig {
3632 optional string trace_config = 1;
Siddhartha S305a5012019-03-29 09:33:00 -07003633
3634 // When enabled, the data source should only fill in fields in the output that
3635 // are not potentially privacy sensitive.
3636 optional bool privacy_filtering_enabled = 2;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003637}
3638
3639// End of protos/perfetto/config/chrome/chrome_config.proto
3640
3641// Begin of protos/perfetto/config/data_source_config.proto
3642
3643// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3644// to reflect changes in the corresponding C++ headers.
3645
3646// The configuration that is passed to each data source when starting tracing.
3647message DataSourceConfig {
3648 // Data source unique name, e.g., "linux.ftrace". This must match
3649 // the name passed by the data source when it registers (see
3650 // RegisterDataSource()).
3651 optional string name = 1;
3652
3653 // The index of the logging buffer where TracePacket(s) will be stored.
3654 // This field doesn't make a major difference for the Producer(s). The final
3655 // logging buffers, in fact, are completely owned by the Service. We just ask
3656 // the Producer to copy this number into the chunk headers it emits, so that
3657 // the Service can quickly identify the buffer where to move the chunks into
3658 // without expensive lookups on its fastpath.
3659 optional uint32 target_buffer = 2;
3660
3661 // Set by the service to indicate the duration of the trace.
3662 // DO NOT SET in consumer as this will be overridden by the service.
3663 optional uint32 trace_duration_ms = 3;
3664
Florian Mayerfb879982019-03-29 10:45:32 +00003665 // Set by the service to indicate whether this tracing session has extra
3666 // guardrails.
3667 // DO NOT SET in consumer as this will be overridden by the service.
3668 optional bool enable_extra_guardrails = 6;
3669
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003670 // Set by the service to indicate which tracing session the data source
3671 // belongs to. The intended use case for this is checking if two data sources,
3672 // one of which produces metadata for the other one, belong to the same trace
3673 // session and hence should be linked together.
3674 // This field was introduced in Aug 2018 after Android P.
3675 optional uint64 tracing_session_id = 4;
3676
3677 // Keeep the lower IDs (up to 99) for fields that are *not* specific to
3678 // data-sources and needs to be processed by the traced daemon.
3679
Primiano Tucci0f2f3b42019-05-21 19:37:01 +01003680 // All data source config fields must be marked as [lazy=true]. This prevents
3681 // the proto-to-cpp generator from recursing into those when generating the
3682 // cpp classes and polluting tracing/core with data-source-specific classes.
3683 // Instead they are treated as opaque strings containing raw proto bytes.
3684
3685 optional FtraceConfig ftrace_config = 100 [lazy = true];
3686 optional InodeFileConfig inode_file_config = 102 [lazy = true];
3687 optional ProcessStatsConfig process_stats_config = 103 [lazy = true];
3688 optional SysStatsConfig sys_stats_config = 104 [lazy = true];
3689 optional HeapprofdConfig heapprofd_config = 105 [lazy = true];
3690 optional AndroidPowerConfig android_power_config = 106 [lazy = true];
3691 optional AndroidLogConfig android_log_config = 107 [lazy = true];
Ryan Savitski89bd9222019-06-13 14:39:30 +01003692 optional GpuCounterConfig gpu_counter_config = 108 [lazy = true];
Ryan Savitskifde4ae62019-06-14 16:02:52 +01003693 optional PackagesListConfig packages_list_config = 109 [lazy = true];
Primiano Tucci0f2f3b42019-05-21 19:37:01 +01003694
Primiano Tucci0f9e0222019-06-05 09:36:41 +01003695 // Chrome is special as it doesn't use the perfetto IPC layer. We want to
3696 // avoid proto serialization and de-serialization there because that would
3697 // just add extra hops on top of the Mojo ser/des. Instead we auto-generate a
3698 // C++ class for it so it can pass around plain C++ objets.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003699 optional ChromeConfig chrome_config = 101;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003700
3701 // This is a fallback mechanism to send a free-form text config to the
3702 // producer. In theory this should never be needed. All the code that
3703 // is part of the platform (i.e. traced service) is supposed to *not* truncate
3704 // the trace config proto and propagate unknown fields. However, if anything
3705 // in the pipeline (client or backend) ends up breaking this forward compat
3706 // plan, this field will become the escape hatch to allow future data sources
3707 // to get some meaningful configuration.
3708 optional string legacy_config = 1000;
3709
3710 // This field is only used for testing.
Primiano Tucci0f9e0222019-06-05 09:36:41 +01003711 optional TestConfig for_testing = 1001;
3712
3713 reserved 268435455; // Was |for_testing|. Caused more problems then found.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003714}
3715
3716// End of protos/perfetto/config/data_source_config.proto
3717
3718// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
3719
3720// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3721// to reflect changes in the corresponding C++ headers.
3722
3723message FtraceConfig {
3724 repeated string ftrace_events = 1;
3725 repeated string atrace_categories = 2;
3726 repeated string atrace_apps = 3;
3727 // *Per-CPU* buffer size.
3728 optional uint32 buffer_size_kb = 10;
3729 optional uint32 drain_period_ms = 11;
3730}
3731
3732// End of protos/perfetto/config/ftrace/ftrace_config.proto
3733
3734// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
3735
3736// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3737// to reflect changes in the corresponding C++ headers.
3738
3739message InodeFileConfig {
3740 message MountPointMappingEntry {
3741 optional string mountpoint = 1;
3742 repeated string scan_roots = 2;
3743 }
3744
3745 // How long to pause between batches.
3746 optional uint32 scan_interval_ms = 1;
3747
3748 // How long to wait before the first scan in order to accumulate inodes.
3749 optional uint32 scan_delay_ms = 2;
3750
3751 // How many inodes to scan in one batch.
3752 optional uint32 scan_batch_size = 3;
3753
3754 // Do not scan for inodes not found in the static map.
3755 optional bool do_not_scan = 4;
3756
3757 // If non-empty, only scan inodes corresponding to block devices named in
3758 // this list.
3759 repeated string scan_mount_points = 5;
3760
3761 // When encountering an inode belonging to a block device corresponding
3762 // to one of the mount points in this map, scan its scan_roots instead.
3763 repeated MountPointMappingEntry mount_point_mapping = 6;
3764}
3765
3766// End of protos/perfetto/config/inode_file/inode_file_config.proto
3767
3768// Begin of protos/perfetto/config/power/android_power_config.proto
3769
3770message AndroidPowerConfig {
3771 enum BatteryCounters {
3772 BATTERY_COUNTER_UNSPECIFIED = 0;
3773 BATTERY_COUNTER_CHARGE = 1; // Coulomb counter.
3774 BATTERY_COUNTER_CAPACITY_PERCENT = 2; // Charge (%).
3775 BATTERY_COUNTER_CURRENT = 3; // Instantaneous current.
3776 BATTERY_COUNTER_CURRENT_AVG = 4; // Avg current.
3777 }
3778 optional uint32 battery_poll_ms = 1;
3779 repeated BatteryCounters battery_counters = 2;
3780
3781 // Where available enables per-power-rail measurements.
3782 optional bool collect_power_rails = 3;
3783}
3784
3785// End of protos/perfetto/config/power/android_power_config.proto
3786
3787// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
3788
3789// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3790// to reflect changes in the corresponding C++ headers.
3791
3792message ProcessStatsConfig {
3793 enum Quirks {
3794 QUIRKS_UNSPECIFIED = 0;
3795
3796 // This has been deprecated and ignored as per 2018-05-01. Full scan at
3797 // startup is now disabled by default and can be re-enabled using the
3798 // |scan_all_processes_on_start| arg.
3799 DISABLE_INITIAL_DUMP = 1 [deprecated = true];
3800
3801 DISABLE_ON_DEMAND = 2;
3802 }
3803
3804 repeated Quirks quirks = 1;
3805
3806 // If enabled all processes will be scanned and dumped when the trace starts.
3807 optional bool scan_all_processes_on_start = 2;
3808
3809 // If enabled thread names are also recoded (this is redundant if sched_switch
3810 // is enabled).
3811 optional bool record_thread_names = 3;
3812
3813 // If > 0 samples counters (see process_stats.proto) from
3814 // /proc/pid/status and oom_score_adj every X ms.
3815 // This is required to be > 100ms to avoid excessive CPU usage.
3816 // TODO(primiano): add CPU cost for change this value.
3817 optional uint32 proc_stats_poll_ms = 4;
3818
3819 // If empty samples stats for all processes. If non empty samples stats only
3820 // for processes matching the given string in their argv0 (i.e. the first
3821 // entry of /proc/pid/cmdline).
3822 // TODO(primiano): implement this feature.
3823 // repeated string proc_stats_filter = 5;
Lalit Maganti999355c2019-03-27 18:17:08 +00003824
3825 // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
3826 // (default: |proc_stats_poll_ms|). If = 0, will be set to
3827 // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
3828 // multiple.
3829 optional uint32 proc_stats_cache_ttl_ms = 6;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003830}
3831
3832// End of protos/perfetto/config/process_stats/process_stats_config.proto
3833
3834// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
3835
3836// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3837// to reflect changes in the corresponding C++ headers.
3838
3839// This file defines the configuration for the Linux /proc poller data source,
3840// which injects counters in the trace.
3841// Counters that are needed in the trace must be explicitly listed in the
3842// *_counters fields. This is to avoid spamming the trace with all counters
3843// at all times.
3844// The sampling rate is configurable. All polling rates (*_period_ms) need
3845// to be integer multiples of each other.
3846// OK: [10ms, 10ms, 10ms], [10ms, 20ms, 10ms], [10ms, 20ms, 60ms]
3847// Not OK: [10ms, 10ms, 11ms], [10ms, 15ms, 20ms]
3848message SysStatsConfig {
3849 // Polls /proc/meminfo every X ms, if non-zero.
3850 // This is required to be > 10ms to avoid excessive CPU usage.
3851 // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
3852 optional uint32 meminfo_period_ms = 1;
3853
Primiano Tucci1eb966d2019-06-06 15:40:09 +01003854 // If empty all known counters are reported. Otherwise, only the counters
3855 // specified below are reported.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003856 repeated MeminfoCounters meminfo_counters = 2;
3857
3858 // Polls /proc/vmstat every X ms, if non-zero.
3859 // This is required to be > 10ms to avoid excessive CPU usage.
3860 // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
3861 optional uint32 vmstat_period_ms = 3;
3862 repeated VmstatCounters vmstat_counters = 4;
3863
3864 // Pols /proc/stat every X ms, if non-zero.
3865 // This is required to be > 10ms to avoid excessive CPU usage.
3866 // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
3867 optional uint32 stat_period_ms = 5;
3868 enum StatCounters {
3869 STAT_UNSPECIFIED = 0;
3870 STAT_CPU_TIMES = 1;
3871 STAT_IRQ_COUNTS = 2;
3872 STAT_SOFTIRQ_COUNTS = 3;
3873 STAT_FORK_COUNT = 4;
3874 }
3875 repeated StatCounters stat_counters = 6;
3876}
3877
3878// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
3879
3880// Begin of protos/perfetto/config/test_config.proto
3881
3882// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3883// to reflect changes in the corresponding C++ headers.
3884
3885// The configuration for a fake producer used in tests.
3886message TestConfig {
3887 message DummyFields {
3888 optional uint32 field_uint32 = 1;
3889 optional int32 field_int32 = 2;
3890 optional uint64 field_uint64 = 3;
3891 optional int64 field_int64 = 4;
3892 optional fixed64 field_fixed64 = 5;
3893 optional sfixed64 field_sfixed64 = 6;
3894 optional fixed32 field_fixed32 = 7;
3895 optional sfixed32 field_sfixed32 = 8;
3896 optional double field_double = 9;
3897 optional float field_float = 10;
3898 optional sint64 field_sint64 = 11;
3899 optional sint32 field_sint32 = 12;
3900 optional string field_string = 13;
3901 optional bytes field_bytes = 14;
3902 }
3903
3904 // The number of messages the fake producer should send.
3905 optional uint32 message_count = 1;
3906
3907 // The maximum number of messages which should be sent each second.
3908 // The actual obserced speed may be lower if the producer is unable to
3909 // work fast enough.
3910 // If this is zero or unset, the producer will send as fast as possible.
3911 optional uint32 max_messages_per_second = 2;
3912
3913 // The seed value for a simple multiplicative congruential pseudo-random
3914 // number sequence.
3915 optional uint32 seed = 3;
3916
3917 // The size of each message in bytes. Should be greater than or equal 5 to
3918 // account for the number of bytes needed to encode the random number and a
3919 // null byte for the string.
3920 optional uint32 message_size = 4;
3921
3922 // Whether the producer should send a event batch when the data source is
3923 // is initially registered.
3924 optional bool send_batch_on_register = 5;
3925
3926 optional DummyFields dummy_fields = 6;
3927}
3928
3929// End of protos/perfetto/config/test_config.proto
3930
3931// Begin of protos/perfetto/config/trace_config.proto
3932
Ryan Savitski0b4008a2019-05-13 17:55:53 +01003933// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003934// to reflect changes in the corresponding C++ headers.
3935
3936// The overall config that is used when starting a new tracing session through
3937// ProducerPort::StartTracing().
3938// It contains the general config for the logging buffer(s) and the configs for
3939// all the data source being enabled.
3940//
Ryan Savitski53ca60b2019-06-03 13:04:40 +01003941// Next id: 26.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003942message TraceConfig {
3943 message BufferConfig {
3944 optional uint32 size_kb = 1;
3945
3946 reserved 2; // |page_size|, now deprecated.
3947 reserved 3; // |optimize_for|, now deprecated.
3948
3949 enum FillPolicy {
3950 UNSPECIFIED = 0;
3951
3952 // Default behavior. The buffer operates as a conventional ring buffer.
3953 // If the writer is faster than the reader (or if the reader reads only
3954 // after tracing is stopped) newly written packets will overwrite old
3955 // packets.
3956 RING_BUFFER = 1;
3957
3958 // Behaves like RING_BUFFER as long as there is space in the buffer or
3959 // the reader catches up with the writer. As soon as the writer hits
3960 // an unread chunk, it stops accepting new data in the buffer.
3961 DISCARD = 2;
3962 }
3963 optional FillPolicy fill_policy = 4;
3964 }
3965 repeated BufferConfig buffers = 1;
3966
3967 message DataSource {
3968 // Filters and data-source specific config. It contains also the unique name
3969 // of the data source, the one passed in the DataSourceDescriptor when they
3970 // register on the service.
3971 optional protos.DataSourceConfig config = 1;
3972
3973 // Optional. If multiple producers (~processes) expose the same data source
3974 // and |producer_name_filter| != "", the data source is enabled only for
3975 // producers whose names match any of the producer_name_filter below.
3976 // The |producer_name_filter| has to be an exact match. (TODO(primiano):
3977 // support wildcards or regex).
3978 // This allows to enable a data source only for specific processes.
3979 // The "repeated" field has OR sematics: specifying a filter ["foo", "bar"]
3980 // will enable data source on both "foo" and "bar" (if existent).
3981 repeated string producer_name_filter = 2;
3982 }
3983 repeated DataSource data_sources = 2;
3984
Siddhartha Sb63f61e2019-05-03 16:19:51 -07003985 // Config for builtin trace packets emitted by perfetto like trace stats,
3986 // system info, etc.
3987 message BuiltinDataSource {
3988 // Disable emitting clock timestamps into the trace.
3989 optional bool disable_clock_snapshotting = 1;
3990
3991 optional bool disable_trace_config = 2;
3992
3993 optional bool disable_system_info = 3;
3994 }
3995 optional BuiltinDataSource builtin_data_sources = 20;
3996
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003997 // If specified, the trace will be stopped |duration_ms| after starting.
3998 // However in case of traces with triggers, see
3999 // TriggerConfig.trigger_timeout_ms instead.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004000 optional uint32 duration_ms = 3;
4001
4002 // This is set when --dropbox is passed to the Perfetto command line client
4003 // and enables guardrails that limit resource usage for traces requested
4004 // by statsd.
4005 optional bool enable_extra_guardrails = 4;
4006
4007 enum LockdownModeOperation {
4008 LOCKDOWN_UNCHANGED = 0;
4009 LOCKDOWN_CLEAR = 1;
4010 LOCKDOWN_SET = 2;
4011 }
4012 // Reject producers that are not running under the same UID as the tracing
4013 // service.
4014 optional LockdownModeOperation lockdown_mode = 5;
4015
4016 message ProducerConfig {
4017 // Identifies the producer for which this config is for.
4018 optional string producer_name = 1;
4019
4020 // Specifies the preferred size of the shared memory buffer. If the size is
4021 // larger than the max size, the max will be used. If it is smaller than
4022 // the page size or doesn't fit pages evenly into it, it will fall back to
4023 // the size specified by the producer or finally the default shared memory
4024 // size.
4025 optional uint32 shm_size_kb = 2;
4026
4027 // Specifies the preferred size of each page in the shared memory buffer.
4028 // Must be an integer multiple of 4K.
4029 optional uint32 page_size_kb = 3;
4030 }
4031
4032 repeated ProducerConfig producers = 6;
4033
4034 // Contains statsd-specific metadata about an alert associated with the trace.
4035 message StatsdMetadata {
4036 // The identifier of the alert which triggered this trace.
4037 optional int64 triggering_alert_id = 1;
4038 // The uid which registered the triggering configuration with statsd.
4039 optional int32 triggering_config_uid = 2;
4040 // The identifier of the config which triggered the alert.
4041 optional int64 triggering_config_id = 3;
4042 // The identifier of the subscription which triggered this trace.
4043 optional int64 triggering_subscription_id = 4;
4044 }
4045
4046 // Statsd-specific metadata.
4047 optional StatsdMetadata statsd_metadata = 7;
4048
4049 // When true, the EnableTracing() request must also provide a file descriptor.
4050 // The service will then periodically read packets out of the trace buffer and
4051 // store it into the passed file.
4052 optional bool write_into_file = 8;
4053
4054 // Optional. If non-zero tunes the write period. A min value of 100ms is
4055 // enforced (i.e. smaller values are ignored).
4056 optional uint32 file_write_period_ms = 9;
4057
4058 // Optional. When non zero the periodic write stops once at most X bytes
4059 // have been written into the file. Tracing is disabled when this limit is
4060 // reached, even if |duration_ms| has not been reached yet.
4061 optional uint64 max_file_size_bytes = 10;
4062
4063 // Contains flags which override the default values of the guardrails inside
4064 // Perfetto. These values are only affect userdebug builds.
4065 message GuardrailOverrides {
4066 // Override the default limit (in bytes) for uploading data to server within
4067 // a 24 hour period.
4068 optional uint64 max_upload_per_day_bytes = 1;
4069 }
4070
4071 optional GuardrailOverrides guardrail_overrides = 11;
4072
4073 // When true, data sources are not started until an explicit call to
4074 // StartTracing() on the consumer port. This is to support early
4075 // initialization and fast trace triggering. This can be used only when the
4076 // Consumer explicitly triggers the StartTracing() method.
4077 // This should not be used in a remote trace config via statsd, doing so will
4078 // result in a hung trace session.
4079 optional bool deferred_start = 12;
4080
4081 // When set, it periodically issues a Flush() to all data source, forcing them
4082 // to commit their data into the tracing service. This can be used for
4083 // quasi-real-time streaming mode and to guarantee some partial ordering of
4084 // events in the trace in windows of X ms.
4085 optional uint32 flush_period_ms = 13;
4086
4087 // Wait for this long for producers to acknowledge flush requests.
4088 // Default 5s.
4089 optional uint32 flush_timeout_ms = 14;
4090
Florian Mayer990e6d72019-06-03 11:34:52 +01004091 // Wait for this long for producers to acknowledge stop requests.
4092 // Default 5s.
4093 optional uint32 data_source_stop_timeout_ms = 23;
4094
Siddhartha Sb63f61e2019-05-03 16:19:51 -07004095 reserved 15; // |disable_clock_snapshotting| moved.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004096
4097 // Android-only. If set, sends an intent to the Traceur system app when the
4098 // trace ends to notify it about the trace readiness.
4099 optional bool notify_traceur = 16;
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00004100
4101 // Triggers allow producers to start or stop the tracing session when an event
4102 // occurs.
4103 //
4104 // For example if we are tracing probabilistically, most traces will be
4105 // uninteresting. Triggers allow us to keep only the interesting ones such as
4106 // those traces during which the device temperature reached a certain
4107 // threshold. In this case the producer can activate a trigger to keep
4108 // (STOP_TRACING) the trace, otherwise it can also begin a trace
4109 // (START_TRACING) because it knows something is about to happen.
4110 message TriggerConfig {
4111 enum TriggerMode {
4112 UNSPECIFIED = 0;
4113
4114 // When this mode is chosen, data sources are not started until one of the
4115 // |triggers| are received. This supports early initialization and fast
4116 // starting of the tracing system. On triggering, the session will then
4117 // record for |stop_delay_ms|. However if no trigger is seen
4118 // after |trigger_timeout_ms| the session will be stopped and no data will
4119 // be returned.
4120 START_TRACING = 1;
4121
4122 // When this mode is chosen, the session will be started via the normal
4123 // EnableTracing() & StartTracing(). If no trigger is ever seen
4124 // the session will be stopped after |trigger_timeout_ms| and no data will
4125 // be returned. However if triggered the trace will stop after
4126 // |stop_delay_ms| and any data in the buffer will be returned to the
4127 // consumer.
4128 STOP_TRACING = 2;
4129 }
4130 optional TriggerMode trigger_mode = 1;
4131
4132 message Trigger {
4133 // The producer must specify this name to activate the trigger.
4134 optional string name = 1;
4135
4136 // The a std::regex that will match the producer that can activate this
4137 // trigger. This is optional. If unset any producers can activate this
4138 // trigger.
4139 optional string producer_name_regex = 2;
4140
4141 // After a trigger is received either in START_TRACING or STOP_TRACING
4142 // mode then the trace will end |stop_delay_ms| after triggering.
4143 optional uint32 stop_delay_ms = 3;
4144 }
4145 // A list of triggers which are related to this configuration. If ANY
4146 // trigger is seen then an action will be performed based on |trigger_mode|.
4147 repeated Trigger triggers = 2;
4148
4149 // Required and must be positive if a TriggerConfig is specified. This is
4150 // how long this TraceConfig should wait for a trigger to arrive. After this
4151 // period of time if no trigger is seen the TracingSession will be cleaned
4152 // up.
4153 optional uint32 trigger_timeout_ms = 3;
4154 }
4155 optional TriggerConfig trigger_config = 17;
Stephen Nusko9fa59cb2019-04-15 04:19:16 +01004156
4157 // When this is non-empty the perfetto command line tool will ignore the rest
4158 // of this TraceConfig and instead connect to the perfetto service as a
4159 // producer and send these triggers, potentially stopping or starting traces
4160 // that were previous configured to use a TriggerConfig.
4161 repeated string activate_triggers = 18;
Hector Dearman085dc3c2019-04-23 11:48:10 +01004162
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004163 // Configuration for trace contents that reference earlier trace data. For
4164 // example, a data source might intern strings, and emit packets containing
4165 // {interned id : string} pairs. Future packets from that data source can then
4166 // use the interned ids instead of duplicating the raw string contents. The
4167 // trace parser will then need to use that interning table to fully interpret
4168 // the rest of the trace.
4169 message IncrementalStateConfig {
Ryan Savitski0b4008a2019-05-13 17:55:53 +01004170 // If nonzero, notify eligible data sources to clear their incremental state
4171 // periodically, with the given period. The notification is sent only to
4172 // data sources that have |handles_incremental_state_clear| set in their
4173 // DataSourceDescriptor. The notification requests that the data source
4174 // stops referring to past trace contents. This is particularly useful when
4175 // tracing in ring buffer mode, where it is not exceptional to overwrite old
4176 // trace data.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004177 //
4178 // Warning: this time-based global clearing is likely to be removed in the
Ryan Savitski0b4008a2019-05-13 17:55:53 +01004179 // future, to be replaced with a smarter way of sending the notifications
4180 // only when necessary.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004181 optional uint32 clear_period_ms = 1;
4182 }
4183 optional IncrementalStateConfig incremental_state_config = 21;
4184
Hector Dearman085dc3c2019-04-23 11:48:10 +01004185 // Additional guardrail used by the Perfetto command line client.
4186 // On user builds when --dropbox is set perfetto will refuse to trace unless
4187 // this is also set.
4188 // Added in Q.
4189 optional bool allow_user_build_tracing = 19;
Hector Dearmanfb4d0732019-05-19 15:44:56 +01004190
4191 // If set the tracing service will ensure there is at most one tracing session
4192 // with this key.
4193 optional string unique_session_name = 22;
Hector Dearman554627f2019-06-04 17:58:22 +01004194
4195 // Compress trace with the given method. Best effort.
4196 enum CompressionType {
4197 COMPRESSION_TYPE_UNSPECIFIED = 0;
4198 COMPRESSION_TYPE_DEFLATE = 1;
4199 };
4200 optional CompressionType compression_type = 24;
Ryan Savitski53ca60b2019-06-03 13:04:40 +01004201
4202 // Android-only. Debug builds only. Not for general use. If set, saves a
4203 // Dropbox trace into an incident. This field is read by perfetto_cmd, rather
4204 // than the tracing service. All fields are mandatory.
4205 message IncidentReportConfig {
4206 optional string destination_package = 1;
4207 optional string destination_class = 2;
4208 // Level of filtering in the requested incident. See |Destination| in
4209 // frameworks/base/core/proto/android/privacy.proto.
4210 optional int32 privacy_level = 3;
4211 // If true, do not write the trace into dropbox (i.e. incident only).
4212 // Otherwise, write to both dropbox and incident.
4213 optional bool skip_dropbox = 4;
4214 }
4215 optional IncidentReportConfig incident_report_config = 25;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004216}
4217
4218// End of protos/perfetto/config/trace_config.proto
4219
4220// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
4221
4222// Configuration for go/heapprofd.
4223message HeapprofdConfig {
4224 message ContinuousDumpConfig {
4225 // ms to wait before first dump.
4226 optional uint32 dump_phase_ms = 5;
4227 // ms to wait between following dumps.
4228 optional uint32 dump_interval_ms = 6;
4229 };
4230
4231 // Set to 1 for perfect accuracy.
4232 // Otherwise, sample every sample_interval_bytes on average.
Florian Mayer81df6cb2019-04-15 11:32:13 +01004233 //
4234 // See https://docs.perfetto.dev/#/heapprofd?id=sampling-interval for more
4235 // details.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004236 optional uint64 sampling_interval_bytes = 1;
4237
4238 // E.g. surfaceflinger, com.android.phone
Florian Mayerb524cbb2019-04-05 18:14:35 +01004239 // This input is normalized in the following way: if it contains slashes,
4240 // everything up to the last slash is discarded. If it contains "@",
4241 // everything after the first @ is discared.
4242 // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger.
4243 // This transformation is also applied to the processes' command lines when
4244 // matching.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004245 repeated string process_cmdline = 2;
Florian Mayerb524cbb2019-04-05 18:14:35 +01004246
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004247 // For watermark based triggering or local debugging.
4248 repeated uint64 pid = 4;
Florian Mayera774cb72019-04-29 14:20:43 +01004249
4250 // Profile all processes eligible for profiling on the system.
4251 // See https://docs.perfetto.dev/#/heapprofd?id=target-processes for which
4252 // processes are eligible.
4253 //
4254 // On unmodified userdebug builds, this will lead to system crashes. Zygote
4255 // will crash when trying to launch a new process as it will have an
4256 // unexpected open socket to heapprofd.
4257 //
4258 // heapprofd will likely be overloaded by the amount of data for low
4259 // sampling intervals.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004260 optional bool all = 5;
Florian Mayera774cb72019-04-29 14:20:43 +01004261
Florian Mayer9c6538d2019-03-07 14:32:05 +00004262 // Do not emit function names for mappings starting with this prefix.
4263 // E.g. /system to not emit symbols for any system libraries.
4264 repeated string skip_symbol_prefix = 7;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004265
4266 // Dump once at the end of the trace, emitting the heap dump at maximum
4267 // memory usage.
4268 // optional bool retain_max = 5; // TODO(fmayer): Implement
4269
4270 // Dump at a predefined interval.
4271 optional ContinuousDumpConfig continuous_dump_config = 6;
Florian Mayer92e8bf92019-03-28 13:44:45 +00004272
4273 // Size of the shared memory buffer between the profiled processes and
4274 // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500
4275 // MiB.
Florian Mayer91b3c6d2019-04-10 13:44:37 -07004276 //
4277 // Needs to be:
4278 // * at least 8192,
4279 // * a power of two,
4280 // * a multiple of 4096.
Florian Mayer92e8bf92019-03-28 13:44:45 +00004281 optional uint64 shmem_size_bytes = 8;
Florian Mayerd6bdb6f2019-05-03 17:53:58 +01004282
4283 // When the shmem buffer is full, block the client instead of ending the
4284 // trace. Use with caution as this will significantly slow down the target
4285 // process.
4286 optional bool block_client = 9;
Florian Mayer225559a2019-05-09 14:28:26 +01004287
4288 // Do not profile processes from startup, only match already running
4289 // processes.
4290 //
4291 // Can not be set at the same time as no_running.
4292 optional bool no_startup = 10;
4293
4294 // Do not profile running processes. Only match processes on startup.
4295 //
4296 // Can not be set at the same time as no_startup.
4297 optional bool no_running = 11;
Florian Mayer7142c7c2019-05-20 18:11:41 +01004298
4299 // Gather information on how many bytes of allocations are on non-referenced
4300 // pages. The way to use this generally is:
4301 // 1. Start profile of app.
4302 // 2. Start app.
4303 // 3. echo 1 > /proc/$APP_PID/clear_refs.
4304 // 4. Do operations.
4305 // 5. End profile.
4306 //
4307 // You can then find the allocations that were not used for the operations you
4308 // did in step 4.
4309 optional bool idle_allocations = 12;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004310}
4311
4312// End of protos/perfetto/config/profiling/heapprofd_config.proto
Ryan Savitski89bd9222019-06-13 14:39:30 +01004313
4314// Begin of protos/perfetto/config/gpu/gpu_counter_config.proto
4315
4316// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
4317// to reflect changes in the corresponding C++ headers.
4318
4319message GpuCounterConfig {
4320 // Desired sampling interval for counters.
4321 optional uint64 counter_period_ns = 1;
4322
4323 // List of counters to be sampled. Counter IDs correspond to the ones
4324 // described in GpuCounterSpec in the data source descriptor.
4325 repeated uint32 counter_ids = 2;
4326}
4327
4328// End of protos/perfetto/config/gpu/gpu_counter_config.proto
Ryan Savitskifde4ae62019-06-14 16:02:52 +01004329
4330// Begin of protos/perfetto/config/android/packages_list_config.proto
4331
4332// Data source that lists details (such as version code) about packages on an
4333// Android device.
4334message PackagesListConfig {
4335 // If not empty, emit info about only the following list of package names
4336 // (exact match, no regex). Otherwise, emit info about all packages.
4337 repeated string package_name_filter = 1;
4338}
4339
4340// End of protos/perfetto/config/android/packages_list_config.proto