blob: 6ef12a6ad229ed38e5d4541b67ea0e2234cc516b [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.
2746 optional uint64 offset = 3;
2747 optional uint64 start = 4;
2748 optional uint64 end = 5;
2749 optional uint64 load_bias = 6;
2750 // E.g. ["system", "lib64", "libc.so"]
2751 repeated uint64 path_string_ids = 7; // id of string.
2752}
2753
2754message Frame {
Florian Mayerd0ee6322019-06-07 12:15:48 +01002755 optional uint64 iid = 1; // Interning key
Florian Mayer93d16ec2019-06-05 09:51:58 +01002756 // E.g. "fopen"
2757 optional uint64 function_name_id = 2; // id of string.
2758 optional uint64 mapping_id = 3;
2759 optional uint64 rel_pc = 4;
2760}
2761
2762message Callstack {
Florian Mayerd0ee6322019-06-07 12:15:48 +01002763 optional uint64 iid = 1;
Florian Mayer93d16ec2019-06-05 09:51:58 +01002764 // Frames of this callstack. Bottom frame first.
2765 repeated uint64 frame_ids = 2;
2766}
2767
2768// End of protos/perfetto/trace/profiling/profile_common.proto
2769
Hector Dearman685f7522019-03-12 14:28:56 +00002770// Begin of protos/perfetto/trace/profiling/profile_packet.proto
2771
2772message ProfilePacket {
Florian Mayer5716fc12019-06-24 11:50:51 -07002773 // The following interning tables are only used in Android version Q.
2774 // In newer versions, these tables are in InternedData
2775 // (see protos/perfetto/trace/interned_data) and are shared across
2776 // multiple ProfilePackets.
2777 // For backwards compatibility, consumers need to first look up interned
2778 // data in the tables within the ProfilePacket, and then, if they are empty,
2779 // look up in the InternedData instead.
Hector Dearman685f7522019-03-12 14:28:56 +00002780 repeated InternedString strings = 1;
Florian Mayerdc642fa2019-04-16 20:20:12 +01002781 repeated Mapping mappings = 4;
Hector Dearman685f7522019-03-12 14:28:56 +00002782 repeated Frame frames = 2;
Hector Dearman685f7522019-03-12 14:28:56 +00002783 repeated Callstack callstacks = 3;
Hector Dearman685f7522019-03-12 14:28:56 +00002784
Hector Dearman685f7522019-03-12 14:28:56 +00002785 message HeapSample {
2786 optional uint64 callstack_id = 1;
Florian Mayer78760f22019-05-15 18:05:53 +01002787 // bytes allocated at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002788 optional uint64 self_allocated = 2;
Florian Mayer78760f22019-05-15 18:05:53 +01002789 // bytes allocated at this callstack that have been freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002790 optional uint64 self_freed = 3;
Florian Mayer7142c7c2019-05-20 18:11:41 +01002791 // bytes allocated at this callstack but not used since the last
2792 // clear_refs.
2793 // See documentation of idle_allocations in HeapprofdConfig for more
2794 // details.
2795 optional uint64 self_idle = 7;
Hector Dearman685f7522019-03-12 14:28:56 +00002796 optional uint64 timestamp = 4; // timestamp [opt]
Florian Mayer78760f22019-05-15 18:05:53 +01002797 // Number of allocations that were sampled at this callstack.
Hector Dearman685f7522019-03-12 14:28:56 +00002798 optional uint64 alloc_count = 5;
Florian Mayer78760f22019-05-15 18:05:53 +01002799 // Number of allocations that were sampled at this callstack that have been
2800 // freed.
Hector Dearman685f7522019-03-12 14:28:56 +00002801 optional uint64 free_count = 6;
2802 }
2803
Florian Mayer096bbe32019-04-03 12:10:53 +01002804 message Histogram {
2805 message Bucket {
2806 // This bucket counts values from the previous bucket's (or -infinity if
2807 // this is the first bucket) upper_limit (inclusive) to this upper_limit
2808 // (exclusive).
2809 optional uint64 upper_limit = 1;
2810 // This is the highest bucket. This is set instead of the upper_limit. Any
2811 // values larger or equal to the previous bucket's upper_limit are counted
2812 // in this bucket.
2813 optional bool max_bucket = 2;
2814 // Number of values that fall into this range.
2815 optional uint64 count = 3;
2816 }
2817 repeated Bucket buckets = 1;
2818 }
Florian Mayerdc642fa2019-04-16 20:20:12 +01002819
Florian Mayerdba63f72019-03-27 10:20:46 +00002820 message ProcessStats {
2821 optional uint64 unwinding_errors = 1;
2822 optional uint64 heap_samples = 2;
2823 optional uint64 map_reparses = 3;
Florian Mayer096bbe32019-04-03 12:10:53 +01002824 optional Histogram unwinding_time_us = 4;
Florian Mayer9fe278d2019-04-04 19:20:41 +01002825 optional uint64 total_unwinding_time_us = 5;
Florian Mayerdba63f72019-03-27 10:20:46 +00002826 }
Florian Mayerd0335fe2019-03-27 10:20:22 +00002827
Florian Mayerdc642fa2019-04-16 20:20:12 +01002828 repeated ProcessHeapSamples process_dumps = 5;
Hector Dearman685f7522019-03-12 14:28:56 +00002829 message ProcessHeapSamples {
2830 optional uint64 pid = 1;
Florian Mayerd0335fe2019-03-27 10:20:22 +00002831
2832 // This process was profiled from startup.
2833 // If false, this process was already running when profiling started.
2834 optional bool from_startup = 3;
2835
2836 // This process was not profiled because a concurrent session was active.
2837 // If this is true, samples will be empty.
2838 optional bool rejected_concurrent = 4;
Florian Mayer22e08dc2019-03-28 11:36:02 +00002839
2840 // This process disconnected while it was profiled.
2841 // If false, the process outlived the profiling session.
2842 optional bool disconnected = 6;
2843
Florian Mayerf6680532019-04-10 17:39:31 +01002844 // If disconnected, this disconnect was caused by the client overrunning
2845 // the buffer.
2846 optional bool buffer_overran = 7;
2847
Florian Mayere32b4fd2019-04-15 14:37:52 +01002848 // If disconnected, this disconnected was caused by the shared memory
2849 // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT
2850 // MEMORY CORRUPTION.
2851 optional bool buffer_corrupted = 8;
2852
Florian Mayer5bd65f42019-05-02 16:20:38 +01002853 // Timestamp of the state of the target process that this dump represents.
2854 // This can be different to the timestamp of the TracePackets for various
2855 // reasons:
2856 // * If disconnected is set above, this is the timestamp of last state
2857 // heapprofd had of the process before it disconnected.
2858 // * Otherwise, if the rate of events produced by the process is high,
2859 // heapprofd might be behind.
2860 //
2861 // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock
2862 // to have a type enum that we can reuse here.
2863 optional uint64 timestamp = 9;
2864
Florian Mayerd0335fe2019-03-27 10:20:22 +00002865 optional ProcessStats stats = 5;
2866
Hector Dearman685f7522019-03-12 14:28:56 +00002867 repeated HeapSample samples = 2;
2868 }
2869
2870 optional bool continued = 6;
2871 optional uint64 index = 7;
2872}
2873
Oystein Eftevaagcba56412019-06-13 10:32:01 -07002874// Message used to represent individual stack samples sampled at discrete
2875// points in time, rather than aggregated over an interval.
2876message StreamingProfilePacket {
2877 repeated uint64 callstack_iid = 1; // Index into InternedData.callstacks
2878 repeated int64 timestamp_delta_us = 2;
2879}
2880
Hector Dearman685f7522019-03-12 14:28:56 +00002881// End of protos/perfetto/trace/profiling/profile_packet.proto
2882
Hector Dearmane92c6742018-11-22 21:42:39 +00002883// Begin of protos/perfetto/trace/ps/process_stats.proto
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002884
Hector Dearmane92c6742018-11-22 21:42:39 +00002885// Per-process periodically sampled stats. These samples are wrapped in a
2886// dedicated message (as opposite to be fields in process_tree.proto) because
2887// they are dumped at a different rate than cmdline and thread list.
Lalit Maganti999355c2019-03-27 18:17:08 +00002888// Note: not all of these stats will be present in every ProcessStats message
2889// and sometimes processes may be missing . This is because counters are
2890// cached to reduce emission of counters which do not change.
Hector Dearmane92c6742018-11-22 21:42:39 +00002891message ProcessStats {
Lalit Maganti6820abc2019-01-21 11:12:23 +00002892 message Process {
Hector Dearmane92c6742018-11-22 21:42:39 +00002893 optional int32 pid = 1;
Lalit Maganti6820abc2019-01-21 11:12:23 +00002894
2895 // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
Hector Dearmane92c6742018-11-22 21:42:39 +00002896 optional uint64 vm_size_kb = 2;
2897 optional uint64 vm_rss_kb = 3;
2898 optional uint64 rss_anon_kb = 4;
2899 optional uint64 rss_file_kb = 5;
2900 optional uint64 rss_shmem_kb = 6;
2901 optional uint64 vm_swap_kb = 7;
2902 optional uint64 vm_locked_kb = 8;
2903 optional uint64 vm_hwm_kb = 9;
2904 // When adding a new field remember to update kProcMemCounterSize in
2905 // the trace processor.
Lalit Maganti6820abc2019-01-21 11:12:23 +00002906
2907 optional int64 oom_score_adj = 10;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002908 }
Lalit Maganti6820abc2019-01-21 11:12:23 +00002909 repeated Process processes = 1;
Daniel Colascione4fe75a52019-05-30 12:39:12 -07002910
2911 // The time at which we finish collecting this batch of samples;
2912 // the top-level packet timestamp is the time at which
2913 // we begin collection.
2914 // TODO(dancol): analysis might be improved by
2915 // time-bracketing each sample as well as the whole
2916 // ProcessStats, but doing that is probably gated on
2917 // a vdso for CLOCK_BOOTTIME.
2918 optional uint64 collection_end_timestamp = 2;
Isabelle Taylor98e560d2018-11-22 11:59:12 +00002919}
2920
Hector Dearmane92c6742018-11-22 21:42:39 +00002921// End of protos/perfetto/trace/ps/process_stats.proto
2922
2923// Begin of protos/perfetto/trace/ps/process_tree.proto
2924
2925message ProcessTree {
2926 // Representation of a thread.
2927 message Thread {
2928 // The thread id (as per gettid())
2929 optional int32 tid = 1;
2930
2931 // Thread group id (i.e. the PID of the process, == TID of the main thread)
2932 optional int32 tgid = 3;
2933
2934 // The name of the thread.
2935 optional string name = 2;
2936 }
2937
2938 // Representation of a process.
2939 message Process {
2940 // The UNIX process ID, aka thread group ID (as per getpid()).
2941 optional int32 pid = 1;
2942
2943 // The parent process ID, as per getppid().
2944 optional int32 ppid = 2;
2945
2946 // The command line for the process, as per /proc/pid/cmdline.
2947 // If it is a kernel thread there will only be one cmdline field
2948 // and it will contain /proc/pid/comm.
2949 repeated string cmdline = 3;
2950
2951 // No longer used as of Apr 2018, when the dedicated |threads| field was
2952 // introduced in ProcessTree.
2953 repeated Thread threads_deprecated = 4 [deprecated = true];
2954 }
2955
2956 // List of processes and threads in the client. These lists are incremental
2957 // and not exhaustive. A process and its threads might show up separately in
2958 // different ProcessTree messages. A thread might event not show up at all, if
2959 // no sched_switch activity was detected, for instance:
2960 // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
2961 // #1 { threads: [{pid: 12, tgid: 10}] }
2962 // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
2963 repeated Process processes = 1;
2964 repeated Thread threads = 2;
Daniel Colascione4fe75a52019-05-30 12:39:12 -07002965
2966 // The time at which we finish collecting this process tree;
2967 // the top-level packet timestamp is the time at which
2968 // we begin collection.
2969 optional uint64 collection_end_timestamp = 3;
Hector Dearmane92c6742018-11-22 21:42:39 +00002970}
2971
2972// End of protos/perfetto/trace/ps/process_tree.proto
2973
2974// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
2975
2976// Various Linux system stat counters from /proc.
2977// The fields in this message can be reported at different rates and with
2978// different granularity. See sys_stats_config.proto.
2979message SysStats {
2980 // Counters from /proc/meminfo. Values are in KB.
2981 message MeminfoValue {
2982 optional MeminfoCounters key = 1;
2983 optional uint64 value = 2;
2984 };
2985 repeated MeminfoValue meminfo = 1;
2986
2987 // Counter from /proc/vmstat. Units are often pages, not KB.
2988 message VmstatValue {
2989 optional VmstatCounters key = 1;
2990 optional uint64 value = 2;
2991 };
2992 repeated VmstatValue vmstat = 2;
2993
2994 // Times in each mode, since boot. Unit: nanoseconds.
2995 message CpuTimes {
2996 optional uint32 cpu_id = 1;
2997 optional uint64 user_ns = 2; // Time spent in user mode.
2998 optional uint64 user_ice_ns = 3; // Time spent in user mode (low prio).
2999 optional uint64 system_mode_ns = 4; // Time spent in system mode.
3000 optional uint64 idle_ns = 5; // Time spent in the idle task.
3001 optional uint64 io_wait_ns = 6; // Time spent waiting for I/O.
3002 optional uint64 irq_ns = 7; // Time spent servicing interrupts.
3003 optional uint64 softirq_ns = 8; // Time spent servicing softirqs.
3004 }
3005 repeated CpuTimes cpu_stat = 3; // One entry per cpu.
3006
3007 // Num processes forked since boot.
3008 // Populated only if FORK_COUNT in config.stat_counters.
3009 optional uint64 num_forks = 4;
3010
3011 message InterruptCount {
3012 optional int32 irq = 1;
3013 optional uint64 count = 2;
3014 }
3015
3016 // Number of interrupts, broken by IRQ number.
3017 // Populated only if IRQ_COUNTS in config.stat_counters.
3018 optional uint64 num_irq_total = 5; // Total num of irqs serviced since boot.
3019 repeated InterruptCount num_irq = 6;
3020
3021 // Number of softirqs, broken by softirq number.
3022 // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
3023 optional uint64 num_softirq_total = 7; // Total num of softirqs since boot.
3024 repeated InterruptCount num_softirq = 8; // Per-softirq count.
Daniel Colascione4fe75a52019-05-30 12:39:12 -07003025
3026 // The time at which we finish collecting this set of samples;
3027 // the top-level packet timestamp is the time at which
3028 // we begin collection.
3029 optional uint64 collection_end_timestamp = 9;
Hector Dearmane92c6742018-11-22 21:42:39 +00003030}
3031
3032// End of protos/perfetto/trace/sys_stats/sys_stats.proto
3033
Hector Dearman685f7522019-03-12 14:28:56 +00003034// Begin of protos/perfetto/trace/system_info.proto
3035
3036message Utsname {
3037 optional string sysname = 1;
3038 optional string version = 2;
3039 optional string release = 3;
3040 optional string machine = 4;
3041}
3042
3043message SystemInfo {
3044 optional Utsname utsname = 1;
3045}
3046
3047// End of protos/perfetto/trace/system_info.proto
3048
Hector Dearmane92c6742018-11-22 21:42:39 +00003049// Begin of protos/perfetto/trace/trace.proto
3050
3051message Trace {
3052 repeated TracePacket packet = 1;
3053
3054 // Do NOT add any other field here. This is just a convenience wrapper for
3055 // the use case of a trace being saved to a file. There are other cases
3056 // (streaming) where TracePacket are directly streamed without being wrapped
3057 // in a Trace proto. Nothing should ever rely on the full trace, all the
3058 // logic should be based on TracePacket(s).
3059}
3060
3061// End of protos/perfetto/trace/trace.proto
3062
3063// Begin of protos/perfetto/trace/trace_packet.proto
3064
3065// The root object emitted by Perfetto. A perfetto trace is just a stream of
3066// TracePacket(s).
3067//
Eric Secklerc73ef062019-02-25 12:30:35 +00003068// Next reserved id: 13 (up to 15).
Siddhartha S06add2b2019-06-20 02:58:50 -07003069// Next id: 56.
Hector Dearmane92c6742018-11-22 21:42:39 +00003070message TracePacket {
Lalit Maganti64bcc242018-12-05 13:35:08 +00003071 // TODO(primiano): in future we should add a timestamp_clock_domain field to
Hector Dearmane92c6742018-11-22 21:42:39 +00003072 // allow mixing timestamps from different clock domains.
3073 optional uint64 timestamp = 8; // Timestamp [ns].
3074
3075 oneof data {
3076 FtraceEventBundle ftrace_events = 1;
3077 ProcessTree process_tree = 2;
3078 ProcessStats process_stats = 9;
3079 InodeFileMap inode_file_map = 4;
3080 // removed field with id 5
3081 ClockSnapshot clock_snapshot = 6;
3082 SysStats sys_stats = 7;
Eric Secklerc73ef062019-02-25 12:30:35 +00003083 TrackEvent track_event = 11;
Hector Dearmane92c6742018-11-22 21:42:39 +00003084
Eric Secklerc73ef062019-02-25 12:30:35 +00003085 // IDs up to 15 are reserved. They take only one byte to encode their
3086 // preamble so should be used for freqeuent events.
Hector Dearmane92c6742018-11-22 21:42:39 +00003087
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003088 TraceConfig trace_config = 33;
Hector Dearmane92c6742018-11-22 21:42:39 +00003089 FtraceStats ftrace_stats = 34;
Ryan Savitski41ce4592019-05-02 14:43:59 +01003090 TraceStats trace_stats = 35;
Florian Mayer84113672019-01-21 14:48:27 +00003091 ProfilePacket profile_packet = 37;
Primiano Tuccib86e9ca2018-12-03 20:20:11 +01003092 BatteryCounters battery = 38;
Esteban Talavera7714cec2019-01-31 15:53:34 +00003093 PowerRails power_rails = 40;
Primiano Tucci64df2ca2019-01-03 22:26:47 +00003094 AndroidLogPacket android_log = 39;
Hector Dearman685f7522019-03-12 14:28:56 +00003095 SystemInfo system_info = 45;
Stephen Nusko70ea3302019-04-01 19:44:40 +01003096 Trigger trigger = 46;
Florian Mayer12f0f8e2019-04-02 12:31:13 +01003097 PackagesList packages_list = 47;
Mikhail Khokhlov5b60af52019-05-15 10:09:34 +01003098 ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
Primiano Tuccib02d8dc2019-06-04 11:46:43 +01003099 PerfettoMetatrace perfetto_metatrace = 49;
Siddhartha S1239fb32019-06-06 11:17:13 -07003100 ChromeMetadataPacket chrome_metadata = 51;
Ryan Savitski89bd9222019-06-13 14:39:30 +01003101 GpuCounterEvent gpu_counter_event = 52;
3102 GpuRenderStageEvent gpu_render_stage_event = 53;
Oystein Eftevaagcba56412019-06-13 10:32:01 -07003103 StreamingProfilePacket streaming_profile_packet = 54;
Hector Dearmane92c6742018-11-22 21:42:39 +00003104
Siddhartha S06add2b2019-06-20 02:58:50 -07003105 // Only used in profile packets.
3106 ProfiledFrameSymbols profiled_frame_symbols = 55;
3107
Eric Secklerc73ef062019-02-25 12:30:35 +00003108 // Only used by TrackEvent.
3109 ProcessDescriptor process_descriptor = 43;
3110 ThreadDescriptor thread_descriptor = 44;
3111
Hector Dearmane92c6742018-11-22 21:42:39 +00003112 // This field is emitted at periodic intervals (~10s) and
3113 // contains always the binary representation of the UUID
3114 // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
3115 // efficiently partition long traces without having to fully parse them.
3116 bytes synchronization_marker = 36;
3117
Hector Dearman554627f2019-06-04 17:58:22 +01003118 // Zero or more proto encoded trace packets compressed using deflate.
3119 // Each compressed_packets TracePacket (including the two field ids and
3120 // sizes) should be less than 512KB.
3121 bytes compressed_packets = 50;
3122
Hector Dearmane92c6742018-11-22 21:42:39 +00003123 // This field is only used for testing.
Hector Dearman248241e2019-05-10 18:28:45 +01003124 // In previous versions of this proto this field had the id 268435455
3125 // This caused many problems:
3126 // - protozero decoder does not handle field ids larger than 999.
3127 // - old versions of protoc produce Java bindings with syntax errors when
3128 // the field id is large enough.
3129 // removed field with id 900
Hector Dearmane92c6742018-11-22 21:42:39 +00003130 }
3131
3132 // Trusted user id of the producer which generated this packet. Keep in sync
3133 // with TrustedPacket.trusted_uid.
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00003134 //
3135 // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
3136 // instead.
Hector Dearmane92c6742018-11-22 21:42:39 +00003137 oneof optional_trusted_uid { int32 trusted_uid = 3; };
Eric Secklerd0ac7ca2019-02-06 09:13:45 +00003138
3139 // Service-assigned identifier of the packet sequence this packet belongs to.
3140 // Uniquely identifies a producer + writer pair within the tracing session. A
3141 // value of zero denotes an invalid ID. Keep in sync with
3142 // TrustedPacket.trusted_packet_sequence_id.
3143 oneof optional_trusted_packet_sequence_id {
3144 uint32 trusted_packet_sequence_id = 10;
3145 }
Eric Secklerc73ef062019-02-25 12:30:35 +00003146
3147 // Incrementally emitted interned data, valid only on the packet's sequence
3148 // (packets with the same |trusted_packet_sequence_id|). The writer will
3149 // usually emit new interned data in the same TracePacket that first refers to
3150 // it (since the last reset of interning state). It may also be emitted
3151 // proactively in advance of referring to them in later packets.
3152 optional InternedData interned_data = 12;
3153
3154 // Set to true by the writer to indicate that it will re-emit any incremental
3155 // data for the packet's sequence before referring to it again. This includes
3156 // interned data as well as periodically emitted data like
3157 // Process/ThreadDescriptors. This flag only affects the current packet
3158 // sequence (see |trusted_packet_sequence_id|).
3159 //
3160 // When set to true, this TracePacket and subsequent TracePackets on the same
3161 // sequence will not refer to any incremental data emitted before this
3162 // TracePacket. For example, previously emitted interned data will be
3163 // re-emitted if it is referred to again.
3164 //
3165 // When the reader detects packet loss (|previous_packet_dropped|), it needs
3166 // to skip packets in the sequence until the next one with this flag set, to
3167 // ensure intact incremental data.
3168 optional bool incremental_state_cleared = 41;
3169
Ryan Savitskia9097812019-03-26 16:13:25 +00003170 // Flag set by the service if, for the current packet sequence (see
3171 // |trusted_packet_sequence_id|), either:
3172 // * this is the first packet, or
3173 // * one or multiple packets were dropped since the last packet that the
3174 // consumer read from the sequence. This can happen if chunks in the trace
3175 // buffer are overridden before the consumer could read them when the trace
3176 // is configured in ring buffer mode.
Eric Secklerc73ef062019-02-25 12:30:35 +00003177 //
3178 // When packet loss occurs, incrementally emitted data (including interned
3179 // data) on the sequence should be considered invalid up until the next packet
Ryan Savitskia9097812019-03-26 16:13:25 +00003180 // with |incremental_state_cleared| set.
Eric Secklerc73ef062019-02-25 12:30:35 +00003181 optional bool previous_packet_dropped = 42;
Hector Dearmane92c6742018-11-22 21:42:39 +00003182}
3183
3184// End of protos/perfetto/trace/trace_packet.proto
Florian Mayer84113672019-01-21 14:48:27 +00003185
Eric Secklerc73ef062019-02-25 12:30:35 +00003186// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
3187
3188// Key/value annotations provided in untyped TRACE_EVENT macros. These
3189// annotations are intended for debug use and are not considered a stable API
3190// surface. As such, they should not be relied upon to implement (new) metrics.
3191message DebugAnnotation {
3192 message NestedValue {
3193 enum NestedType {
3194 UNSPECIFIED = 0; // leaf value.
3195 DICT = 1;
3196 ARRAY = 2;
3197 }
3198 optional NestedType nested_type = 1;
3199
3200 repeated string dict_keys = 2;
3201 repeated NestedValue dict_values = 3;
3202 repeated NestedValue array_values = 4;
3203 optional int64 int_value = 5;
3204 optional double double_value = 6;
3205 optional bool bool_value = 7;
3206 optional string string_value = 8;
3207 }
3208
Florian Mayer5716fc12019-06-24 11:50:51 -07003209 optional uint64 name_iid = 1; // interned DebugAnnotationName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003210
3211 oneof value {
3212 bool bool_value = 2;
3213 uint64 uint_value = 3;
3214 int64 int_value = 4;
3215 double double_value = 5;
3216 string string_value = 6;
3217 // Pointers are stored in a separate type as the JSON output treats them
3218 // differently from other uint64 values.
3219 uint64 pointer_value = 7;
3220 NestedValue nested_value = 8;
3221
3222 // Legacy instrumentation may not support conversion of nested data to
3223 // NestedValue yet.
3224 string legacy_json_value = 9;
3225 }
3226}
3227
3228// --------------------
3229// Interned data types:
3230// --------------------
3231
3232message DebugAnnotationName {
Florian Mayer5716fc12019-06-24 11:50:51 -07003233 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003234 optional string name = 2;
3235}
3236
3237// End of protos/perfetto/trace/track_event/debug_annotation.proto
3238
3239// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
3240
3241// Process-wide data that is periodically emitted by one thread per process.
3242// Valid for all events in packet sequences emitted by the same process.
3243//
3244// Next id: 5.
3245message ProcessDescriptor {
3246 optional int32 pid = 1;
3247 repeated string cmdline = 2;
3248
3249 // To support old UI. New UI should determine default sorting by process_type.
3250 optional int32 legacy_sort_index = 3;
3251
3252 // See chromium's content::ProcessType.
3253 enum ChromeProcessType {
Eric Seckler59945762019-03-04 11:48:25 +00003254 PROCESS_UNSPECIFIED = 0;
3255 PROCESS_BROWSER = 1;
3256 PROCESS_RENDERER = 2;
3257 PROCESS_UTILITY = 3;
3258 PROCESS_ZYGOTE = 4;
3259 PROCESS_SANDBOX_HELPER = 5;
3260 PROCESS_GPU = 6;
3261 PROCESS_PPAPI_PLUGIN = 7;
3262 PROCESS_PPAPI_BROKER = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00003263 }
3264 optional ChromeProcessType chrome_process_type = 4;
Oystein Eftevaagcba56412019-06-13 10:32:01 -07003265 optional int32 process_priority = 5;
Eric Secklerc73ef062019-02-25 12:30:35 +00003266}
3267
3268// End of protos/perfetto/trace/track_event/process_descriptor.proto
3269
3270// Begin of protos/perfetto/trace/track_event/task_execution.proto
3271
3272// TrackEvent arguments describing the execution of a task.
3273message TaskExecution {
3274 // Source location that the task was posted from.
Florian Mayer5716fc12019-06-24 11:50:51 -07003275 optional uint64 posted_from_iid = 1; // interned SourceLocation.
Eric Secklerc73ef062019-02-25 12:30:35 +00003276}
3277
3278// --------------------
3279// Interned data types:
3280// --------------------
3281
3282message SourceLocation {
Florian Mayer5716fc12019-06-24 11:50:51 -07003283 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003284
3285 // We intend to add a binary symbol version of this in the future.
3286 optional string file_name = 2;
3287 optional string function_name = 3;
3288}
3289
3290// End of protos/perfetto/trace/track_event/task_execution.proto
3291
3292// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
3293
3294// Periodically emitted data that's common to all events emitted by the same
3295// thread, i.e. all events in the same packet sequence. Valid for all subsequent
3296// events in the same sequence.
3297//
Eric Seckler1fe18c92019-05-30 10:27:54 +01003298// Next id: 9.
Eric Secklerc73ef062019-02-25 12:30:35 +00003299message ThreadDescriptor {
3300 optional int32 pid = 1;
3301 optional int32 tid = 2;
3302
3303 // To support old UI. New UI should determine default sorting by thread_type.
3304 optional int32 legacy_sort_index = 3;
3305
3306 enum ChromeThreadType {
Siddhartha Sd892f882019-06-03 11:48:42 -07003307 CHROME_THREAD_UNSPECIFIED = 0;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003308
Siddhartha Sd892f882019-06-03 11:48:42 -07003309 CHROME_THREAD_MAIN = 1;
3310 CHROME_THREAD_IO = 2;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003311
3312 // Scheduler:
Siddhartha Sd892f882019-06-03 11:48:42 -07003313 CHROME_THREAD_POOL_BG_WORKER = 3;
3314 CHROME_THREAD_POOL_FG_WORKER = 4;
3315 CHROME_THREAD_POOL_FB_BLOCKING = 5;
3316 CHROME_THREAD_POOL_BG_BLOCKING = 6;
3317 CHROME_THREAD_POOL_SERVICE = 7;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003318
3319 // Compositor:
Siddhartha Sd892f882019-06-03 11:48:42 -07003320 CHROME_THREAD_COMPOSITOR = 8;
3321 CHROME_THREAD_VIZ_COMPOSITOR = 9;
3322 CHROME_THREAD_COMPOSITOR_WORKER = 10;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003323
3324 // Renderer:
Siddhartha Sd892f882019-06-03 11:48:42 -07003325 CHROME_THREAD_SERVICE_WORKER = 11;
Siddhartha S1e2582a2019-05-31 14:08:07 -07003326
3327 // Tracing related threads:
Siddhartha Sd892f882019-06-03 11:48:42 -07003328 CHROME_THREAD_MEMORY_INFRA = 50;
3329 CHROME_THREAD_SAMPLING_PROFILER = 51;
Eric Secklerc73ef062019-02-25 12:30:35 +00003330 };
Eric Seckler14167852019-03-26 09:20:09 +00003331 optional ChromeThreadType chrome_thread_type = 4;
Eric Secklerc73ef062019-02-25 12:30:35 +00003332
3333 // TODO(eseckler): Replace this with ChromeThreadType where possible.
3334 optional string thread_name = 5;
3335
3336 // Absolute reference values. Clock values in subsequent TrackEvents can be
3337 // encoded accumulatively and relative to these. This reduces their var-int
3338 // encoding size.
3339 optional int64 reference_timestamp_us = 6;
3340 optional int64 reference_thread_time_us = 7;
Eric Seckler1fe18c92019-05-30 10:27:54 +01003341 optional int64 reference_thread_instruction_count = 8;
Eric Secklerc73ef062019-02-25 12:30:35 +00003342}
3343
3344// End of protos/perfetto/trace/track_event/thread_descriptor.proto
3345
3346// Begin of protos/perfetto/trace/track_event/track_event.proto
3347
3348// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
3349// which describe activity on a track, such as a thread, task sequence, or
3350// asynchronous track.
3351//
3352// This message is optimized for writing and makes heavy use of data interning
3353// and delta encoding (e.g. of timestamps) to reduce data repetition and encoded
3354// data size.
3355//
3356// A TrackEvent exists in the context of its packet sequence (TracePackets
3357// emitted by the same producer + writer) and refers to data in preceding
3358// TracePackets emitted on the same sequence, both directly and indirectly. For
3359// example, interned data entries are emitted as part of a TracePacket and
3360// directly referred to from TrackEvents by their interning IDs. Attributes
3361// shared by all events on the same sequence (e.g. their thread and process
3362// association) are emitted as part of ProcessDescriptor and ThreadDescriptor
3363// messages in separate TracePackets instead.
3364//
Eric Seckler1fe18c92019-05-30 10:27:54 +01003365// Next reserved id: 8 (up to 15).
Andrew Comminos195e9352019-05-14 16:56:47 -07003366// Next id: 21.
Eric Secklerc73ef062019-02-25 12:30:35 +00003367message TrackEvent {
3368 // Timestamp in microseconds (usually CLOCK_MONOTONIC).
3369 oneof timestamp {
3370 // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
3371 // calculate the absolute timestamp value, sum up all delta values of the
3372 // preceding TrackEvents since the last ThreadDescriptor and add the sum to
3373 // the |reference_timestamp| in ThreadDescriptor. This value should always
3374 // be positive.
3375 int64 timestamp_delta_us = 1;
3376 // Absolute value (e.g. a manually specified timestamp in the macro).
3377 // This is a one-off value that does not affect delta timestamp computation
3378 // in subsequent TrackEvents.
3379 int64 timestamp_absolute_us = 16;
3380 }
3381
3382 // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
3383 // microseconds.
3384 oneof thread_time {
3385 // Same encoding as |timestamp| fields above.
3386 int64 thread_time_delta_us = 2;
3387 // TODO(eseckler): Consider removing absolute thread time support. It's
3388 // currently required to support writing PHASE_COMPLETE events out-of-order,
3389 // but shouldn't be required anymore when we split them into begin/end.
3390 int64 thread_time_absolute_us = 17;
3391 }
3392
Eric Seckler1fe18c92019-05-30 10:27:54 +01003393 // Value of the instruction counter for the current thread.
3394 oneof thread_instruction_count {
3395 // Same encoding as |timestamp| fields above.
3396 int64 thread_instruction_count_delta = 8;
3397 // TODO(eseckler): Consider removing absolute thread instruction count
3398 // support. It's currently required to support writing PHASE_COMPLETE events
3399 // out-of-order, but shouldn't be required anymore when we split them into
3400 // begin/end.
3401 int64 thread_instruction_count_absolute = 20;
3402 }
Andrew Comminos195e9352019-05-14 16:56:47 -07003403
Eric Secklerc73ef062019-02-25 12:30:35 +00003404 // We intend to add a binary symbol version of this in the future.
Florian Mayer5716fc12019-06-24 11:50:51 -07003405 repeated uint64 category_iids = 3; // interned EventCategoryName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003406
3407 // TODO(eseckler): May also want a debug_name for untyped debug-only events.
3408
3409 // Unstable key/value annotations shown in the trace viewer but not intended
3410 // for metrics use.
3411 repeated DebugAnnotation debug_annotations = 4;
3412
3413 // Typed event arguments:
3414 optional TaskExecution task_execution = 5;
3415 // TODO(eseckler): New argument types go here :)
3416
3417 // Apart from {category, time, thread time, tid, pid}, other legacy trace
3418 // event attributes are initially simply proxied for conversion to a JSON
3419 // trace. We intend to gradually transition these attributes to similar native
3420 // features in TrackEvent (e.g. async + flow events), or deprecate them
3421 // without replacement where transition is unsuitable.
Eric Seckler59945762019-03-04 11:48:25 +00003422 //
Eric Seckler1fe18c92019-05-30 10:27:54 +01003423 // Next reserved id: 16 (up to 16).
Eric Seckler59945762019-03-04 11:48:25 +00003424 // Next id: 20.
Eric Secklerc73ef062019-02-25 12:30:35 +00003425 message LegacyEvent {
Florian Mayer5716fc12019-06-24 11:50:51 -07003426 optional uint64 name_iid = 1; // interned LegacyEventName.
Eric Secklerc73ef062019-02-25 12:30:35 +00003427 optional int32 phase = 2;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003428 optional int64 duration_us = 3;
3429 optional int64 thread_duration_us = 4;
Eric Seckler59945762019-03-04 11:48:25 +00003430
Eric Seckler1fe18c92019-05-30 10:27:54 +01003431 // Elapsed retired instruction count during the event.
3432 optional int64 thread_instruction_delta = 15;
3433
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003434 reserved 5; // used to be |flags|.
Eric Seckler59945762019-03-04 11:48:25 +00003435
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003436 oneof id {
3437 uint64 unscoped_id = 6;
3438 uint64 local_id = 10;
3439 uint64 global_id = 11;
3440 }
3441 // Additional optional scope for |id|.
3442 optional string id_scope = 7;
Eric Seckler59945762019-03-04 11:48:25 +00003443
3444 // Consider the thread timestamps for async BEGIN/END event pairs as valid.
3445 optional bool use_async_tts = 9;
3446
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003447 // Idenfifies a flow. Flow events with the same bind_id are connected.
Eric Secklerc73ef062019-02-25 12:30:35 +00003448 optional uint64 bind_id = 8;
Eric Seckler7f2c5e42019-03-05 08:59:02 +00003449 // Use the enclosing slice as binding point for a flow end event instead of
3450 // the next slice. Flow start/step events always bind to the enclosing
3451 // slice.
Eric Seckler59945762019-03-04 11:48:25 +00003452 optional bool bind_to_enclosing = 12;
3453
3454 enum FlowDirection {
3455 FLOW_UNSPECIFIED = 0;
3456 FLOW_IN = 1;
3457 FLOW_OUT = 2;
3458 FLOW_INOUT = 3;
3459 }
3460 optional FlowDirection flow_direction = 13;
3461
3462 enum InstantEventScope {
3463 SCOPE_UNSPECIFIED = 0;
3464 SCOPE_GLOBAL = 1;
3465 SCOPE_PROCESS = 2;
3466 SCOPE_THREAD = 3;
3467 }
3468 optional InstantEventScope instant_event_scope = 14;
Eric Secklerc73ef062019-02-25 12:30:35 +00003469
3470 // Override the pid/tid if the writer needs to emit events on behalf of
3471 // another process/thread. This should be the exception. Normally, the
3472 // pid+tid from ThreadDescriptor is used.
3473 optional int32 pid_override = 18;
3474 optional int32 tid_override = 19;
3475 }
3476
3477 optional LegacyEvent legacy_event = 6;
3478}
3479
3480// --------------------
3481// Interned data types:
3482// --------------------
3483
3484message EventCategory {
Florian Mayer5716fc12019-06-24 11:50:51 -07003485 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003486 optional string name = 2;
3487}
3488
3489message LegacyEventName {
Florian Mayer5716fc12019-06-24 11:50:51 -07003490 optional uint64 iid = 1;
Eric Secklerc73ef062019-02-25 12:30:35 +00003491 optional string name = 2;
3492}
3493
3494// End of protos/perfetto/trace/track_event/track_event.proto
3495
Stephen Nusko70ea3302019-04-01 19:44:40 +01003496// Begin of protos/perfetto/trace/trigger.proto
3497
3498// When a TracingSession receives a trigger it records the boot time nanoseconds
3499// in the TracePacket's timestamp field as well as the name of the producer that
3500// triggered it. We emit this data so filtering can be done on triggers received
3501// in the trace.
3502message Trigger {
3503 // Name of the trigger which was received.
3504 optional string trigger_name = 1;
3505 // The actual producer that activated |trigger|.
3506 optional string producer_name = 2;
3507 // The verified UID of the producer.
3508 optional int32 trusted_producer_uid = 3;
3509}
3510
3511// End of protos/perfetto/trace/trigger.proto
3512
Ryan Savitski89bd9222019-06-13 14:39:30 +01003513// Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto
3514
3515message GpuCounterEvent {
3516 // The first trace packet of each session should include counter_spec.
Florian Mayerb5751122019-07-02 14:07:03 +01003517 optional GpuCounterDescriptor counter_descriptor = 1;
Ryan Savitski89bd9222019-06-13 14:39:30 +01003518
3519 message GpuCounter {
3520 // required. Identifier for counter.
3521 optional uint32 counter_id = 1;
3522 // required. Value of the counter.
Florian Mayerb5751122019-07-02 14:07:03 +01003523 oneof value {
3524 int64 int_value = 2;
3525 double double_value = 3;
3526 }
Ryan Savitski89bd9222019-06-13 14:39:30 +01003527 }
3528 repeated GpuCounter counters = 2;
3529}
3530
3531// End of protos/perfetto/trace/gpu/gpu_counter_event.proto
3532
3533// Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
3534
3535message GpuRenderStageEvent {
3536 // required. Unique ID for the event.
3537 optional uint64 event_id = 1;
3538
3539 // required. Start time of event in GPU clock.
3540 optional uint64 start_time = 2;
3541
3542 // optional. Duration in GPU clock. If unset, this is a single time point
3543 // event.
3544 optional uint64 duration = 3;
3545
3546 // required. ID to a hardware queue description in the specifications.
3547 optional int32 hw_queue_id = 4;
3548
3549 // required. ID to a render stage description in the specifications.
3550 optional int32 stage_id = 5;
3551
3552 // required. GL context/VK device.
3553 optional uint64 context = 6;
3554
3555 // optional. Additional data for the user. This may include attribs for
3556 // the event like resource ids, shaders etc
3557 message ExtraData {
3558 optional string name = 1;
3559 optional string value = 2;
3560 }
3561 repeated ExtraData extra_data = 7;
3562
3563 // The first trace packet of each session should include a Specifications
3564 // to enumerate all IDs that will be used.
3565 message Specifications {
3566 message ContextSpec {
3567 optional uint64 context = 1;
3568 optional int32 pid = 2;
3569 }
3570 optional ContextSpec context_spec = 1;
3571
3572 message Description {
3573 optional int32 id = 1;
3574 optional string name = 2;
3575 optional string description = 3;
3576 }
3577
3578 // Labels to categorize the hw Queue this event goes on
3579 repeated Description hw_queue = 2;
3580
3581 // Labels to categorize render stage(binning, render, compute etc)
3582 repeated Description stage = 3;
3583 }
3584 optional Specifications specifications = 8;
3585
3586 // Extension for vendor's custom proto.
3587 extensions 100 to 200;
3588}
3589
3590// End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
3591
Florian Mayerb5751122019-07-02 14:07:03 +01003592// Begin of protos/perfetto/common/gpu_counter_descriptor.proto
3593
3594// Description of GPU counters.
3595// This message is sent by a GPU counter producer to specify the counters available in the hardware.
3596message GpuCounterDescriptor {
3597 message GpuCounterSpec {
3598 optional uint32 counter_id = 1;
3599 optional string name = 2;
3600 optional string description = 3;
3601 }
3602 repeated GpuCounterSpec specs = 1;
3603}
3604
3605// End of protos/perfetto/common/gpu_counter_descriptor.proto
3606
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003607// Begin of protos/perfetto/config/android/android_log_config.proto
3608
3609message AndroidLogConfig {
3610 repeated AndroidLogId log_ids = 1;
3611
3612 reserved 2; // Was |poll_ms|, deprecated.
3613
3614 // If set ignores all log messages whose prio is < the given value.
3615 optional AndroidLogPriority min_prio = 3;
3616
3617 // If non-empty ignores all log messages whose tag doesn't match one of the
3618 // specified values.
3619 repeated string filter_tags = 4;
3620}
3621
3622// End of protos/perfetto/config/android/android_log_config.proto
3623
3624// Begin of protos/perfetto/config/chrome/chrome_config.proto
3625
3626// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3627// to reflect changes in the corresponding C++ headers.
3628
3629message ChromeConfig {
3630 optional string trace_config = 1;
Siddhartha S305a5012019-03-29 09:33:00 -07003631
3632 // When enabled, the data source should only fill in fields in the output that
3633 // are not potentially privacy sensitive.
3634 optional bool privacy_filtering_enabled = 2;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003635}
3636
3637// End of protos/perfetto/config/chrome/chrome_config.proto
3638
3639// Begin of protos/perfetto/config/data_source_config.proto
3640
3641// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3642// to reflect changes in the corresponding C++ headers.
3643
3644// The configuration that is passed to each data source when starting tracing.
3645message DataSourceConfig {
3646 // Data source unique name, e.g., "linux.ftrace". This must match
3647 // the name passed by the data source when it registers (see
3648 // RegisterDataSource()).
3649 optional string name = 1;
3650
3651 // The index of the logging buffer where TracePacket(s) will be stored.
3652 // This field doesn't make a major difference for the Producer(s). The final
3653 // logging buffers, in fact, are completely owned by the Service. We just ask
3654 // the Producer to copy this number into the chunk headers it emits, so that
3655 // the Service can quickly identify the buffer where to move the chunks into
3656 // without expensive lookups on its fastpath.
3657 optional uint32 target_buffer = 2;
3658
3659 // Set by the service to indicate the duration of the trace.
3660 // DO NOT SET in consumer as this will be overridden by the service.
3661 optional uint32 trace_duration_ms = 3;
3662
Florian Mayerfb879982019-03-29 10:45:32 +00003663 // Set by the service to indicate whether this tracing session has extra
3664 // guardrails.
3665 // DO NOT SET in consumer as this will be overridden by the service.
3666 optional bool enable_extra_guardrails = 6;
3667
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003668 // Set by the service to indicate which tracing session the data source
3669 // belongs to. The intended use case for this is checking if two data sources,
3670 // one of which produces metadata for the other one, belong to the same trace
3671 // session and hence should be linked together.
3672 // This field was introduced in Aug 2018 after Android P.
3673 optional uint64 tracing_session_id = 4;
3674
3675 // Keeep the lower IDs (up to 99) for fields that are *not* specific to
3676 // data-sources and needs to be processed by the traced daemon.
3677
Primiano Tucci0f2f3b42019-05-21 19:37:01 +01003678 // All data source config fields must be marked as [lazy=true]. This prevents
3679 // the proto-to-cpp generator from recursing into those when generating the
3680 // cpp classes and polluting tracing/core with data-source-specific classes.
3681 // Instead they are treated as opaque strings containing raw proto bytes.
3682
3683 optional FtraceConfig ftrace_config = 100 [lazy = true];
3684 optional InodeFileConfig inode_file_config = 102 [lazy = true];
3685 optional ProcessStatsConfig process_stats_config = 103 [lazy = true];
3686 optional SysStatsConfig sys_stats_config = 104 [lazy = true];
3687 optional HeapprofdConfig heapprofd_config = 105 [lazy = true];
3688 optional AndroidPowerConfig android_power_config = 106 [lazy = true];
3689 optional AndroidLogConfig android_log_config = 107 [lazy = true];
Ryan Savitski89bd9222019-06-13 14:39:30 +01003690 optional GpuCounterConfig gpu_counter_config = 108 [lazy = true];
Ryan Savitskifde4ae62019-06-14 16:02:52 +01003691 optional PackagesListConfig packages_list_config = 109 [lazy = true];
Primiano Tucci0f2f3b42019-05-21 19:37:01 +01003692
Primiano Tucci0f9e0222019-06-05 09:36:41 +01003693 // Chrome is special as it doesn't use the perfetto IPC layer. We want to
3694 // avoid proto serialization and de-serialization there because that would
3695 // just add extra hops on top of the Mojo ser/des. Instead we auto-generate a
3696 // C++ class for it so it can pass around plain C++ objets.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003697 optional ChromeConfig chrome_config = 101;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003698
3699 // This is a fallback mechanism to send a free-form text config to the
3700 // producer. In theory this should never be needed. All the code that
3701 // is part of the platform (i.e. traced service) is supposed to *not* truncate
3702 // the trace config proto and propagate unknown fields. However, if anything
3703 // in the pipeline (client or backend) ends up breaking this forward compat
3704 // plan, this field will become the escape hatch to allow future data sources
3705 // to get some meaningful configuration.
3706 optional string legacy_config = 1000;
3707
3708 // This field is only used for testing.
Primiano Tucci0f9e0222019-06-05 09:36:41 +01003709 optional TestConfig for_testing = 1001;
3710
3711 reserved 268435455; // Was |for_testing|. Caused more problems then found.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003712}
3713
3714// End of protos/perfetto/config/data_source_config.proto
3715
3716// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
3717
3718// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3719// to reflect changes in the corresponding C++ headers.
3720
3721message FtraceConfig {
3722 repeated string ftrace_events = 1;
3723 repeated string atrace_categories = 2;
3724 repeated string atrace_apps = 3;
3725 // *Per-CPU* buffer size.
3726 optional uint32 buffer_size_kb = 10;
3727 optional uint32 drain_period_ms = 11;
3728}
3729
3730// End of protos/perfetto/config/ftrace/ftrace_config.proto
3731
3732// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
3733
3734// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3735// to reflect changes in the corresponding C++ headers.
3736
3737message InodeFileConfig {
3738 message MountPointMappingEntry {
3739 optional string mountpoint = 1;
3740 repeated string scan_roots = 2;
3741 }
3742
3743 // How long to pause between batches.
3744 optional uint32 scan_interval_ms = 1;
3745
3746 // How long to wait before the first scan in order to accumulate inodes.
3747 optional uint32 scan_delay_ms = 2;
3748
3749 // How many inodes to scan in one batch.
3750 optional uint32 scan_batch_size = 3;
3751
3752 // Do not scan for inodes not found in the static map.
3753 optional bool do_not_scan = 4;
3754
3755 // If non-empty, only scan inodes corresponding to block devices named in
3756 // this list.
3757 repeated string scan_mount_points = 5;
3758
3759 // When encountering an inode belonging to a block device corresponding
3760 // to one of the mount points in this map, scan its scan_roots instead.
3761 repeated MountPointMappingEntry mount_point_mapping = 6;
3762}
3763
3764// End of protos/perfetto/config/inode_file/inode_file_config.proto
3765
3766// Begin of protos/perfetto/config/power/android_power_config.proto
3767
3768message AndroidPowerConfig {
3769 enum BatteryCounters {
3770 BATTERY_COUNTER_UNSPECIFIED = 0;
3771 BATTERY_COUNTER_CHARGE = 1; // Coulomb counter.
3772 BATTERY_COUNTER_CAPACITY_PERCENT = 2; // Charge (%).
3773 BATTERY_COUNTER_CURRENT = 3; // Instantaneous current.
3774 BATTERY_COUNTER_CURRENT_AVG = 4; // Avg current.
3775 }
3776 optional uint32 battery_poll_ms = 1;
3777 repeated BatteryCounters battery_counters = 2;
3778
3779 // Where available enables per-power-rail measurements.
3780 optional bool collect_power_rails = 3;
3781}
3782
3783// End of protos/perfetto/config/power/android_power_config.proto
3784
3785// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
3786
3787// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3788// to reflect changes in the corresponding C++ headers.
3789
3790message ProcessStatsConfig {
3791 enum Quirks {
3792 QUIRKS_UNSPECIFIED = 0;
3793
3794 // This has been deprecated and ignored as per 2018-05-01. Full scan at
3795 // startup is now disabled by default and can be re-enabled using the
3796 // |scan_all_processes_on_start| arg.
3797 DISABLE_INITIAL_DUMP = 1 [deprecated = true];
3798
3799 DISABLE_ON_DEMAND = 2;
3800 }
3801
3802 repeated Quirks quirks = 1;
3803
3804 // If enabled all processes will be scanned and dumped when the trace starts.
3805 optional bool scan_all_processes_on_start = 2;
3806
3807 // If enabled thread names are also recoded (this is redundant if sched_switch
3808 // is enabled).
3809 optional bool record_thread_names = 3;
3810
3811 // If > 0 samples counters (see process_stats.proto) from
3812 // /proc/pid/status and oom_score_adj every X ms.
3813 // This is required to be > 100ms to avoid excessive CPU usage.
3814 // TODO(primiano): add CPU cost for change this value.
3815 optional uint32 proc_stats_poll_ms = 4;
3816
3817 // If empty samples stats for all processes. If non empty samples stats only
3818 // for processes matching the given string in their argv0 (i.e. the first
3819 // entry of /proc/pid/cmdline).
3820 // TODO(primiano): implement this feature.
3821 // repeated string proc_stats_filter = 5;
Lalit Maganti999355c2019-03-27 18:17:08 +00003822
3823 // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
3824 // (default: |proc_stats_poll_ms|). If = 0, will be set to
3825 // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
3826 // multiple.
3827 optional uint32 proc_stats_cache_ttl_ms = 6;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003828}
3829
3830// End of protos/perfetto/config/process_stats/process_stats_config.proto
3831
3832// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
3833
3834// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3835// to reflect changes in the corresponding C++ headers.
3836
3837// This file defines the configuration for the Linux /proc poller data source,
3838// which injects counters in the trace.
3839// Counters that are needed in the trace must be explicitly listed in the
3840// *_counters fields. This is to avoid spamming the trace with all counters
3841// at all times.
3842// The sampling rate is configurable. All polling rates (*_period_ms) need
3843// to be integer multiples of each other.
3844// OK: [10ms, 10ms, 10ms], [10ms, 20ms, 10ms], [10ms, 20ms, 60ms]
3845// Not OK: [10ms, 10ms, 11ms], [10ms, 15ms, 20ms]
3846message SysStatsConfig {
3847 // Polls /proc/meminfo every X ms, if non-zero.
3848 // This is required to be > 10ms to avoid excessive CPU usage.
3849 // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
3850 optional uint32 meminfo_period_ms = 1;
3851
Primiano Tucci1eb966d2019-06-06 15:40:09 +01003852 // If empty all known counters are reported. Otherwise, only the counters
3853 // specified below are reported.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003854 repeated MeminfoCounters meminfo_counters = 2;
3855
3856 // Polls /proc/vmstat every X ms, if non-zero.
3857 // This is required to be > 10ms to avoid excessive CPU usage.
3858 // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
3859 optional uint32 vmstat_period_ms = 3;
3860 repeated VmstatCounters vmstat_counters = 4;
3861
3862 // Pols /proc/stat every X ms, if non-zero.
3863 // This is required to be > 10ms to avoid excessive CPU usage.
3864 // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
3865 optional uint32 stat_period_ms = 5;
3866 enum StatCounters {
3867 STAT_UNSPECIFIED = 0;
3868 STAT_CPU_TIMES = 1;
3869 STAT_IRQ_COUNTS = 2;
3870 STAT_SOFTIRQ_COUNTS = 3;
3871 STAT_FORK_COUNT = 4;
3872 }
3873 repeated StatCounters stat_counters = 6;
3874}
3875
3876// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
3877
3878// Begin of protos/perfetto/config/test_config.proto
3879
3880// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
3881// to reflect changes in the corresponding C++ headers.
3882
3883// The configuration for a fake producer used in tests.
3884message TestConfig {
3885 message DummyFields {
3886 optional uint32 field_uint32 = 1;
3887 optional int32 field_int32 = 2;
3888 optional uint64 field_uint64 = 3;
3889 optional int64 field_int64 = 4;
3890 optional fixed64 field_fixed64 = 5;
3891 optional sfixed64 field_sfixed64 = 6;
3892 optional fixed32 field_fixed32 = 7;
3893 optional sfixed32 field_sfixed32 = 8;
3894 optional double field_double = 9;
3895 optional float field_float = 10;
3896 optional sint64 field_sint64 = 11;
3897 optional sint32 field_sint32 = 12;
3898 optional string field_string = 13;
3899 optional bytes field_bytes = 14;
3900 }
3901
3902 // The number of messages the fake producer should send.
3903 optional uint32 message_count = 1;
3904
3905 // The maximum number of messages which should be sent each second.
3906 // The actual obserced speed may be lower if the producer is unable to
3907 // work fast enough.
3908 // If this is zero or unset, the producer will send as fast as possible.
3909 optional uint32 max_messages_per_second = 2;
3910
3911 // The seed value for a simple multiplicative congruential pseudo-random
3912 // number sequence.
3913 optional uint32 seed = 3;
3914
3915 // The size of each message in bytes. Should be greater than or equal 5 to
3916 // account for the number of bytes needed to encode the random number and a
3917 // null byte for the string.
3918 optional uint32 message_size = 4;
3919
3920 // Whether the producer should send a event batch when the data source is
3921 // is initially registered.
3922 optional bool send_batch_on_register = 5;
3923
3924 optional DummyFields dummy_fields = 6;
3925}
3926
3927// End of protos/perfetto/config/test_config.proto
3928
3929// Begin of protos/perfetto/config/trace_config.proto
3930
Ryan Savitski0b4008a2019-05-13 17:55:53 +01003931// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003932// to reflect changes in the corresponding C++ headers.
3933
3934// The overall config that is used when starting a new tracing session through
3935// ProducerPort::StartTracing().
3936// It contains the general config for the logging buffer(s) and the configs for
3937// all the data source being enabled.
3938//
Ryan Savitski53ca60b2019-06-03 13:04:40 +01003939// Next id: 26.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003940message TraceConfig {
3941 message BufferConfig {
3942 optional uint32 size_kb = 1;
3943
3944 reserved 2; // |page_size|, now deprecated.
3945 reserved 3; // |optimize_for|, now deprecated.
3946
3947 enum FillPolicy {
3948 UNSPECIFIED = 0;
3949
3950 // Default behavior. The buffer operates as a conventional ring buffer.
3951 // If the writer is faster than the reader (or if the reader reads only
3952 // after tracing is stopped) newly written packets will overwrite old
3953 // packets.
3954 RING_BUFFER = 1;
3955
3956 // Behaves like RING_BUFFER as long as there is space in the buffer or
3957 // the reader catches up with the writer. As soon as the writer hits
3958 // an unread chunk, it stops accepting new data in the buffer.
3959 DISCARD = 2;
3960 }
3961 optional FillPolicy fill_policy = 4;
3962 }
3963 repeated BufferConfig buffers = 1;
3964
3965 message DataSource {
3966 // Filters and data-source specific config. It contains also the unique name
3967 // of the data source, the one passed in the DataSourceDescriptor when they
3968 // register on the service.
3969 optional protos.DataSourceConfig config = 1;
3970
3971 // Optional. If multiple producers (~processes) expose the same data source
3972 // and |producer_name_filter| != "", the data source is enabled only for
3973 // producers whose names match any of the producer_name_filter below.
3974 // The |producer_name_filter| has to be an exact match. (TODO(primiano):
3975 // support wildcards or regex).
3976 // This allows to enable a data source only for specific processes.
3977 // The "repeated" field has OR sematics: specifying a filter ["foo", "bar"]
3978 // will enable data source on both "foo" and "bar" (if existent).
3979 repeated string producer_name_filter = 2;
3980 }
3981 repeated DataSource data_sources = 2;
3982
Siddhartha Sb63f61e2019-05-03 16:19:51 -07003983 // Config for builtin trace packets emitted by perfetto like trace stats,
3984 // system info, etc.
3985 message BuiltinDataSource {
3986 // Disable emitting clock timestamps into the trace.
3987 optional bool disable_clock_snapshotting = 1;
3988
3989 optional bool disable_trace_config = 2;
3990
3991 optional bool disable_system_info = 3;
3992 }
3993 optional BuiltinDataSource builtin_data_sources = 20;
3994
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00003995 // If specified, the trace will be stopped |duration_ms| after starting.
3996 // However in case of traces with triggers, see
3997 // TriggerConfig.trigger_timeout_ms instead.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00003998 optional uint32 duration_ms = 3;
3999
4000 // This is set when --dropbox is passed to the Perfetto command line client
4001 // and enables guardrails that limit resource usage for traces requested
4002 // by statsd.
4003 optional bool enable_extra_guardrails = 4;
4004
4005 enum LockdownModeOperation {
4006 LOCKDOWN_UNCHANGED = 0;
4007 LOCKDOWN_CLEAR = 1;
4008 LOCKDOWN_SET = 2;
4009 }
4010 // Reject producers that are not running under the same UID as the tracing
4011 // service.
4012 optional LockdownModeOperation lockdown_mode = 5;
4013
4014 message ProducerConfig {
4015 // Identifies the producer for which this config is for.
4016 optional string producer_name = 1;
4017
4018 // Specifies the preferred size of the shared memory buffer. If the size is
4019 // larger than the max size, the max will be used. If it is smaller than
4020 // the page size or doesn't fit pages evenly into it, it will fall back to
4021 // the size specified by the producer or finally the default shared memory
4022 // size.
4023 optional uint32 shm_size_kb = 2;
4024
4025 // Specifies the preferred size of each page in the shared memory buffer.
4026 // Must be an integer multiple of 4K.
4027 optional uint32 page_size_kb = 3;
4028 }
4029
4030 repeated ProducerConfig producers = 6;
4031
4032 // Contains statsd-specific metadata about an alert associated with the trace.
4033 message StatsdMetadata {
4034 // The identifier of the alert which triggered this trace.
4035 optional int64 triggering_alert_id = 1;
4036 // The uid which registered the triggering configuration with statsd.
4037 optional int32 triggering_config_uid = 2;
4038 // The identifier of the config which triggered the alert.
4039 optional int64 triggering_config_id = 3;
4040 // The identifier of the subscription which triggered this trace.
4041 optional int64 triggering_subscription_id = 4;
4042 }
4043
4044 // Statsd-specific metadata.
4045 optional StatsdMetadata statsd_metadata = 7;
4046
4047 // When true, the EnableTracing() request must also provide a file descriptor.
4048 // The service will then periodically read packets out of the trace buffer and
4049 // store it into the passed file.
4050 optional bool write_into_file = 8;
4051
4052 // Optional. If non-zero tunes the write period. A min value of 100ms is
4053 // enforced (i.e. smaller values are ignored).
4054 optional uint32 file_write_period_ms = 9;
4055
4056 // Optional. When non zero the periodic write stops once at most X bytes
4057 // have been written into the file. Tracing is disabled when this limit is
4058 // reached, even if |duration_ms| has not been reached yet.
4059 optional uint64 max_file_size_bytes = 10;
4060
4061 // Contains flags which override the default values of the guardrails inside
4062 // Perfetto. These values are only affect userdebug builds.
4063 message GuardrailOverrides {
4064 // Override the default limit (in bytes) for uploading data to server within
4065 // a 24 hour period.
4066 optional uint64 max_upload_per_day_bytes = 1;
4067 }
4068
4069 optional GuardrailOverrides guardrail_overrides = 11;
4070
4071 // When true, data sources are not started until an explicit call to
4072 // StartTracing() on the consumer port. This is to support early
4073 // initialization and fast trace triggering. This can be used only when the
4074 // Consumer explicitly triggers the StartTracing() method.
4075 // This should not be used in a remote trace config via statsd, doing so will
4076 // result in a hung trace session.
4077 optional bool deferred_start = 12;
4078
4079 // When set, it periodically issues a Flush() to all data source, forcing them
4080 // to commit their data into the tracing service. This can be used for
4081 // quasi-real-time streaming mode and to guarantee some partial ordering of
4082 // events in the trace in windows of X ms.
4083 optional uint32 flush_period_ms = 13;
4084
4085 // Wait for this long for producers to acknowledge flush requests.
4086 // Default 5s.
4087 optional uint32 flush_timeout_ms = 14;
4088
Florian Mayer990e6d72019-06-03 11:34:52 +01004089 // Wait for this long for producers to acknowledge stop requests.
4090 // Default 5s.
4091 optional uint32 data_source_stop_timeout_ms = 23;
4092
Siddhartha Sb63f61e2019-05-03 16:19:51 -07004093 reserved 15; // |disable_clock_snapshotting| moved.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004094
4095 // Android-only. If set, sends an intent to the Traceur system app when the
4096 // trace ends to notify it about the trace readiness.
4097 optional bool notify_traceur = 16;
Stephen Nuskof53f8ed2019-03-20 14:51:10 +00004098
4099 // Triggers allow producers to start or stop the tracing session when an event
4100 // occurs.
4101 //
4102 // For example if we are tracing probabilistically, most traces will be
4103 // uninteresting. Triggers allow us to keep only the interesting ones such as
4104 // those traces during which the device temperature reached a certain
4105 // threshold. In this case the producer can activate a trigger to keep
4106 // (STOP_TRACING) the trace, otherwise it can also begin a trace
4107 // (START_TRACING) because it knows something is about to happen.
4108 message TriggerConfig {
4109 enum TriggerMode {
4110 UNSPECIFIED = 0;
4111
4112 // When this mode is chosen, data sources are not started until one of the
4113 // |triggers| are received. This supports early initialization and fast
4114 // starting of the tracing system. On triggering, the session will then
4115 // record for |stop_delay_ms|. However if no trigger is seen
4116 // after |trigger_timeout_ms| the session will be stopped and no data will
4117 // be returned.
4118 START_TRACING = 1;
4119
4120 // When this mode is chosen, the session will be started via the normal
4121 // EnableTracing() & StartTracing(). If no trigger is ever seen
4122 // the session will be stopped after |trigger_timeout_ms| and no data will
4123 // be returned. However if triggered the trace will stop after
4124 // |stop_delay_ms| and any data in the buffer will be returned to the
4125 // consumer.
4126 STOP_TRACING = 2;
4127 }
4128 optional TriggerMode trigger_mode = 1;
4129
4130 message Trigger {
4131 // The producer must specify this name to activate the trigger.
4132 optional string name = 1;
4133
4134 // The a std::regex that will match the producer that can activate this
4135 // trigger. This is optional. If unset any producers can activate this
4136 // trigger.
4137 optional string producer_name_regex = 2;
4138
4139 // After a trigger is received either in START_TRACING or STOP_TRACING
4140 // mode then the trace will end |stop_delay_ms| after triggering.
4141 optional uint32 stop_delay_ms = 3;
4142 }
4143 // A list of triggers which are related to this configuration. If ANY
4144 // trigger is seen then an action will be performed based on |trigger_mode|.
4145 repeated Trigger triggers = 2;
4146
4147 // Required and must be positive if a TriggerConfig is specified. This is
4148 // how long this TraceConfig should wait for a trigger to arrive. After this
4149 // period of time if no trigger is seen the TracingSession will be cleaned
4150 // up.
4151 optional uint32 trigger_timeout_ms = 3;
4152 }
4153 optional TriggerConfig trigger_config = 17;
Stephen Nusko9fa59cb2019-04-15 04:19:16 +01004154
4155 // When this is non-empty the perfetto command line tool will ignore the rest
4156 // of this TraceConfig and instead connect to the perfetto service as a
4157 // producer and send these triggers, potentially stopping or starting traces
4158 // that were previous configured to use a TriggerConfig.
4159 repeated string activate_triggers = 18;
Hector Dearman085dc3c2019-04-23 11:48:10 +01004160
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004161 // Configuration for trace contents that reference earlier trace data. For
4162 // example, a data source might intern strings, and emit packets containing
4163 // {interned id : string} pairs. Future packets from that data source can then
4164 // use the interned ids instead of duplicating the raw string contents. The
4165 // trace parser will then need to use that interning table to fully interpret
4166 // the rest of the trace.
4167 message IncrementalStateConfig {
Ryan Savitski0b4008a2019-05-13 17:55:53 +01004168 // If nonzero, notify eligible data sources to clear their incremental state
4169 // periodically, with the given period. The notification is sent only to
4170 // data sources that have |handles_incremental_state_clear| set in their
4171 // DataSourceDescriptor. The notification requests that the data source
4172 // stops referring to past trace contents. This is particularly useful when
4173 // tracing in ring buffer mode, where it is not exceptional to overwrite old
4174 // trace data.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004175 //
4176 // Warning: this time-based global clearing is likely to be removed in the
Ryan Savitski0b4008a2019-05-13 17:55:53 +01004177 // future, to be replaced with a smarter way of sending the notifications
4178 // only when necessary.
Ryan Savitskiac6e0d42019-05-10 15:59:56 +01004179 optional uint32 clear_period_ms = 1;
4180 }
4181 optional IncrementalStateConfig incremental_state_config = 21;
4182
Hector Dearman085dc3c2019-04-23 11:48:10 +01004183 // Additional guardrail used by the Perfetto command line client.
4184 // On user builds when --dropbox is set perfetto will refuse to trace unless
4185 // this is also set.
4186 // Added in Q.
4187 optional bool allow_user_build_tracing = 19;
Hector Dearmanfb4d0732019-05-19 15:44:56 +01004188
4189 // If set the tracing service will ensure there is at most one tracing session
4190 // with this key.
4191 optional string unique_session_name = 22;
Hector Dearman554627f2019-06-04 17:58:22 +01004192
4193 // Compress trace with the given method. Best effort.
4194 enum CompressionType {
4195 COMPRESSION_TYPE_UNSPECIFIED = 0;
4196 COMPRESSION_TYPE_DEFLATE = 1;
4197 };
4198 optional CompressionType compression_type = 24;
Ryan Savitski53ca60b2019-06-03 13:04:40 +01004199
4200 // Android-only. Debug builds only. Not for general use. If set, saves a
4201 // Dropbox trace into an incident. This field is read by perfetto_cmd, rather
4202 // than the tracing service. All fields are mandatory.
4203 message IncidentReportConfig {
4204 optional string destination_package = 1;
4205 optional string destination_class = 2;
4206 // Level of filtering in the requested incident. See |Destination| in
4207 // frameworks/base/core/proto/android/privacy.proto.
4208 optional int32 privacy_level = 3;
4209 // If true, do not write the trace into dropbox (i.e. incident only).
4210 // Otherwise, write to both dropbox and incident.
4211 optional bool skip_dropbox = 4;
4212 }
4213 optional IncidentReportConfig incident_report_config = 25;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004214}
4215
4216// End of protos/perfetto/config/trace_config.proto
4217
4218// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
4219
4220// Configuration for go/heapprofd.
4221message HeapprofdConfig {
4222 message ContinuousDumpConfig {
4223 // ms to wait before first dump.
4224 optional uint32 dump_phase_ms = 5;
4225 // ms to wait between following dumps.
4226 optional uint32 dump_interval_ms = 6;
4227 };
4228
4229 // Set to 1 for perfect accuracy.
4230 // Otherwise, sample every sample_interval_bytes on average.
Florian Mayer81df6cb2019-04-15 11:32:13 +01004231 //
4232 // See https://docs.perfetto.dev/#/heapprofd?id=sampling-interval for more
4233 // details.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004234 optional uint64 sampling_interval_bytes = 1;
4235
4236 // E.g. surfaceflinger, com.android.phone
Florian Mayerb524cbb2019-04-05 18:14:35 +01004237 // This input is normalized in the following way: if it contains slashes,
4238 // everything up to the last slash is discarded. If it contains "@",
4239 // everything after the first @ is discared.
4240 // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger.
4241 // This transformation is also applied to the processes' command lines when
4242 // matching.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004243 repeated string process_cmdline = 2;
Florian Mayerb524cbb2019-04-05 18:14:35 +01004244
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004245 // For watermark based triggering or local debugging.
4246 repeated uint64 pid = 4;
Florian Mayera774cb72019-04-29 14:20:43 +01004247
4248 // Profile all processes eligible for profiling on the system.
4249 // See https://docs.perfetto.dev/#/heapprofd?id=target-processes for which
4250 // processes are eligible.
4251 //
4252 // On unmodified userdebug builds, this will lead to system crashes. Zygote
4253 // will crash when trying to launch a new process as it will have an
4254 // unexpected open socket to heapprofd.
4255 //
4256 // heapprofd will likely be overloaded by the amount of data for low
4257 // sampling intervals.
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004258 optional bool all = 5;
Florian Mayera774cb72019-04-29 14:20:43 +01004259
Florian Mayer9c6538d2019-03-07 14:32:05 +00004260 // Do not emit function names for mappings starting with this prefix.
4261 // E.g. /system to not emit symbols for any system libraries.
4262 repeated string skip_symbol_prefix = 7;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004263
4264 // Dump once at the end of the trace, emitting the heap dump at maximum
4265 // memory usage.
4266 // optional bool retain_max = 5; // TODO(fmayer): Implement
4267
4268 // Dump at a predefined interval.
4269 optional ContinuousDumpConfig continuous_dump_config = 6;
Florian Mayer92e8bf92019-03-28 13:44:45 +00004270
4271 // Size of the shared memory buffer between the profiled processes and
4272 // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500
4273 // MiB.
Florian Mayer91b3c6d2019-04-10 13:44:37 -07004274 //
4275 // Needs to be:
4276 // * at least 8192,
4277 // * a power of two,
4278 // * a multiple of 4096.
Florian Mayer92e8bf92019-03-28 13:44:45 +00004279 optional uint64 shmem_size_bytes = 8;
Florian Mayerd6bdb6f2019-05-03 17:53:58 +01004280
4281 // When the shmem buffer is full, block the client instead of ending the
4282 // trace. Use with caution as this will significantly slow down the target
4283 // process.
4284 optional bool block_client = 9;
Florian Mayer225559a2019-05-09 14:28:26 +01004285
4286 // Do not profile processes from startup, only match already running
4287 // processes.
4288 //
4289 // Can not be set at the same time as no_running.
4290 optional bool no_startup = 10;
4291
4292 // Do not profile running processes. Only match processes on startup.
4293 //
4294 // Can not be set at the same time as no_startup.
4295 optional bool no_running = 11;
Florian Mayer7142c7c2019-05-20 18:11:41 +01004296
4297 // Gather information on how many bytes of allocations are on non-referenced
4298 // pages. The way to use this generally is:
4299 // 1. Start profile of app.
4300 // 2. Start app.
4301 // 3. echo 1 > /proc/$APP_PID/clear_refs.
4302 // 4. Do operations.
4303 // 5. End profile.
4304 //
4305 // You can then find the allocations that were not used for the operations you
4306 // did in step 4.
4307 optional bool idle_allocations = 12;
Isabelle Taylor80ec5f72019-02-27 11:27:41 +00004308}
4309
4310// End of protos/perfetto/config/profiling/heapprofd_config.proto
Ryan Savitski89bd9222019-06-13 14:39:30 +01004311
4312// Begin of protos/perfetto/config/gpu/gpu_counter_config.proto
4313
4314// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
4315// to reflect changes in the corresponding C++ headers.
4316
4317message GpuCounterConfig {
4318 // Desired sampling interval for counters.
4319 optional uint64 counter_period_ns = 1;
4320
4321 // List of counters to be sampled. Counter IDs correspond to the ones
4322 // described in GpuCounterSpec in the data source descriptor.
4323 repeated uint32 counter_ids = 2;
4324}
4325
4326// End of protos/perfetto/config/gpu/gpu_counter_config.proto
Ryan Savitskifde4ae62019-06-14 16:02:52 +01004327
4328// Begin of protos/perfetto/config/android/packages_list_config.proto
4329
4330// Data source that lists details (such as version code) about packages on an
4331// Android device.
4332message PackagesListConfig {
4333 // If not empty, emit info about only the following list of package names
4334 // (exact match, no regex). Otherwise, emit info about all packages.
4335 repeated string package_name_filter = 1;
4336}
4337
4338// End of protos/perfetto/config/android/packages_list_config.proto