1// 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 14option go_package = "github.com/google/perfetto/perfetto_proto"; 15 16// Begin of protos/perfetto/metrics/android/android_trusty_workqueues.proto 17 18// Metric used to generate a simplified view of the Trusty kworker events. 19message AndroidTrustyWorkqueues {} 20 21// End of protos/perfetto/metrics/android/android_trusty_workqueues.proto 22 23// Begin of protos/perfetto/metrics/android/batt_metric.proto 24 25message AndroidBatteryMetric { 26 message BatteryCounters { 27 // Timestamp measured from boot time [ns]. 28 optional int64 timestamp_ns = 1; 29 // Fields 2-5 are the same as in BatteryCounters proto in TracePacket. 30 optional double charge_counter_uah = 2; 31 optional float capacity_percent = 3; 32 optional double current_ua = 4; 33 optional double current_avg_ua = 5; 34 } 35 36 message BatteryAggregates { 37 // Field numbers for these 3 == the int values from Android 38 optional int64 total_screen_off_ns = 1; 39 optional int64 total_screen_on_ns = 2; 40 optional int64 total_screen_doze_ns = 3; 41 // Total time a wakelock was held 42 optional int64 total_wakelock_ns = 4; 43 // Amount of time the device was suspended. Depends on the ftrace source 44 // "power/suspend_resume". 45 optional int64 sleep_ns = 5; 46 optional int64 sleep_screen_off_ns = 6; 47 optional int64 sleep_screen_on_ns = 7; 48 optional int64 sleep_screen_doze_ns = 8; 49 } 50 51 // Period of time during the trace that the device went to sleep completely. 52 message SuspendPeriod { 53 optional int64 timestamp_ns = 1; 54 optional int64 duration_ns = 2; 55 } 56 57 // Battery counters info for each ts of the trace. This should only be 58 // extracted for short traces. 59 repeated BatteryCounters battery_counters = 1; 60 61 optional BatteryAggregates battery_aggregates = 2; 62 63 repeated SuspendPeriod suspend_period = 3; 64} 65 66// End of protos/perfetto/metrics/android/batt_metric.proto 67 68// Begin of protos/perfetto/metrics/android/camera_metric.proto 69 70message AndroidCameraMetric { 71 message Counter { 72 optional double min = 1; 73 optional double max = 2; 74 optional double avg = 3; 75 } 76 77 // Counter for the sum of DMA and RSS across GCA, cameraserver 78 // and HAL. This provides a single number for the memory 79 // pressure using the camera is putting on the rest of the 80 // system. 81 // 82 // Note: this number assumes that all DMA pressure is coming 83 // from the camera as this is usually a pretty good 84 // approximation. Being more accurate here would increase the 85 // complexity of the metric significantly. 86 // 87 // Note: if there are multiple GCA/cameraserver/HAL processes 88 // in the trace, this metric will simply take the latest 89 // one in the trace and ignore the others. 90 optional Counter gc_rss_and_dma = 1; 91} 92 93// End of protos/perfetto/metrics/android/camera_metric.proto 94 95// Begin of protos/perfetto/metrics/android/camera_unagg_metric.proto 96 97message AndroidCameraUnaggregatedMetric { 98 message Value { 99 optional int64 ts = 1; 100 optional double value = 2; 101 } 102 103 // Timeseries for the sum of DMA and RSS across GCA, cameraserver 104 // and HAL. This provides a single number for the memory 105 // pressure using the camera is putting on the rest of the 106 // system. 107 // 108 // Note: this number assumes that all DMA pressure is coming 109 // from the camera as this is usually a pretty good 110 // approximation. Being more accurate here would increase the 111 // complexity of the metric significantly. 112 // 113 // Note: if there are multiple GCA/cameraserver/HAL processes 114 // in the trace, this metric will simply take the latest 115 // one in the trace and ignore the others. 116 repeated Value gc_rss_and_dma = 1; 117} 118 119// End of protos/perfetto/metrics/android/camera_unagg_metric.proto 120 121// Begin of protos/perfetto/metrics/android/cpu_metric.proto 122 123message AndroidCpuMetric { 124 // Next id: 6 125 message Metrics { 126 // CPU megacycles (i.e. cycles divided by 1e6). 127 optional int64 mcycles = 1; 128 129 // Total time the thread was running for this breakdown in 130 // nanoseconds. 131 optional int64 runtime_ns = 2; 132 133 // Min/max/average CPU frequency weighted by the time the CPU was 134 // running at each frequency in this breakdown. 135 optional int64 min_freq_khz = 3; 136 optional int64 max_freq_khz = 4; 137 optional int64 avg_freq_khz = 5; 138 } 139 140 // Next id: 7 141 message CoreData { 142 optional uint32 id = 1; 143 optional Metrics metrics = 6; 144 145 reserved 2 to 5; 146 } 147 148 // Next id: 3 149 message CoreTypeData { 150 optional string type = 1; 151 optional Metrics metrics = 2; 152 } 153 154 // Next id: 7 155 message Thread { 156 optional string name = 1; 157 optional Metrics metrics = 4; 158 159 // Breakdowns of above metrics. 160 repeated CoreData core = 2; 161 repeated CoreTypeData core_type = 5; 162 163 reserved 3; 164 } 165 166 // Next id: 8 167 message Process { 168 optional string name = 1; 169 optional Metrics metrics = 4; 170 171 // Breakdowns of above metrics. 172 repeated Thread threads = 6; 173 repeated CoreData core = 7; 174 repeated CoreTypeData core_type = 5; 175 176 reserved 3; 177 } 178 179 repeated Process process_info = 1; 180} 181 182// End of protos/perfetto/metrics/android/cpu_metric.proto 183 184// Begin of protos/perfetto/metrics/android/display_metrics.proto 185 186message AndroidDisplayMetrics { 187 // Stat that reports the number of duplicate frames submitted 188 // to the display for rendering. That is frames that have the same 189 // pixels values but where still submitted. It is tracked based on 190 // comparing the MISR of the current frame vs previous frame. 191 optional uint32 total_duplicate_frames = 1; 192 193 // Stat reports whether there is any duplicate_frames tracked 194 optional uint32 duplicate_frames_logged = 2; 195 196 // Stat that reports the number of dpu underrrun occurs count. 197 optional uint32 total_dpu_underrun_count = 3; 198 199 200 message RefreshRateStat { 201 // The refresh rate value (the number of frames per second) 202 optional uint32 refresh_rate_fps = 1; 203 204 // Calculate the number of refresh rate switches to this fps 205 optional uint32 count = 2; 206 207 // Calculate the total duration of refresh rate stays at this fps 208 optional double total_dur_ms = 3; 209 210 // Calculate the average duration of refresh rate stays at this fps 211 optional double avg_dur_ms = 4; 212 } 213 214 // Calculate the total number of refresh rate changes 215 optional uint32 refresh_rate_switches = 4; 216 217 // The statistics for each refresh rate value 218 repeated RefreshRateStat refresh_rate_stats = 5; 219} 220 221// End of protos/perfetto/metrics/android/display_metrics.proto 222 223// Begin of protos/perfetto/metrics/android/dma_heap_metric.proto 224 225// dma-buf heap memory stats on Android. 226message AndroidDmaHeapMetric { 227 optional double avg_size_bytes = 1; 228 optional double min_size_bytes = 2; 229 optional double max_size_bytes = 3; 230 231 // Total allocation size. 232 // Essentially the sum of positive allocs. 233 optional double total_alloc_size_bytes = 4; 234} 235 236// End of protos/perfetto/metrics/android/dma_heap_metric.proto 237 238// Begin of protos/perfetto/metrics/android/dvfs_metric.proto 239 240message AndroidDvfsMetric { 241 242 message BandStat { 243 // Operating frequency 244 optional int32 freq_value = 1; 245 246 // Percentage of duration in this operating frequency compared to all frequencies 247 optional double percentage = 2; 248 249 // Total duration in ns when the state was in this operating frequency 250 optional int64 duration_ns = 3; 251 } 252 253 message FrequencyResidency { 254 // Frequency representative name 255 optional string freq_name = 1; 256 // Each band statistics meta 257 repeated BandStat band_stat = 2; 258 } 259 260 // Frequency residency metrics from clock_set_rate ftrace event. 261 repeated FrequencyResidency freq_residencies = 1; 262} 263 264// End of protos/perfetto/metrics/android/dvfs_metric.proto 265 266// Begin of protos/perfetto/metrics/android/fastrpc_metric.proto 267 268// fastrpc memory stats on Android. 269message AndroidFastrpcMetric { 270 message Subsystem { 271 optional string name = 1; 272 optional double avg_size_bytes = 2; 273 optional double min_size_bytes = 3; 274 optional double max_size_bytes = 4; 275 276 // Total allocation size. 277 // Essentially the sum of positive allocs. 278 optional double total_alloc_size_bytes = 5; 279 } 280 281 repeated Subsystem subsystem = 1; 282} 283 284// End of protos/perfetto/metrics/android/fastrpc_metric.proto 285 286// Begin of protos/perfetto/metrics/android/g2d_metric.proto 287 288message G2dMetrics { 289 message G2dInstance { 290 // G2d name. 291 optional string name = 1; 292 293 optional uint32 frame_count = 5; 294 optional uint32 error_count = 6; 295 296 optional double max_dur_ms = 7; 297 optional double min_dur_ms = 8; 298 optional double avg_dur_ms = 9; 299 300 // Removed: was int64 versions of max_dur_ns, min_dur_ns and avg_dur_ns. 301 reserved 2 to 4; 302 } 303 message G2dMetric { 304 // G2D Metric for each G2D Instance. 305 repeated G2dInstance instances = 1; 306 307 // the number of frames processed by G2D 308 optional uint32 frame_count = 5; 309 // the number of error events 310 optional uint32 error_count = 6; 311 312 // max/min/avg G2d frame durations for all instances. 313 optional double max_dur_ms = 7; 314 optional double min_dur_ms = 8; 315 optional double avg_dur_ms = 9; 316 317 // Removed: was int64 versions of max_dur_ns, min_dur_ns and avg_dur_ns. 318 reserved 2 to 4; 319 } 320 321 optional G2dMetric g2d_hw = 1; 322 optional G2dMetric g2d_sw = 2; 323} 324 325// End of protos/perfetto/metrics/android/g2d_metric.proto 326 327// Begin of protos/perfetto/metrics/android/gpu_metric.proto 328 329message AndroidGpuMetric { 330 message Process { 331 // Process name. 332 optional string name = 1; 333 334 // max/min/avg GPU memory used by this process. 335 optional int64 mem_max = 2; 336 optional int64 mem_min = 3; 337 optional int64 mem_avg = 4; 338 } 339 340 // GPU metric for processes using GPU. 341 repeated Process processes = 1; 342 343 // max/min/avg GPU memory used by the entire system. 344 optional int64 mem_max = 2; 345 optional int64 mem_min = 3; 346 optional int64 mem_avg = 4; 347 348 message FrequencyMetric { 349 // Identifier for GPU in a multi-gpu device. 350 optional uint32 gpu_id = 1; 351 352 // max/min/avg GPU frequency for this gpu_id 353 // the calculation of avg is weighted by the duration of each frequency 354 optional int64 freq_max = 2; 355 optional int64 freq_min = 3; 356 optional double freq_avg = 4; 357 358 message MetricsPerFrequency { 359 // Used frequency 360 optional int64 freq = 1; 361 362 // Total duration in ms when the state of GPU was in this frequency 363 optional double dur_ms = 2; 364 365 // Percentage of duration in this frequency compared to all frequencies 366 // in this gpu_id 367 optional double percentage = 3; 368 } 369 370 // Metrics for each used GPU frequency 371 repeated MetricsPerFrequency used_freqs = 5; 372 } 373 374 // GPU frequency metric for each gpu_id 375 repeated FrequencyMetric freq_metrics = 5; 376} 377 378// End of protos/perfetto/metrics/android/gpu_metric.proto 379 380// Begin of protos/perfetto/metrics/android/hwcomposer.proto 381 382message AndroidHwcomposerMetrics { 383 // Counts the number of composition total layers in the trace. (non-weighted average) 384 optional double composition_total_layers = 1; 385 386 // Counts the number of composition dpu layers in the trace. (non-weighted average) 387 optional double composition_dpu_layers = 2; 388 389 // Counts the number of composition gpu layers in the trace. (non-weighted average) 390 optional double composition_gpu_layers = 3; 391 392 // Counts the number of composition dpu cached layers in the trace. (non-weighted average) 393 optional double composition_dpu_cached_layers = 4; 394 395 // Counts the number of composition surfaceflinger cached layers in the trace. 396 // (non-weighted average) 397 optional double composition_sf_cached_layers = 5; 398 399 // Counts how many times validateDisplay is skipped. 400 optional int32 skipped_validation_count = 6; 401 402 // Counts how many times validateDisplay cannot be skipped. 403 optional int32 unskipped_validation_count = 7; 404 405 // Counts how many times validateDisplay is already separated from presentDisplay 406 // since the beginning. 407 optional int32 separated_validation_count = 8; 408 409 // Counts how many unhandled validation cases which might be caused by errors. 410 optional int32 unknown_validation_count = 9; 411 412 // the average of overall hwcomposer execution time. 413 optional double avg_all_execution_time_ms = 10; 414 415 // the average of hwcomposer execution time for skipped validation cases. 416 optional double avg_skipped_execution_time_ms = 11; 417 418 // the average of hwcomposer execution time for unskipped validation cases. 419 optional double avg_unskipped_execution_time_ms = 12; 420 421 // the average of hwcomposer execution time for separated validation cases. 422 optional double avg_separated_execution_time_ms = 13; 423 424 message DpuVoteMetrics { 425 // the thread ID that handles this track 426 optional uint32 tid = 1; 427 428 // the weighted average of DPU Vote Clock 429 optional double avg_dpu_vote_clock = 2; 430 431 // the weighted average of DPU Vote Avg Bandwidth 432 optional double avg_dpu_vote_avg_bw = 3; 433 434 // the weighted average of DPU Vote Peak Bandwidth 435 optional double avg_dpu_vote_peak_bw = 4; 436 437 // the weighted average of DPU Vote RT (Real Time) Bandwidth 438 optional double avg_dpu_vote_rt_bw = 5; 439 } 440 441 // DPU Vote Metrics for each thread track 442 repeated DpuVoteMetrics dpu_vote_metrics = 14; 443} 444 445// End of protos/perfetto/metrics/android/hwcomposer.proto 446 447// Begin of protos/perfetto/metrics/android/hwui_metric.proto 448 449// Android HWUI graphics performance and graphics memory usage metrics. 450message ProcessRenderInfo { 451 // Name of the package launched 452 optional string process_name = 1; 453 454 // CPU time spent on RenderThread in milliseconds. 455 optional int64 rt_cpu_time_ms = 2; 456 457 // Number of frames drawn on RenderThread, followed by max/min/avg CPU time to draw a frame 458 // in nanoseconds. 459 optional uint32 draw_frame_count = 3; 460 optional int64 draw_frame_max = 4; 461 optional int64 draw_frame_min = 5; 462 optional double draw_frame_avg = 6; 463 464 // Number of GPU commands flushes and max/min/avg time per flush in nanoseconds. 465 optional uint32 flush_count = 7; 466 optional int64 flush_max = 8; 467 optional int64 flush_min = 9; 468 optional double flush_avg = 10; 469 470 // Number of View tree preparation counts and max/min/avg time to traverse the tree in 471 // nanoseconds. 472 optional uint32 prepare_tree_count = 11; 473 optional int64 prepare_tree_max = 12; 474 optional int64 prepare_tree_min = 13; 475 optional double prepare_tree_avg = 14; 476 477 // Number of times the GPU rendered a frame and max/min/avg time for GPU to finish rendering in 478 // in nanoseconds. 479 optional uint32 gpu_completion_count = 15; 480 optional int64 gpu_completion_max = 16; 481 optional int64 gpu_completion_min = 17; 482 optional double gpu_completion_avg = 18; 483 484 // Number of times a frame was recorded/serialized in a display list on the UI thread with 485 // max/min/avg time in nanoseconds. 486 optional uint32 ui_record_count = 19; 487 optional int64 ui_record_max = 20; 488 optional int64 ui_record_min = 21; 489 optional double ui_record_avg = 22; 490 491 // number of unique shader programs that were used to render frames, followed by total and average 492 // times to prepare a shader in nanoseconds. 493 optional uint32 shader_compile_count = 23; 494 optional int64 shader_compile_time = 24; 495 optional double shader_compile_avg = 25; 496 // number of shader programs loaded from the disk cache, followed by total time and average time 497 // to prepare a shader in nanoseconds. 498 optional uint32 cache_hit_count = 26; 499 optional int64 cache_hit_time = 27; 500 optional double cache_hit_avg = 28; 501 // number of shader programs compiled/linked, followed by total time and average time to prepare 502 // a shader in nanoseconds. 503 optional uint32 cache_miss_count = 29; 504 optional int64 cache_miss_time = 30; 505 optional double cache_miss_avg = 31; 506 507 // max/min/avg CPU memory used for graphics by HWUI at the end of a frame. 508 optional int64 graphics_cpu_mem_max = 32; 509 optional int64 graphics_cpu_mem_min = 33; 510 optional double graphics_cpu_mem_avg = 34; 511 512 // max/min/avg GPU memory used by HWUI at the end of a frame excluding textures. 513 optional int64 graphics_gpu_mem_max = 35; 514 optional int64 graphics_gpu_mem_min = 36; 515 optional double graphics_gpu_mem_avg = 37; 516 517 // max/min/avg memory used for GPU textures by HWUI at the end of a frame. 518 optional int64 texture_mem_max = 38; 519 optional int64 texture_mem_min = 39; 520 optional double texture_mem_avg = 40; 521 522 // max/min/avg memory used by HWUI at the end of a frame. This is a sum of previous 3 categories. 523 optional int64 all_mem_max = 41; 524 optional int64 all_mem_min = 42; 525 optional double all_mem_avg = 43; 526} 527 528message AndroidHwuiMetric { 529 // HWUI metrics for processes that have a RenderThread. 530 repeated ProcessRenderInfo process_info = 1; 531} 532 533// End of protos/perfetto/metrics/android/hwui_metric.proto 534 535// Begin of protos/perfetto/metrics/android/ion_metric.proto 536 537// ion memory stats on Android. 538message AndroidIonMetric { 539 message Buffer { 540 optional string name = 1; 541 optional double avg_size_bytes = 2; 542 optional double min_size_bytes = 3; 543 optional double max_size_bytes = 4; 544 545 // Total allocation size. 546 // Essentially the sum of positive allocs (-> new buffers). 547 optional double total_alloc_size_bytes = 5; 548 } 549 550 repeated Buffer buffer = 1; 551} 552 553// End of protos/perfetto/metrics/android/ion_metric.proto 554 555// Begin of protos/perfetto/metrics/android/irq_runtime_metric.proto 556 557// measure max IRQ runtime and IRQ tasks running over threshold. 558message AndroidIrqRuntimeMetric { 559 message IrqSlice { 560 // IRQ name 561 optional string irq_name = 1; 562 // timestamp 563 optional int64 ts = 2; 564 // runtime of IRQ task 565 optional int64 dur = 3; 566 } 567 message ThresholdMetric { 568 // Threshold value 569 optional string threshold = 1; 570 // over threshold count 571 optional int64 over_threshold_count = 2; 572 // anomaly ratio (over threshold count / total count) 573 optional double anomaly_ratio= 3; 574 } 575 message IrqRuntimeMetric { 576 // max runtime of IRQ tasks 577 optional int64 max_runtime = 1; 578 // total IRQ tasks 579 optional int64 total_count = 2; 580 // over threshold metric 581 optional ThresholdMetric threshold_metric = 3; 582 // information for top 10 IRQ tasks 583 repeated IrqSlice longest_irq_slices = 4; 584 } 585 586 // metrics for hardirq and softirq 587 optional IrqRuntimeMetric hw_irq = 1; 588 optional IrqRuntimeMetric sw_irq = 2; 589} 590 591 592// End of protos/perfetto/metrics/android/irq_runtime_metric.proto 593 594// Begin of protos/perfetto/metrics/android/jank_metric.proto 595 596message AndroidJankMetrics { 597 repeated Warning warnings = 1; 598 599 message Warning { 600 optional int64 ts = 1; 601 optional int64 dur = 2; 602 603 optional string process_name = 3; 604 optional string warning_text = 4; 605 } 606} 607// End of protos/perfetto/metrics/android/jank_metric.proto 608 609// Begin of protos/perfetto/metrics/android/process_metadata.proto 610 611message AndroidProcessMetadata { 612 // Process name. Usually, cmdline or <package_name>(:<custom_name>)?. 613 optional string name = 1; 614 615 // User id under which this process runs. 616 optional int64 uid = 2; 617 618 // Package metadata from Android package list. 619 message Package { 620 optional string package_name = 1; 621 optional int64 apk_version_code = 2; 622 optional bool debuggable = 3; 623 } 624 625 // Package that this process belongs to. 626 // 627 // If this process shares its uid (see `packages_for_uid` field), the package 628 // is determined based on the process name and package name. If there is no 629 // match this field is empty. 630 optional Package package = 7; 631 632 // All packages using this uid. 633 // 634 // Shared uid documentation: 635 // https://developer.android.com/guide/topics/manifest/manifest-element#uid 636 repeated Package packages_for_uid = 8; 637 638 reserved 3, 4, 5, 6; 639} 640 641// End of protos/perfetto/metrics/android/process_metadata.proto 642 643// Begin of protos/perfetto/metrics/android/java_heap_histogram.proto 644 645message JavaHeapHistogram { 646 // Next id: 9 647 message TypeCount { 648 optional string type_name = 1; 649 optional string category = 4; 650 651 optional uint32 obj_count = 2; 652 optional uint32 reachable_obj_count = 3; 653 654 optional uint32 size_kb = 5; 655 optional uint32 reachable_size_kb = 6; 656 optional uint32 native_size_kb = 7; 657 optional uint32 reachable_native_size_kb = 8; 658 } 659 660 message Sample { 661 optional int64 ts = 1; 662 repeated TypeCount type_count = 2; 663 } 664 665 // Heap stats per process. One sample per dump (with continuous dump you can 666 // have more samples differentiated by ts). 667 message InstanceStats { 668 optional uint32 upid = 1; 669 optional AndroidProcessMetadata process = 2; 670 repeated Sample samples = 3; 671 } 672 673 repeated InstanceStats instance_stats = 1; 674} 675 676// End of protos/perfetto/metrics/android/java_heap_histogram.proto 677 678// Begin of protos/perfetto/metrics/android/java_heap_stats.proto 679 680message JavaHeapStats { 681 message HeapRoots { 682 optional string root_type = 1; 683 optional string type_name = 2; 684 optional int64 obj_count = 3; 685 } 686 687 // Next id: 10 688 message Sample { 689 optional int64 ts = 1; 690 // Size of the Java heap in bytes 691 optional int64 heap_size = 2; 692 // Native size of all the objects (not included in heap_size) 693 optional int64 heap_native_size = 8; 694 optional int64 obj_count = 4; 695 // Size of the reachable objects in bytes. 696 optional int64 reachable_heap_size = 3; 697 // Native size of all the reachable objects (not included in 698 // reachable_heap_size) 699 optional int64 reachable_heap_native_size = 9; 700 optional int64 reachable_obj_count = 5; 701 // Sum of anonymous RSS + swap pages in bytes. 702 optional int64 anon_rss_and_swap_size = 6; 703 704 // ART root objects 705 repeated HeapRoots roots = 7; 706 } 707 708 // Heap stats per process. One sample per dump (can be > 1 if continuous 709 // dump is enabled). 710 message InstanceStats { 711 optional uint32 upid = 1; 712 optional AndroidProcessMetadata process = 2; 713 repeated Sample samples = 3; 714 } 715 716 repeated InstanceStats instance_stats = 1; 717} 718 719// End of protos/perfetto/metrics/android/java_heap_stats.proto 720 721// Begin of protos/perfetto/metrics/android/lmk_metric.proto 722 723// LMK stats on Android. 724message AndroidLmkMetric { 725 message ByOomScore { 726 optional int32 oom_score_adj = 1; 727 optional int32 count = 2; 728 } 729 730 // Total count of LMK events observed in the trace. 731 optional int32 total_count = 1; 732 repeated ByOomScore by_oom_score = 2; 733 734 // OOM reaper kills. Enabled via the oom/mark_victim point. Should never 735 // happen. 736 optional int32 oom_victim_count = 3; 737} 738 739// End of protos/perfetto/metrics/android/lmk_metric.proto 740 741// Begin of protos/perfetto/metrics/android/lmk_reason_metric.proto 742 743// Global process state at LMK time, used to identify potential culprits. 744// TODO: rename to AndroidLmkProcessState 745message AndroidLmkReasonMetric { 746 message Process { 747 optional AndroidProcessMetadata process = 1; 748 749 // OOM score adj of the process. 750 optional int32 oom_score_adj = 2; 751 752 // RSS + swap. 753 optional int64 size = 3; 754 755 optional int64 file_rss_bytes = 4; 756 optional int64 anon_rss_bytes = 5; 757 optional int64 shmem_rss_bytes = 6; 758 optional int64 swap_bytes = 7; 759 } 760 message Lmk { 761 // OOM score adj of the LMK'ed process. 762 optional int32 oom_score_adj = 1; 763 764 // Total size of the ION heap in bytes during this LMK. 765 optional int64 ion_heaps_bytes = 4; 766 // Deprecated. Prefer ion_heaps_bytes. 767 optional int64 system_ion_heap_size = 2; 768 769 // Processes present during this LMK. 770 repeated Process processes = 3; 771 } 772 773 // LMKs present in the trace, ordered on their timestamp. 774 repeated Lmk lmks = 1; 775} 776 777// End of protos/perfetto/metrics/android/lmk_reason_metric.proto 778 779// Begin of protos/perfetto/metrics/android/mem_metric.proto 780 781// Memory metrics on Android. 782message AndroidMemoryMetric { 783 message ProcessMetrics { 784 optional string process_name = 1; 785 optional ProcessMemoryCounters total_counters = 2; 786 repeated PriorityBreakdown priority_breakdown = 3; 787 } 788 789 message PriorityBreakdown { 790 optional string priority = 1; 791 optional ProcessMemoryCounters counters = 2; 792 } 793 794 message ProcessMemoryCounters { 795 optional Counter anon_rss = 1; 796 optional Counter file_rss = 2; 797 optional Counter swap = 3; 798 optional Counter anon_and_swap = 4; 799 800 // Available when ART trace events are available. 801 optional Counter java_heap = 5; 802 } 803 804 message Counter { 805 optional double min = 1; 806 optional double max = 2; 807 optional double avg = 3; 808 809 // Memory growth observed in the counter sequence. In case of multiple 810 // processes with the same name, break ties using max. 811 optional double delta = 4; 812 } 813 814 // Process metrics, grouped by process name 815 repeated ProcessMetrics process_metrics = 1; 816} 817 818// End of protos/perfetto/metrics/android/mem_metric.proto 819 820// Begin of protos/perfetto/metrics/android/mem_unagg_metric.proto 821 822// Unaggregated memory metrics on Android. 823message AndroidMemoryUnaggregatedMetric { 824 message ProcessValues { 825 optional string process_name = 1; 826 optional ProcessMemoryValues mem_values = 2; 827 } 828 829 message ProcessMemoryValues { 830 repeated Value anon_rss = 1; 831 repeated Value file_rss = 2; 832 repeated Value swap = 3; 833 repeated Value anon_and_swap = 4; 834 } 835 836 message Value { 837 optional int64 ts = 1; 838 optional int32 oom_score = 2; 839 optional double value = 3; 840 } 841 842 // Process metrics for every process instance in trace. 843 repeated ProcessValues process_values = 1; 844} 845 846// End of protos/perfetto/metrics/android/mem_unagg_metric.proto 847 848// Begin of protos/perfetto/metrics/android/multiuser_metric.proto 849 850// Metrics for Multiuser events, such as switching users. 851message AndroidMultiuserMetric { 852 853 // Holds the data for a Multiuser event. 854 message EventData { 855 // Duration of the event (in milliseconds). 856 optional int32 duration_ms = 1; 857 858 // CPU usage of each process during the event. 859 message CpuUsage { 860 // The userId of the process (e.g. 0 or 10). 861 optional int32 user_id = 1; 862 // The name of the process. 863 optional string process_name = 2; 864 // The number of CPU cycles (in megacycles) spent by that process during the event. 865 optional int32 cpu_mcycles = 3; 866 // The ratio of this process's cycles to the total for all processes, expressed as a percentage. 867 optional float cpu_percentage = 4; 868 // General identifier for this usage source: determined from the process name, user, etc. 869 // Should be stable across multiple runs (i.e. does not print the user_id directly). 870 optional string identifier = 5; 871 } 872 repeated CpuUsage cpu_usage = 2; 873 } 874 875 // Metrics for a user switch. 876 optional EventData user_switch = 1; 877} 878// End of protos/perfetto/metrics/android/multiuser_metric.proto 879 880// Begin of protos/perfetto/metrics/android/network_metric.proto 881 882message AndroidNetworkMetric { 883 message PacketStatistic { 884 // Packet count. 885 optional int64 packets = 1; 886 887 // Packet Bytes. 888 optional int64 bytes = 2; 889 890 // Timestamp when first packet received or transmitted. 891 optional int64 first_packet_timestamp_ns = 3; 892 893 // Timestamp when last packet received or transmitted. 894 optional int64 last_packet_timestamp_ns = 4; 895 896 // Interval between first & last packet. The minimum interval is 10ms. 897 optional int64 interval_ns = 5; 898 899 // Data Speed. 900 optional double data_rate_kbps = 6; 901 } 902 903 message CorePacketStatistic { 904 optional uint32 id = 1; 905 optional PacketStatistic packet_statistic = 2; 906 } 907 908 message Rx { 909 // Total packets statistic. 910 optional PacketStatistic total = 1; 911 912 // Per core packets statistic. 913 repeated CorePacketStatistic core = 2; 914 915 // GRO aggregation ratio. 916 optional string gro_aggregation_ratio = 3; 917 } 918 919 message Tx { 920 // Total packets statistic. 921 optional PacketStatistic total = 1; 922 923 // Per core packets statistic. 924 repeated CorePacketStatistic core = 2; 925 } 926 927 message NetDevice { 928 // Network device name. 929 optional string name = 1; 930 931 // Ingress traffic statistic. 932 optional Rx rx = 2; 933 934 // Egress traffic statistic 935 optional Tx tx = 3; 936 } 937 938 message NetRxActionStatistic { 939 // SoftIrq NET_RX action count. 940 optional int64 count = 1; 941 942 // SoftIrq NET_RX action was running in millisecond. 943 optional double runtime_ms = 2; 944 945 // SoftIrq NET_RX action average running time. 946 optional double avg_runtime_ms = 3; 947 948 // CPU megacycles (i.e. cycles divided by 1e6). 949 optional int64 mcycles = 4; 950 951 // Average weighted CPU frequency by the time the NET_RX Action 952 // running at each frequency. 953 optional int64 avg_freq_khz = 5; 954 } 955 956 message CoreNetRxActionStatistic { 957 optional uint32 id = 1; 958 optional NetRxActionStatistic net_rx_action_statistic = 2; 959 } 960 961 message NetRxAction { 962 // Total NET_RX action statistics. 963 optional NetRxActionStatistic total = 1; 964 965 // Per core NET_RX action statistics. 966 repeated CoreNetRxActionStatistic core = 2; 967 968 // The average packet time moves through the kernel stack. 969 optional double avg_interstack_latency_ms = 3; 970 } 971 972 // Network device metrics. 973 repeated NetDevice net_devices = 1; 974 975 // SoftIrq NET_RX action metrics. 976 optional NetRxAction net_rx_action = 2; 977 978 // Packet retransmission rate. 979 optional double retransmission_rate = 3; 980 981 // Kfree Skb rate (i.e. kfree_skb count divided by the packet count from all 982 // net devices). 983 optional double kfree_skb_rate = 4; 984} 985 986// End of protos/perfetto/metrics/android/network_metric.proto 987 988// Begin of protos/perfetto/metrics/android/other_traces.proto 989 990message AndroidOtherTracesMetric { 991 // Uuids of other traces being finalized while the current trace was being 992 // recorded. 993 repeated string finalized_traces_uuid = 1; 994} 995 996// End of protos/perfetto/metrics/android/other_traces.proto 997 998// Begin of protos/perfetto/metrics/android/package_list.proto 999 1000message AndroidPackageList { 1001 message Package { 1002 optional string package_name = 1; 1003 optional int64 uid = 2; 1004 optional int64 version_code = 3; 1005 } 1006 1007 repeated Package packages = 1; 1008} 1009 1010// End of protos/perfetto/metrics/android/package_list.proto 1011 1012// Begin of protos/perfetto/metrics/android/powrails_metric.proto 1013 1014message AndroidPowerRails { 1015 // Energy data per Power Rail at given ts. 1016 message EnergyData { 1017 // Time since device boot(CLOCK_BOTTOMTIME) in milli-seconds. 1018 optional int64 timestamp_ms = 1; 1019 // Accumulated energy since device boot in microwatt-seconds(uws). 1020 optional double energy_uws = 2; 1021 } 1022 1023 message PowerRails { 1024 // Name of the rail. 1025 optional string name = 1; 1026 // Energy data for given rail and for all samples in the trace. 1027 repeated EnergyData energy_data = 2; 1028 // The average used power between the first and the last sampled 1029 // energy data in miliwatt (mw) 1030 optional double avg_used_power_mw = 3; 1031 } 1032 1033 // Energy data per Power Rail. 1034 repeated PowerRails power_rails = 1; 1035} 1036// End of protos/perfetto/metrics/android/powrails_metric.proto 1037 1038// Begin of protos/perfetto/metrics/android/profiler_smaps.proto 1039 1040message ProfilerSmaps { 1041 message Mapping { 1042 optional string path = 1; 1043 optional int32 size_kb = 2; 1044 optional int32 private_dirty_kb = 3; 1045 optional int32 swap_kb = 4; 1046 } 1047 1048 message Instance { 1049 optional AndroidProcessMetadata process = 1; 1050 repeated Mapping mappings = 2; 1051 } 1052 1053 repeated Instance instance = 1; 1054} 1055 1056// End of protos/perfetto/metrics/android/profiler_smaps.proto 1057 1058// Begin of protos/perfetto/metrics/android/rt_runtime_metric.proto 1059 1060// measure max RT runtime and RT tasks running over 5ms. 1061message AndroidRtRuntimeMetric { 1062 message RtSlice { 1063 // thread name 1064 optional string tname = 1; 1065 // timestamp 1066 optional int64 ts = 2; 1067 // runtime of RT task 1068 optional int64 dur = 3; 1069 } 1070 1071 // max runtime of RT tasks 1072 optional int64 max_runtime = 1; 1073 // how many RT tasks are over 5ms. 1074 optional int64 over_5ms_count = 2; 1075 // information for top 10 RT tasks 1076 repeated RtSlice longest_rt_slices = 3; 1077} 1078 1079 1080// End of protos/perfetto/metrics/android/rt_runtime_metric.proto 1081 1082// Begin of protos/perfetto/metrics/android/simpleperf.proto 1083 1084// Metric that stores information related to atrace events generated by 1085// simpleperf tool 1086message AndroidSimpleperfMetric { 1087 optional double urgent_ratio = 1; 1088} 1089 1090// End of protos/perfetto/metrics/android/simpleperf.proto 1091 1092// Begin of protos/perfetto/metrics/android/startup_metric.proto 1093 1094// Android app startup metrics. 1095message AndroidStartupMetric { 1096 // A simplified view of the task state durations for a thread 1097 // and a span of time. 1098 message TaskStateBreakdown { 1099 optional int64 running_dur_ns = 1; 1100 optional int64 runnable_dur_ns = 2; 1101 optional int64 uninterruptible_sleep_dur_ns = 3; 1102 optional int64 interruptible_sleep_dur_ns = 4; 1103 } 1104 1105 message McyclesByCoreType { 1106 optional int64 little = 1; 1107 optional int64 big = 2; 1108 optional int64 bigger = 3; 1109 optional int64 unknown = 4; 1110 } 1111 1112 message Slice { 1113 optional int64 dur_ns = 1; 1114 optional double dur_ms = 2; 1115 } 1116 1117 // Timing information spanning the intent received by the 1118 // activity manager to the first frame drawn. 1119 // Next id: 31. 1120 message ToFirstFrame { 1121 // The duration between the intent received and first frame. 1122 optional int64 dur_ns = 1; 1123 optional double dur_ms = 17; 1124 1125 // Breakdown of time to first frame by task state for the main thread of 1126 // the process starting up. 1127 optional TaskStateBreakdown main_thread_by_task_state = 2; 1128 1129 // The mcycles taken by this startup across all CPUs (broken down by core 1130 // type). 1131 optional McyclesByCoreType mcycles_by_core_type = 26; 1132 1133 // In this timespan, how many processes (apart from the main activity) were 1134 // spawned. 1135 optional uint32 other_processes_spawned_count = 3; 1136 1137 // Total time spent in activity manager between the initial intent 1138 // and the end of the activity starter. 1139 optional Slice time_activity_manager = 4; 1140 1141 // The following slices follow the typical steps post-fork. 1142 optional Slice time_activity_thread_main = 5; 1143 optional Slice time_bind_application = 6; 1144 optional Slice time_activity_start = 7; 1145 optional Slice time_activity_resume = 8; 1146 optional Slice time_activity_restart = 21; 1147 optional Slice time_choreographer = 9; 1148 optional Slice time_inflate = 22; 1149 optional Slice time_get_resources = 23; 1150 1151 // If we are starting a new process, record the duration from the 1152 // intent being received to the time we call the zygote. 1153 optional Slice time_before_start_process = 10; 1154 1155 // The actual duration of the process start (based on the zygote slice). 1156 optional Slice time_during_start_process = 11; 1157 1158 optional Slice to_post_fork = 18; 1159 optional Slice to_activity_thread_main = 19; 1160 optional Slice to_bind_application = 20; 1161 1162 optional Slice time_post_fork = 16; 1163 1164 // The total time spent on opening dex files. 1165 optional Slice time_dex_open = 24; 1166 // Total time spent verifying classes during app startup. 1167 optional Slice time_verify_class = 25; 1168 1169 // Number of methods that were compiled by JIT during app startup. 1170 optional uint32 jit_compiled_methods = 27; 1171 1172 // Time spent running CPU on jit thread pool. 1173 optional Slice time_jit_thread_pool_on_cpu = 28; 1174 1175 // Time spent on garbage collection. 1176 optional Slice time_gc_total = 29; 1177 optional Slice time_gc_on_cpu = 30; 1178 // Deprecated was other_process_to_activity_cpu_ratio 1179 reserved 12; 1180 1181 // Removed: was uint32 versions of to_post_fork, to_activity_thread_main and 1182 // to_bind_application. 1183 reserved 13, 14, 15; 1184 } 1185 1186 // Metrics about startup which were developed by looking at experiments using 1187 // high-speed cameras (HSC). 1188 message HscMetrics { 1189 // The duration of the full "startup" as defined by HSC tests. 1190 optional Slice full_startup = 1; 1191 } 1192 1193 message Activity { 1194 optional string name = 1; 1195 optional string method = 2; 1196 optional int64 ts_method_start = 4; 1197 1198 // Field 3 contained Slice with a sum of durations for matching slices. 1199 reserved 3; 1200 } 1201 1202 message BinderTransaction { 1203 optional Slice duration = 1; 1204 optional string thread = 2; 1205 optional string destination_thread = 3; 1206 optional string destination_process = 4; 1207 // From 1208 // https://cs.android.com/android/platform/superproject/+/master:external/perfetto/protos/perfetto/trace/ftrace/binder.proto;l=15;drc=7b6a788162a30802f4c9d8d7a30a54e25edd30f1 1209 optional string flags = 5; 1210 // From 1211 // https://cs.android.com/android/platform/superproject/+/master:external/perfetto/protos/perfetto/trace/ftrace/binder.proto;l=14;drc=7b6a788162a30802f4c9d8d7a30a54e25edd30f1 1212 optional string code = 6; 1213 // From 1214 // https://cs.android.com/android/platform/superproject/+/master:external/perfetto/protos/perfetto/trace/ftrace/binder.proto;l=37;drc=7b6a788162a30802f4c9d8d7a30a54e25edd30f1 1215 optional int64 data_size = 7; 1216 } 1217 1218 // Metrics with information about the status of odex files and the outcome 1219 // of the loading process. 1220 // Multiple files might be loaded for a single startup. Platform might also 1221 // decide to discard an odex file and instead load a fallback, for example 1222 // in case the OS or apk were updated. 1223 message OptimizationStatus { 1224 optional string odex_status = 1; 1225 optional string compilation_filter = 2; 1226 optional string compilation_reason = 3; 1227 optional string location = 4; 1228 } 1229 1230 // Contains timestamps of important events which occurred during the 1231 // startup. 1232 message EventTimestamps { 1233 optional int64 intent_received = 1; 1234 optional int64 first_frame = 2; 1235 } 1236 1237 // Next id: 15 1238 message Startup { 1239 // Random id uniquely identifying an app startup in this trace. 1240 optional uint32 startup_id = 1; 1241 1242 // Name of the package launched 1243 optional string package_name = 2; 1244 1245 // Name of the process launched 1246 optional string process_name = 3; 1247 1248 // Details about the activities launched 1249 repeated Activity activities = 11; 1250 1251 // Details about slow binder transactions during the startup. The definition 1252 // of a slow transaction is an implementation detail. 1253 repeated BinderTransaction long_binder_transactions = 14; 1254 1255 // Did we ask the zygote for a new process 1256 optional bool zygote_new_process = 4; 1257 1258 // Number of processes hosting the activity involved in the launch. 1259 // This will usually be 1. If it is 0, it is indicative of a data / process 1260 // error. If > 1, the process died during startup and the system respawned 1261 // it. 1262 optional uint32 activity_hosting_process_count = 6; 1263 1264 // Contains timestamps of important events which happened during 1265 // the startup. 1266 optional EventTimestamps event_timestamps = 13; 1267 1268 // Timing information spanning the intent received by the 1269 // activity manager to the first frame drawn. 1270 optional ToFirstFrame to_first_frame = 5; 1271 1272 // Details about the process (uid, version, etc) 1273 optional AndroidProcessMetadata process = 7; 1274 1275 // Metrics about startup which were developed by looking at experiments 1276 // using high-speed cameras (HSC). 1277 optional HscMetrics hsc = 8; 1278 1279 // The time taken in the startup from intent recieved to the start time 1280 // of the reportFullyDrawn slice. This should be longer than the time to 1281 // first frame as the application decides this after it starts rendering. 1282 optional Slice report_fully_drawn = 9; 1283 1284 // Conntains information about the status of odex files. 1285 repeated OptimizationStatus optimization_status = 12; 1286 1287 reserved 10; 1288 } 1289 1290 repeated Startup startup = 1; 1291} 1292 1293// End of protos/perfetto/metrics/android/startup_metric.proto 1294 1295// Begin of protos/perfetto/metrics/android/surfaceflinger.proto 1296 1297message AndroidSurfaceflingerMetric { 1298 // Counts the number of missed frames in the trace. 1299 optional uint32 missed_frames = 1; 1300 1301 // Counts the number of missed HWC frames in the trace. 1302 optional uint32 missed_hwc_frames = 2; 1303 1304 // Counts the number of missed GPU frames in the trace. 1305 optional uint32 missed_gpu_frames = 3; 1306 1307 // Calculate the number of missed frames divided by 1308 // total frames 1309 optional double missed_frame_rate = 4; 1310 1311 // Calculate the number of missed HWC frames divided by 1312 // total HWC frames 1313 optional double missed_hwc_frame_rate = 5; 1314 1315 // Calculate the number of missed GPU frames divided by 1316 // total GPU frames 1317 optional double missed_gpu_frame_rate = 6; 1318 1319 // Count the number of times SurfaceFlinger needs to invoke GPU 1320 // for rendering some layers 1321 optional uint32 gpu_invocations = 7; 1322 1323 // Calculate the average duration of GPU request by SurfaceFlinger 1324 // since it enters the FenceMonitor's queue until it gets completed 1325 optional double avg_gpu_waiting_dur_ms = 8; 1326 1327 // Calculate the total duration when there is at least one GPU request 1328 // by SurfaceFlinger that is still waiting for GPU to complete the 1329 // request. 1330 // This also equals to the total duration of 1331 // "waiting for GPU completion <fence_num>" in SurfaceFlinger. 1332 optional double total_non_empty_gpu_waiting_dur_ms = 9; 1333} 1334 1335// End of protos/perfetto/metrics/android/surfaceflinger.proto 1336 1337// Begin of protos/perfetto/metrics/android/sysui_cuj_metrics.proto 1338 1339// Metric that stores frame information and potential jank root causes 1340// for a single Android system UI interaction/user journey. 1341message AndroidSysUiCujMetrics { 1342 // A list of all frames within the SysUi user journey. 1343 repeated Frame frames = 1; 1344 1345 optional string cuj_name = 2; 1346 optional int64 cuj_start = 3; 1347 optional int64 cuj_dur = 4; 1348 1349 // Details about the process (uid, version, etc) 1350 optional AndroidProcessMetadata process = 5; 1351 1352 message Frame { 1353 // Index of the frame within the single user journey. 1354 optional int64 number = 1; 1355 optional int64 vsync = 5; 1356 optional int64 ts = 2; 1357 optional int64 dur = 3; 1358 1359 // A list of identified potential causes for jank. 1360 // Optional. 1361 repeated string jank_cause = 4; 1362 } 1363} 1364 1365// End of protos/perfetto/metrics/android/sysui_cuj_metrics.proto 1366 1367// Begin of protos/perfetto/metrics/android/task_names.proto 1368 1369message AndroidTaskNames { 1370 message Process { 1371 optional int64 pid = 1; 1372 1373 // Process name. 1374 optional string process_name = 2; 1375 1376 // Names of all threads for this process. 1377 repeated string thread_name = 3; 1378 1379 // User id under which this process runs. 1380 optional int64 uid = 4; 1381 1382 // Packages matching the process uid. 1383 repeated string uid_package_name = 5; 1384 } 1385 1386 repeated Process process = 1; 1387} 1388 1389// End of protos/perfetto/metrics/android/task_names.proto 1390 1391// Begin of protos/perfetto/metrics/android/thread_time_in_state_metric.proto 1392 1393message AndroidThreadTimeInStateMetric { 1394 message MetricsByCoreType { 1395 optional int32 time_in_state_cpu = 5; 1396 optional string core_type = 1; 1397 1398 optional int64 runtime_ms = 2; 1399 // CPU megacycles (i.e. cycles divided by 1e6). 1400 optional int64 mcycles = 3; 1401 // Power cost as predicted by the power profile. 1402 optional double power_profile_mah = 4; 1403 } 1404 1405 message Thread { 1406 optional string name = 1; 1407 optional bool main_thread = 3; 1408 repeated MetricsByCoreType metrics_by_core_type = 2; 1409 } 1410 1411 message Process { 1412 optional AndroidProcessMetadata metadata = 1; 1413 repeated MetricsByCoreType metrics_by_core_type = 2; 1414 repeated Thread threads = 3; 1415 } 1416 1417 repeated Process processes = 1; 1418} 1419 1420// End of protos/perfetto/metrics/android/thread_time_in_state_metric.proto 1421 1422// Begin of protos/perfetto/metrics/android/trace_quality.proto 1423 1424// Metric which checks the data in the trace processor tables is "reasonble" 1425// (i.e. we would expect to see it from a real device). 1426// 1427// This is useful to reject traces which may be valid (so no stat would be 1428// recorded) but a human would find the trace nonsensical. 1429message AndroidTraceQualityMetric { 1430 message Failure { 1431 // The name of the failed check. 1432 optional string name = 1; 1433 } 1434 repeated Failure failures = 1; 1435} 1436// End of protos/perfetto/metrics/android/trace_quality.proto 1437 1438// Begin of protos/perfetto/metrics/android/unsymbolized_frames.proto 1439 1440message UnsymbolizedFrames { 1441 message Frame { 1442 optional string module = 1; 1443 optional string build_id = 2; 1444 optional int64 address = 3; 1445 1446 // In some cases (Chrome/Webview) the ID that should be used to query 1447 // symbols in Google's internal tera-scale symbolization service is != 1448 // `build_id` and requires some mangling. 1449 // This field is == 'build_id` for non-chromium cases, and is the breakpad 1450 // module ID (with lowercase hex digics) for chromium cases. 1451 optional string google_lookup_id = 4; 1452 } 1453 1454 repeated Frame frames = 1; 1455} 1456 1457// End of protos/perfetto/metrics/android/unsymbolized_frames.proto 1458 1459// Begin of protos/perfetto/metrics/metrics.proto 1460 1461// Trace processor metadata 1462message TraceMetadata { 1463 reserved 1; 1464 optional int64 trace_duration_ns = 2; 1465 optional string trace_uuid = 3; 1466 optional string android_build_fingerprint = 4; 1467 optional int64 statsd_triggering_subscription_id = 5; 1468 optional int64 trace_size_bytes = 6; 1469 repeated string trace_trigger = 7; 1470 optional string unique_session_name = 8; 1471 optional string trace_config_pbtxt = 9; 1472 optional int64 sched_duration_ns = 10; 1473} 1474 1475// Stats counters for the trace. 1476// Defined in src/trace_processor/storage/stats.h 1477message TraceAnalysisStats { 1478 enum Severity { 1479 SEVERITY_UNKNOWN = 0; 1480 SEVERITY_INFO = 1; 1481 SEVERITY_DATA_LOSS = 2; 1482 SEVERITY_ERROR = 3; 1483 } 1484 1485 enum Source { 1486 SOURCE_UNKNOWN = 0; 1487 SOURCE_TRACE = 1; 1488 SOURCE_ANALYSIS = 2; 1489 } 1490 1491 message Stat { 1492 optional string name = 1; 1493 optional uint32 idx = 2; 1494 optional Severity severity = 3; 1495 optional Source source = 4; 1496 1497 optional int64 count = 5; 1498 } 1499 1500 repeated Stat stat = 1; 1501} 1502 1503// Root message for all Perfetto-based metrics. 1504// 1505// Next id: 46 1506message TraceMetrics { 1507 reserved 4, 10, 13, 14, 16, 19; 1508 1509 // Battery counters metric on Android. 1510 optional AndroidBatteryMetric android_batt = 5; 1511 1512 // CPU usage per trace, process and thread. 1513 optional AndroidCpuMetric android_cpu = 6; 1514 1515 // Memory metrics on Android (owned by the Android Telemetry team). 1516 optional AndroidMemoryMetric android_mem = 1; 1517 1518 // Memory metrics on Android in unaggregated form. (owned by the Android 1519 // Telemetry team). 1520 // Note: this generates a lot of data so should not be requested unless it 1521 // is clear that this data is necessary. 1522 optional AndroidMemoryUnaggregatedMetric android_mem_unagg = 11; 1523 1524 // Package list. 1525 optional AndroidPackageList android_package_list = 12; 1526 1527 // ion buffer memory metrics. 1528 optional AndroidIonMetric android_ion = 9; 1529 1530 // fastrpc subsystem memory metrics. 1531 optional AndroidFastrpcMetric android_fastrpc = 31; 1532 1533 // Statistics about low memory kills. 1534 optional AndroidLmkMetric android_lmk = 8; 1535 1536 // Power Rails metrics on Android. 1537 optional AndroidPowerRails android_powrails = 7; 1538 1539 // Startup metrics on Android (owned by the Android Telemetry team). 1540 optional AndroidStartupMetric android_startup = 2; 1541 1542 // Trace metadata (applicable to all traces). 1543 optional TraceMetadata trace_metadata = 3; 1544 1545 // Trace stats (applicable to all traces). 1546 optional TraceAnalysisStats trace_stats = 33; 1547 1548 // Returns stack frames missing symbols. 1549 optional UnsymbolizedFrames unsymbolized_frames = 15; 1550 1551 // If the trace contains a heap graph, output allocation statistics. 1552 optional JavaHeapStats java_heap_stats = 17; 1553 1554 // If the trace contains a heap graph, output histogram. 1555 optional JavaHeapHistogram java_heap_histogram = 21; 1556 1557 // Metrics used to find potential culprits of low-memory kills. 1558 optional AndroidLmkReasonMetric android_lmk_reason = 18; 1559 1560 optional AndroidHwuiMetric android_hwui_metric = 20; 1561 1562 optional AndroidDisplayMetrics display_metrics = 22; 1563 1564 optional AndroidTaskNames android_task_names = 23; 1565 1566 optional AndroidThreadTimeInStateMetric android_thread_time_in_state = 24; 1567 1568 // Metric associated with surfaceflinger. 1569 optional AndroidSurfaceflingerMetric android_surfaceflinger = 25; 1570 1571 // GPU metrics on Android. 1572 optional AndroidGpuMetric android_gpu = 26; 1573 1574 // Frame timing and jank root causes for system UI interactions. 1575 optional AndroidSysUiCujMetrics android_sysui_cuj = 27; 1576 1577 // Metric associated with hwcomposer. 1578 optional AndroidHwcomposerMetrics android_hwcomposer = 28; 1579 1580 // Detects common bad patterns that might lead to jank. 1581 optional AndroidJankMetrics android_jank = 29; 1582 1583 // G2D metrics. 1584 optional G2dMetrics g2d = 30; 1585 1586 // Dmabuf heap metrics. 1587 optional AndroidDmaHeapMetric android_dma_heap = 32; 1588 1589 // Metric to verify the quality of the trace. 1590 optional AndroidTraceQualityMetric android_trace_quality = 34; 1591 1592 // Profiler smaps 1593 optional ProfilerSmaps profiler_smaps = 35; 1594 1595 // Multiuser - metrics for switching users. 1596 optional AndroidMultiuserMetric android_multiuser = 36; 1597 1598 // Metrics related to simpleperf tool 1599 optional AndroidSimpleperfMetric android_simpleperf = 37; 1600 1601 // Metrics for the Camera team. 1602 optional AndroidCameraMetric android_camera = 38; 1603 1604 // Metrics for dynamic voltage and frequency scaling. 1605 optional AndroidDvfsMetric android_dvfs = 39; 1606 1607 // Metrics for network performance. 1608 optional AndroidNetworkMetric android_netperf = 40; 1609 1610 // Metrics for the Camera team. 1611 // Note: this generates a lot of data so should not be requested unless it 1612 // is clear that this data is necessary. 1613 optional AndroidCameraUnaggregatedMetric android_camera_unagg = 41; 1614 1615 // Metrics for RT runtime. 1616 optional AndroidRtRuntimeMetric android_rt_runtime = 42; 1617 1618 // Metrics for IRQ runtime. 1619 optional AndroidIrqRuntimeMetric android_irq_runtime = 43; 1620 1621 // Metrics for the Trusty team. 1622 optional AndroidTrustyWorkqueues android_trusty_workqueues = 44; 1623 1624 // Summary of other concurrent trace recording. 1625 optional AndroidOtherTracesMetric android_other_traces = 45; 1626 1627 // Demo extensions. 1628 extensions 450 to 499; 1629 1630 // Vendor extensions. 1631 extensions 500 to 1000; 1632 1633 // Chrome metrics. 1634 extensions 1001 to 2000; 1635} 1636 1637// End of protos/perfetto/metrics/metrics.proto 1638