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 14// Begin of protos/perfetto/metrics/android/batt_metric.proto 15 16message AndroidBatteryMetric { 17 message BatteryCounters { 18 // Timestamp measured from boot time [ns]. 19 optional int64 timestamp_ns = 1; 20 // Fields 2-5 are the same as in BatteryCounters proto in TracePacket. 21 optional double charge_counter_uah = 2; 22 optional float capacity_percent = 3; 23 optional double current_ua = 4; 24 optional double current_avg_ua = 5; 25 } 26 27 message BatteryAggregates { 28 // Field numbers for these 3 == the int values from Android 29 optional int64 total_screen_off_ns = 1; 30 optional int64 total_screen_on_ns = 2; 31 optional int64 total_screen_doze_ns = 3; 32 // Total time a wakelock was held 33 optional int64 total_wakelock_ns = 4; 34 // Amount of time the device was suspended. Depends on the ftrace source 35 // "power/suspend_resume". 36 optional int64 sleep_ns = 5; 37 optional int64 sleep_screen_off_ns = 6; 38 optional int64 sleep_screen_on_ns = 7; 39 optional int64 sleep_screen_doze_ns = 8; 40 } 41 42 // Period of time during the trace that the device went to sleep completely. 43 message SuspendPeriod { 44 optional int64 timestamp_ns = 1; 45 optional int64 duration_ns = 2; 46 } 47 48 // Battery counters info for each ts of the trace. This should only be 49 // extracted for short traces. 50 repeated BatteryCounters battery_counters = 1; 51 52 optional BatteryAggregates battery_aggregates = 2; 53 54 repeated SuspendPeriod suspend_period = 3; 55} 56 57// End of protos/perfetto/metrics/android/batt_metric.proto 58 59// Begin of protos/perfetto/metrics/android/cpu_metric.proto 60 61message AndroidCpuMetric { 62 // Next id: 6 63 message Metrics { 64 // CPU megacycles (i.e. cycles divided by 1e6). 65 optional int64 mcycles = 1; 66 67 // Total time the thread was running for this breakdown in 68 // nanoseconds. 69 optional int64 runtime_ns = 2; 70 71 // Min/max/average CPU frequency weighted by the time the CPU was 72 // running at each frequency in this breakdown. 73 optional int64 min_freq_khz = 3; 74 optional int64 max_freq_khz = 4; 75 optional int64 avg_freq_khz = 5; 76 } 77 78 // Next id: 7 79 message CoreData { 80 optional uint32 id = 1; 81 optional Metrics metrics = 6; 82 83 reserved 2 to 5; 84 } 85 86 // Next id: 3 87 message CoreTypeData { 88 optional string type = 1; 89 optional Metrics metrics = 2; 90 } 91 92 // Next id: 7 93 message Thread { 94 optional string name = 1; 95 optional Metrics metrics = 4; 96 97 // Breakdowns of above metrics. 98 repeated CoreData core = 2; 99 repeated CoreTypeData core_type = 5; 100 101 reserved 3; 102 } 103 104 // Next id: 8 105 message Process { 106 optional string name = 1; 107 optional Metrics metrics = 4; 108 109 // Breakdowns of above metrics. 110 repeated Thread threads = 6; 111 repeated CoreData core = 7; 112 repeated CoreTypeData core_type = 5; 113 114 reserved 3; 115 } 116 117 repeated Process process_info = 1; 118} 119 120// End of protos/perfetto/metrics/android/cpu_metric.proto 121 122// Begin of protos/perfetto/metrics/android/display_metrics.proto 123 124message AndroidDisplayMetrics { 125 // Stat that reports the number of duplicate frames submitted 126 // to the display for rendering. That is frames that have the same 127 // pixels values but where still submitted. It is tracked based on 128 // comparing the MISR of the current frame vs previous frame. 129 optional uint32 total_duplicate_frames = 1; 130 131 // Stat reports whether there is any duplicate_frames tracked 132 optional uint32 duplicate_frames_logged = 2; 133 134 // Stat that reports the number of dpu underrrun occurs count. 135 optional uint32 total_dpu_underrun_count = 3; 136 137 138 message RefreshRateStat { 139 // The refresh rate value (the number of frames per second) 140 optional uint32 refresh_rate_fps = 1; 141 142 // Calculate the number of refresh rate switches to this fps 143 optional uint32 count = 2; 144 145 // Calculate the total duration of refresh rate stays at this fps 146 optional double total_dur_ms = 3; 147 148 // Calculate the average duration of refresh rate stays at this fps 149 optional double avg_dur_ms = 4; 150 } 151 152 // Calculate the total number of refresh rate changes 153 optional uint32 refresh_rate_switches = 4; 154 155 // The statistics for each refresh rate value 156 repeated RefreshRateStat refresh_rate_stats = 5; 157} 158 159// End of protos/perfetto/metrics/android/display_metrics.proto 160 161// Begin of protos/perfetto/metrics/android/dma_heap_metric.proto 162 163// dma-buf heap memory stats on Android. 164message AndroidDmaHeapMetric { 165 optional double avg_size_bytes = 1; 166 optional double min_size_bytes = 2; 167 optional double max_size_bytes = 3; 168 169 // Total allocation size. 170 // Essentially the sum of positive allocs. 171 optional double total_alloc_size_bytes = 4; 172} 173 174// End of protos/perfetto/metrics/android/dma_heap_metric.proto 175 176// Begin of protos/perfetto/metrics/android/fastrpc_metric.proto 177 178// fastrpc memory stats on Android. 179message AndroidFastrpcMetric { 180 message Subsystem { 181 optional string name = 1; 182 optional double avg_size_bytes = 2; 183 optional double min_size_bytes = 3; 184 optional double max_size_bytes = 4; 185 186 // Total allocation size. 187 // Essentially the sum of positive allocs. 188 optional double total_alloc_size_bytes = 5; 189 } 190 191 repeated Subsystem subsystem = 1; 192} 193 194// End of protos/perfetto/metrics/android/fastrpc_metric.proto 195 196// Begin of protos/perfetto/metrics/android/g2d_metric.proto 197 198message G2dMetrics { 199 message G2dInstance { 200 // G2d name. 201 optional string name = 1; 202 203 optional int64 max_dur_ns = 2; 204 optional int64 min_dur_ns = 3; 205 optional int64 avg_dur_ns = 4; 206 optional uint32 frame_count = 5; 207 optional uint32 error_count = 6; 208 } 209 message G2dMetric { 210 // G2D Metric for each G2D Instance. 211 repeated G2dInstance instances = 1; 212 213 // max/min/avg G2d frame durations for all instances. 214 optional int64 max_dur_ns = 2; 215 optional int64 min_dur_ns = 3; 216 optional int64 avg_dur_ns = 4; 217 218 // the number of frames processed by G2D 219 optional uint32 frame_count = 5; 220 // the number of error events 221 optional uint32 error_count = 6; 222 } 223 224 optional G2dMetric g2d_hw = 1; 225 optional G2dMetric g2d_sw = 2; 226} 227 228// End of protos/perfetto/metrics/android/g2d_metric.proto 229 230// Begin of protos/perfetto/metrics/android/gpu_metric.proto 231 232message AndroidGpuMetric { 233 message Process { 234 // Process name. 235 optional string name = 1; 236 237 // max/min/avg GPU memory used by this process. 238 optional int64 mem_max = 2; 239 optional int64 mem_min = 3; 240 optional int64 mem_avg = 4; 241 } 242 243 // GPU metric for processes using GPU. 244 repeated Process processes = 1; 245 246 // max/min/avg GPU memory used by the entire system. 247 optional int64 mem_max = 2; 248 optional int64 mem_min = 3; 249 optional int64 mem_avg = 4; 250} 251 252// End of protos/perfetto/metrics/android/gpu_metric.proto 253 254// Begin of protos/perfetto/metrics/android/hwcomposer.proto 255 256message AndroidHwcomposerMetrics { 257 // Counts the number of composition total layers in the trace. (non-weighted average) 258 optional double composition_total_layers = 1; 259 260 // Counts the number of composition dpu layers in the trace. (non-weighted average) 261 optional double composition_dpu_layers = 2; 262 263 // Counts the number of composition gpu layers in the trace. (non-weighted average) 264 optional double composition_gpu_layers = 3; 265 266 // Counts the number of composition dpu cached layers in the trace. (non-weighted average) 267 optional double composition_dpu_cached_layers = 4; 268 269 // Counts the number of composition surfaceflinger cached layers in the trace. 270 // (non-weighted average) 271 optional double composition_sf_cached_layers = 5; 272 273 // Counts how many times validateDisplay is skipped. 274 optional int32 skipped_validation_count = 6; 275 276 // Counts how many times validateDisplay cannot be skipped. 277 optional int32 unskipped_validation_count = 7; 278 279 // Counts how many times validateDisplay is already separated from presentDisplay 280 // since the beginning. 281 optional int32 separated_validation_count = 8; 282 283 // Counts how many unhandled validation cases which might be caused by errors. 284 optional int32 unknown_validation_count = 9; 285 286 // the average of overall hwcomposer execution time. 287 optional double avg_all_execution_time_ms = 10; 288 289 // the average of hwcomposer execution time for skipped validation cases. 290 optional double avg_skipped_execution_time_ms = 11; 291 292 // the average of hwcomposer execution time for unskipped validation cases. 293 optional double avg_unskipped_execution_time_ms = 12; 294 295 // the average of hwcomposer execution time for separated validation cases. 296 optional double avg_separated_execution_time_ms = 13; 297} 298 299// End of protos/perfetto/metrics/android/hwcomposer.proto 300 301// Begin of protos/perfetto/metrics/android/hwui_metric.proto 302 303// Android HWUI graphics performance and graphics memory usage metrics. 304message ProcessRenderInfo { 305 // Name of the package launched 306 optional string process_name = 1; 307 308 // CPU time spent on RenderThread in milliseconds. 309 optional int64 rt_cpu_time_ms = 2; 310 311 // Number of frames drawn on RenderThread, followed by max/min/avg CPU time to draw a frame 312 // in nanoseconds. 313 optional uint32 draw_frame_count = 3; 314 optional int64 draw_frame_max = 4; 315 optional int64 draw_frame_min = 5; 316 optional double draw_frame_avg = 6; 317 318 // Number of GPU commands flushes and max/min/avg time per flush in nanoseconds. 319 optional uint32 flush_count = 7; 320 optional int64 flush_max = 8; 321 optional int64 flush_min = 9; 322 optional double flush_avg = 10; 323 324 // Number of View tree preparation counts and max/min/avg time to traverse the tree in 325 // nanoseconds. 326 optional uint32 prepare_tree_count = 11; 327 optional int64 prepare_tree_max = 12; 328 optional int64 prepare_tree_min = 13; 329 optional double prepare_tree_avg = 14; 330 331 // Number of times the GPU rendered a frame and max/min/avg time for GPU to finish rendering in 332 // in nanoseconds. 333 optional uint32 gpu_completion_count = 15; 334 optional int64 gpu_completion_max = 16; 335 optional int64 gpu_completion_min = 17; 336 optional double gpu_completion_avg = 18; 337 338 // Number of times a frame was recorded/serialized in a display list on the UI thread with 339 // max/min/avg time in nanoseconds. 340 optional uint32 ui_record_count = 19; 341 optional int64 ui_record_max = 20; 342 optional int64 ui_record_min = 21; 343 optional double ui_record_avg = 22; 344 345 // number of unique shader programs that were used to render frames, followed by total and average 346 // times to prepare a shader in nanoseconds. 347 optional uint32 shader_compile_count = 23; 348 optional int64 shader_compile_time = 24; 349 optional double shader_compile_avg = 25; 350 // number of shader programs loaded from the disk cache, followed by total time and average time 351 // to prepare a shader in nanoseconds. 352 optional uint32 cache_hit_count = 26; 353 optional int64 cache_hit_time = 27; 354 optional double cache_hit_avg = 28; 355 // number of shader programs compiled/linked, followed by total time and average time to prepare 356 // a shader in nanoseconds. 357 optional uint32 cache_miss_count = 29; 358 optional int64 cache_miss_time = 30; 359 optional double cache_miss_avg = 31; 360 361 // max/min/avg CPU memory used for graphics by HWUI at the end of a frame. 362 optional int64 graphics_cpu_mem_max = 32; 363 optional int64 graphics_cpu_mem_min = 33; 364 optional double graphics_cpu_mem_avg = 34; 365 366 // max/min/avg GPU memory used by HWUI at the end of a frame excluding textures. 367 optional int64 graphics_gpu_mem_max = 35; 368 optional int64 graphics_gpu_mem_min = 36; 369 optional double graphics_gpu_mem_avg = 37; 370 371 // max/min/avg memory used for GPU textures by HWUI at the end of a frame. 372 optional int64 texture_mem_max = 38; 373 optional int64 texture_mem_min = 39; 374 optional double texture_mem_avg = 40; 375 376 // max/min/avg memory used by HWUI at the end of a frame. This is a sum of previous 3 categories. 377 optional int64 all_mem_max = 41; 378 optional int64 all_mem_min = 42; 379 optional double all_mem_avg = 43; 380} 381 382message AndroidHwuiMetric { 383 // HWUI metrics for processes that have a RenderThread. 384 repeated ProcessRenderInfo process_info = 1; 385} 386 387// End of protos/perfetto/metrics/android/hwui_metric.proto 388 389// Begin of protos/perfetto/metrics/android/ion_metric.proto 390 391// ion memory stats on Android. 392message AndroidIonMetric { 393 message Buffer { 394 optional string name = 1; 395 optional double avg_size_bytes = 2; 396 optional double min_size_bytes = 3; 397 optional double max_size_bytes = 4; 398 399 // Total allocation size. 400 // Essentially the sum of positive allocs (-> new buffers). 401 optional double total_alloc_size_bytes = 5; 402 } 403 404 repeated Buffer buffer = 1; 405} 406 407// End of protos/perfetto/metrics/android/ion_metric.proto 408 409// Begin of protos/perfetto/metrics/android/jank_metric.proto 410 411message AndroidJankMetrics { 412 repeated Warning warnings = 1; 413 414 message Warning { 415 optional int64 ts = 1; 416 optional int64 dur = 2; 417 418 optional string process_name = 3; 419 optional string warning_text = 4; 420 } 421} 422// End of protos/perfetto/metrics/android/jank_metric.proto 423 424// Begin of protos/perfetto/metrics/android/process_metadata.proto 425 426message AndroidProcessMetadata { 427 // Process name. Usually, cmdline or <package_name>(:<custom_name>)?. 428 optional string name = 1; 429 430 // User id under which this process runs. 431 optional int64 uid = 2; 432 433 // Package metadata from Android package list. 434 message Package { 435 optional string package_name = 1; 436 optional int64 apk_version_code = 2; 437 optional bool debuggable = 3; 438 } 439 440 // Package that this process belongs to. 441 // 442 // If this process shares its uid (see `packages_for_uid` field), the package 443 // is determined based on the process name and package name. If there is no 444 // match this field is empty. 445 optional Package package = 7; 446 447 // All packages using this uid. 448 // 449 // Shared uid documentation: 450 // https://developer.android.com/guide/topics/manifest/manifest-element#uid 451 repeated Package packages_for_uid = 8; 452 453 reserved 3, 4, 5, 6; 454} 455 456// End of protos/perfetto/metrics/android/process_metadata.proto 457 458// Begin of protos/perfetto/metrics/android/java_heap_histogram.proto 459 460message JavaHeapHistogram { 461 // Next id: 5 462 message TypeCount { 463 optional string type_name = 1; 464 optional string category = 4; 465 466 optional uint32 obj_count = 2; 467 optional uint32 reachable_obj_count = 3; 468 } 469 470 message Sample { 471 optional int64 ts = 1; 472 repeated TypeCount type_count = 2; 473 } 474 475 // Heap stats per process. One sample per dump (with continuous dump you can 476 // have more samples differentiated by ts). 477 message InstanceStats { 478 optional uint32 upid = 1; 479 optional AndroidProcessMetadata process = 2; 480 repeated Sample samples = 3; 481 } 482 483 repeated InstanceStats instance_stats = 1; 484} 485 486// End of protos/perfetto/metrics/android/java_heap_histogram.proto 487 488// Begin of protos/perfetto/metrics/android/java_heap_stats.proto 489 490message JavaHeapStats { 491 message HeapRoots { 492 optional string root_type = 1; 493 optional string type_name = 2; 494 optional int64 obj_count = 3; 495 } 496 497 // Next id: 7 498 message Sample { 499 optional int64 ts = 1; 500 // Size of the Java heap in bytes 501 optional int64 heap_size = 2; 502 optional int64 obj_count = 4; 503 // Size of the reachable objects in bytes. 504 optional int64 reachable_heap_size = 3; 505 optional int64 reachable_obj_count = 5; 506 // Sum of anonymous RSS + swap pages in bytes. 507 optional int64 anon_rss_and_swap_size = 6; 508 509 // ART root objects 510 repeated HeapRoots roots = 7; 511 } 512 513 // Heap stats per process. One sample per dump (can be > 1 if continuous 514 // dump is enabled). 515 message InstanceStats { 516 optional uint32 upid = 1; 517 optional AndroidProcessMetadata process = 2; 518 repeated Sample samples = 3; 519 } 520 521 repeated InstanceStats instance_stats = 1; 522} 523 524// End of protos/perfetto/metrics/android/java_heap_stats.proto 525 526// Begin of protos/perfetto/metrics/android/lmk_metric.proto 527 528// LMK stats on Android. 529message AndroidLmkMetric { 530 message ByOomScore { 531 optional int32 oom_score_adj = 1; 532 optional int32 count = 2; 533 } 534 535 // Total count of LMK events observed in the trace. 536 optional int32 total_count = 1; 537 repeated ByOomScore by_oom_score = 2; 538 539 // OOM reaper kills. Enabled via the oom/mark_victim point. Should never 540 // happen. 541 optional int32 oom_victim_count = 3; 542} 543 544// End of protos/perfetto/metrics/android/lmk_metric.proto 545 546// Begin of protos/perfetto/metrics/android/lmk_reason_metric.proto 547 548// Global process state at LMK time, used to identify potential culprits. 549// TODO: rename to AndroidLmkProcessState 550message AndroidLmkReasonMetric { 551 message Process { 552 optional AndroidProcessMetadata process = 1; 553 554 // OOM score adj of the process. 555 optional int32 oom_score_adj = 2; 556 557 // RSS + swap. 558 optional int64 size = 3; 559 560 optional int64 file_rss_bytes = 4; 561 optional int64 anon_rss_bytes = 5; 562 optional int64 shmem_rss_bytes = 6; 563 optional int64 swap_bytes = 7; 564 } 565 message Lmk { 566 // OOM score adj of the LMK'ed process. 567 optional int32 oom_score_adj = 1; 568 569 // Total size of the ION heap in bytes during this LMK. 570 optional int64 ion_heaps_bytes = 4; 571 // Deprecated. Prefer ion_heaps_bytes. 572 optional int64 system_ion_heap_size = 2; 573 574 // Processes present during this LMK. 575 repeated Process processes = 3; 576 } 577 578 // LMKs present in the trace, ordered on their timestamp. 579 repeated Lmk lmks = 1; 580} 581 582// End of protos/perfetto/metrics/android/lmk_reason_metric.proto 583 584// Begin of protos/perfetto/metrics/android/mem_metric.proto 585 586// Memory metrics on Android. 587message AndroidMemoryMetric { 588 message ProcessMetrics { 589 optional string process_name = 1; 590 optional ProcessMemoryCounters total_counters = 2; 591 repeated PriorityBreakdown priority_breakdown = 3; 592 } 593 594 message PriorityBreakdown { 595 optional string priority = 1; 596 optional ProcessMemoryCounters counters = 2; 597 } 598 599 message ProcessMemoryCounters { 600 optional Counter anon_rss = 1; 601 optional Counter file_rss = 2; 602 optional Counter swap = 3; 603 optional Counter anon_and_swap = 4; 604 605 // Available when ART trace events are available. 606 optional Counter java_heap = 5; 607 } 608 609 message Counter { 610 optional double min = 1; 611 optional double max = 2; 612 optional double avg = 3; 613 } 614 615 // Process metrics, grouped by process name 616 repeated ProcessMetrics process_metrics = 1; 617} 618 619// End of protos/perfetto/metrics/android/mem_metric.proto 620 621// Begin of protos/perfetto/metrics/android/mem_unagg_metric.proto 622 623// Unaggregated memory metrics on Android. 624message AndroidMemoryUnaggregatedMetric { 625 message ProcessValues { 626 optional string process_name = 1; 627 optional ProcessMemoryValues mem_values = 2; 628 } 629 630 message ProcessMemoryValues { 631 repeated Value anon_rss = 1; 632 repeated Value file_rss = 2; 633 repeated Value swap = 3; 634 repeated Value anon_and_swap = 4; 635 } 636 637 message Value { 638 optional int64 ts = 1; 639 optional int32 oom_score = 2; 640 optional double value = 3; 641 } 642 643 // Process metrics for every process instance in trace. 644 repeated ProcessValues process_values = 1; 645} 646 647// End of protos/perfetto/metrics/android/mem_unagg_metric.proto 648 649// Begin of protos/perfetto/metrics/android/package_list.proto 650 651message AndroidPackageList { 652 message Package { 653 optional string package_name = 1; 654 optional int64 uid = 2; 655 optional int64 version_code = 3; 656 } 657 658 repeated Package packages = 1; 659} 660 661// End of protos/perfetto/metrics/android/package_list.proto 662 663// Begin of protos/perfetto/metrics/android/powrails_metric.proto 664 665message AndroidPowerRails { 666 // Energy data per Power Rail at given ts. 667 message EnergyData { 668 // Time since device boot(CLOCK_BOTTOMTIME) in milli-seconds. 669 optional int64 timestamp_ms = 1; 670 // Accumulated energy since device boot in microwatt-seconds(uws). 671 optional double energy_uws = 2; 672 } 673 674 message PowerRails { 675 // Name of the rail. 676 optional string name = 1; 677 // Energy data for given rail and for all samples in the trace. 678 repeated EnergyData energy_data = 2; 679 } 680 681 // Energy data per Power Rail. 682 repeated PowerRails power_rails = 1; 683} 684// End of protos/perfetto/metrics/android/powrails_metric.proto 685 686// Begin of protos/perfetto/metrics/android/startup_metric.proto 687 688// Android app startup metrics. 689message AndroidStartupMetric { 690 // A simplified view of the task state durations for a thread 691 // and a span of time. 692 message TaskStateBreakdown { 693 optional int64 running_dur_ns = 1; 694 optional int64 runnable_dur_ns = 2; 695 optional int64 uninterruptible_sleep_dur_ns = 3; 696 optional int64 interruptible_sleep_dur_ns = 4; 697 } 698 699 message McyclesByCoreType { 700 optional int64 little = 1; 701 optional int64 big = 2; 702 optional int64 bigger = 3; 703 optional int64 unknown = 4; 704 } 705 706 message Slice { 707 optional int64 dur_ns = 1; 708 optional double dur_ms = 2; 709 } 710 711 // Timing information spanning the intent received by the 712 // activity manager to the first frame drawn. 713 // Next id: 31. 714 message ToFirstFrame { 715 // The duration between the intent received and first frame. 716 optional int64 dur_ns = 1; 717 optional double dur_ms = 17; 718 719 // Breakdown of time to first frame by task state for the main thread of 720 // the process starting up. 721 optional TaskStateBreakdown main_thread_by_task_state = 2; 722 723 // The mcycles taken by this startup across all CPUs (broken down by core 724 // type). 725 optional McyclesByCoreType mcycles_by_core_type = 26; 726 727 // In this timespan, how many processes (apart from the main activity) were 728 // spawned. 729 optional uint32 other_processes_spawned_count = 3; 730 731 // Total time spent in activity manager between the initial intent 732 // and the end of the activity starter. 733 optional Slice time_activity_manager = 4; 734 735 // The following slices follow the typical steps post-fork. 736 optional Slice time_activity_thread_main = 5; 737 optional Slice time_bind_application = 6; 738 optional Slice time_activity_start = 7; 739 optional Slice time_activity_resume = 8; 740 optional Slice time_activity_restart = 21; 741 optional Slice time_choreographer = 9; 742 optional Slice time_inflate = 22; 743 optional Slice time_get_resources = 23; 744 745 // If we are starting a new process, record the duration from the 746 // intent being received to the time we call the zygote. 747 optional Slice time_before_start_process = 10; 748 749 // The actual duration of the process start (based on the zygote slice). 750 optional Slice time_during_start_process = 11; 751 752 optional Slice to_post_fork = 18; 753 optional Slice to_activity_thread_main = 19; 754 optional Slice to_bind_application = 20; 755 756 optional Slice time_post_fork = 16; 757 758 // The total time spent on opening dex files. 759 optional Slice time_dex_open = 24; 760 // Total time spent verifying classes during app startup. 761 optional Slice time_verify_class = 25; 762 763 // Number of methods that were compiled by JIT during app startup. 764 optional uint32 jit_compiled_methods = 27; 765 766 // Time spent running CPU on jit thread pool. 767 optional Slice time_jit_thread_pool_on_cpu = 28; 768 769 // Time spent on garbage collection. 770 optional Slice time_gc_total = 29; 771 optional Slice time_gc_on_cpu = 30; 772 // Deprecated was other_process_to_activity_cpu_ratio 773 reserved 12; 774 775 // Removed: was uint32 versions of to_post_fork, to_activity_thread_main and 776 // to_bind_application. 777 reserved 13, 14, 15; 778 } 779 780 // Metrics about startup which were developed by looking at experiments using 781 // high-speed cameras (HSC). 782 message HscMetrics { 783 // The duration of the full "startup" as defined by HSC tests. 784 optional Slice full_startup = 1; 785 } 786 787 message Activity { 788 optional string name = 1; 789 optional string method = 2; 790 optional int64 ts_method_start = 4; 791 792 // Field 3 contained Slice with a sum of durations for matching slices. 793 reserved 3; 794 } 795 796 message BinderTransaction { 797 optional Slice duration = 1; 798 optional string thread = 2; 799 } 800 801 // Metrics with information about the status of odex files and the outcome 802 // of the loading process. 803 // Multiple files might be loaded for a single startup. Platform might also 804 // decide to discard an odex file and instead load a fallback, for example 805 // in case the OS or apk were updated. 806 message OptimizationStatus { 807 optional string odex_status = 1; 808 optional string compilation_filter = 2; 809 optional string compilation_reason = 3; 810 optional string location = 4; 811 } 812 813 // Contains timestamps of important events which occurred during the 814 // startup. 815 message EventTimestamps { 816 optional int64 intent_received = 1; 817 optional int64 first_frame = 2; 818 } 819 820 // Next id: 15 821 message Startup { 822 // Random id uniquely identifying an app startup in this trace. 823 optional uint32 startup_id = 1; 824 825 // Name of the package launched 826 optional string package_name = 2; 827 828 // Name of the process launched 829 optional string process_name = 3; 830 831 // Details about the activities launched 832 repeated Activity activities = 11; 833 834 // Details about slow binder transactions during the startup. The definition 835 // of a slow transaction is an implementation detail. 836 repeated BinderTransaction long_binder_transactions = 14; 837 838 // Did we ask the zygote for a new process 839 optional bool zygote_new_process = 4; 840 841 // Number of processes hosting the activity involved in the launch. 842 // This will usually be 1. If it is 0, it is indicative of a data / process 843 // error. If > 1, the process died during startup and the system respawned 844 // it. 845 optional uint32 activity_hosting_process_count = 6; 846 847 // Contains timestamps of important events which happened during 848 // the startup. 849 optional EventTimestamps event_timestamps = 13; 850 851 // Timing information spanning the intent received by the 852 // activity manager to the first frame drawn. 853 optional ToFirstFrame to_first_frame = 5; 854 855 // Details about the process (uid, version, etc) 856 optional AndroidProcessMetadata process = 7; 857 858 // Metrics about startup which were developed by looking at experiments 859 // using high-speed cameras (HSC). 860 optional HscMetrics hsc = 8; 861 862 // The time taken in the startup from intent recieved to the start time 863 // of the reportFullyDrawn slice. This should be longer than the time to 864 // first frame as the application decides this after it starts rendering. 865 optional Slice report_fully_drawn = 9; 866 867 // Conntains information about the status of odex files. 868 repeated OptimizationStatus optimization_status = 12; 869 870 reserved 10; 871 } 872 873 repeated Startup startup = 1; 874} 875 876// End of protos/perfetto/metrics/android/startup_metric.proto 877 878// Begin of protos/perfetto/metrics/android/surfaceflinger.proto 879 880message AndroidSurfaceflingerMetric { 881 // Counts the number of missed frames in the trace. 882 optional uint32 missed_frames = 1; 883 884 // Counts the number of missed HWC frames in the trace. 885 optional uint32 missed_hwc_frames = 2; 886 887 // Counts the number of missed GPU frames in the trace. 888 optional uint32 missed_gpu_frames = 3; 889 890 // Calculate the number of missed frames divided by 891 // total frames 892 optional double missed_frame_rate = 4; 893 894 // Calculate the number of missed HWC frames divided by 895 // total HWC frames 896 optional double missed_hwc_frame_rate = 5; 897 898 // Calculate the number of missed GPU frames divided by 899 // total GPU frames 900 optional double missed_gpu_frame_rate = 6; 901} 902 903// End of protos/perfetto/metrics/android/surfaceflinger.proto 904 905// Begin of protos/perfetto/metrics/android/sysui_cuj_metrics.proto 906 907// Metric that stores frame information and potential jank root causes 908// for a single Android system UI interaction/user journey. 909message AndroidSysUiCujMetrics { 910 // A list of all frames within the SysUi user journey. 911 repeated Frame frames = 1; 912 913 optional string cuj_name = 2; 914 optional int64 cuj_start = 3; 915 optional int64 cuj_dur = 4; 916 917 // Details about the process (uid, version, etc) 918 optional AndroidProcessMetadata process = 5; 919 920 message Frame { 921 // Index of the frame within the single user journey. 922 optional int64 number = 1; 923 optional int64 vsync = 5; 924 optional int64 ts = 2; 925 optional int64 dur = 3; 926 927 // A list of identified potential causes for jank. 928 // Optional. 929 repeated string jank_cause = 4; 930 } 931} 932 933// End of protos/perfetto/metrics/android/sysui_cuj_metrics.proto 934 935// Begin of protos/perfetto/metrics/android/task_names.proto 936 937message AndroidTaskNames { 938 message Process { 939 optional int64 pid = 1; 940 941 // Process name. 942 optional string process_name = 2; 943 944 // Names of all threads for this process. 945 repeated string thread_name = 3; 946 947 // User id under which this process runs. 948 optional int64 uid = 4; 949 950 // Packages matching the process uid. 951 repeated string uid_package_name = 5; 952 } 953 954 repeated Process process = 1; 955} 956 957// End of protos/perfetto/metrics/android/task_names.proto 958 959// Begin of protos/perfetto/metrics/android/thread_time_in_state_metric.proto 960 961message AndroidThreadTimeInStateMetric { 962 message MetricsByCoreType { 963 optional int32 time_in_state_cpu = 5; 964 optional string core_type = 1; 965 966 optional int64 runtime_ms = 2; 967 // CPU megacycles (i.e. cycles divided by 1e6). 968 optional int64 mcycles = 3; 969 // Power cost as predicted by the power profile. 970 optional double power_profile_mah = 4; 971 } 972 973 message Thread { 974 optional string name = 1; 975 optional bool main_thread = 3; 976 repeated MetricsByCoreType metrics_by_core_type = 2; 977 } 978 979 message Process { 980 optional AndroidProcessMetadata metadata = 1; 981 repeated MetricsByCoreType metrics_by_core_type = 2; 982 repeated Thread threads = 3; 983 } 984 985 repeated Process processes = 1; 986} 987 988// End of protos/perfetto/metrics/android/thread_time_in_state_metric.proto 989 990// Begin of protos/perfetto/metrics/android/unsymbolized_frames.proto 991 992message UnsymbolizedFrames { 993 message Frame { 994 optional string module = 1; 995 optional string build_id = 2; 996 optional int64 address = 3; 997 } 998 999 repeated Frame frames = 1; 1000} 1001 1002// End of protos/perfetto/metrics/android/unsymbolized_frames.proto 1003 1004// Begin of protos/perfetto/metrics/metrics.proto 1005 1006// Trace processor metadata 1007message TraceMetadata { 1008 reserved 1; 1009 optional int64 trace_duration_ns = 2; 1010 optional string trace_uuid = 3; 1011 optional string android_build_fingerprint = 4; 1012 optional int64 statsd_triggering_subscription_id = 5; 1013 optional int64 trace_size_bytes = 6; 1014 repeated string trace_trigger = 7; 1015 optional string unique_session_name = 8; 1016 optional string trace_config_pbtxt = 9; 1017 optional int64 sched_duration_ns = 10; 1018} 1019 1020// Stats counters for the trace. 1021// Defined in src/trace_processor/storage/stats.h 1022message TraceAnalysisStats { 1023 enum Severity { 1024 SEVERITY_UNKNOWN = 0; 1025 SEVERITY_INFO = 1; 1026 SEVERITY_DATA_LOSS = 2; 1027 SEVERITY_ERROR = 3; 1028 } 1029 1030 enum Source { 1031 SOURCE_UNKNOWN = 0; 1032 SOURCE_TRACE = 1; 1033 SOURCE_ANALYSIS = 2; 1034 } 1035 1036 message Stat { 1037 optional string name = 1; 1038 optional uint32 idx = 2; 1039 optional Severity severity = 3; 1040 optional Source source = 4; 1041 1042 optional int64 count = 5; 1043 } 1044 1045 repeated Stat stat = 1; 1046} 1047 1048// Root message for all Perfetto-based metrics. 1049// 1050// Next id: 34 1051message TraceMetrics { 1052 reserved 4, 10, 13, 14, 16, 19; 1053 1054 // Battery counters metric on Android. 1055 optional AndroidBatteryMetric android_batt = 5; 1056 1057 // CPU usage per trace, process and thread. 1058 optional AndroidCpuMetric android_cpu = 6; 1059 1060 // Memory metrics on Android (owned by the Android Telemetry team). 1061 optional AndroidMemoryMetric android_mem = 1; 1062 1063 // Memory metrics on Android in unaggregated form. (owned by the Android 1064 // Telemetry team). 1065 // Note: this generates a lot of data so should not be requested unless it 1066 // is clear that this data is necessary. 1067 optional AndroidMemoryUnaggregatedMetric android_mem_unagg = 11; 1068 1069 // Package list. 1070 optional AndroidPackageList android_package_list = 12; 1071 1072 // ion buffer memory metrics. 1073 optional AndroidIonMetric android_ion = 9; 1074 1075 // fastrpc subsystem memory metrics. 1076 optional AndroidFastrpcMetric android_fastrpc = 31; 1077 1078 // Statistics about low memory kills. 1079 optional AndroidLmkMetric android_lmk = 8; 1080 1081 // Power Rails metrics on Android. 1082 optional AndroidPowerRails android_powrails = 7; 1083 1084 // Startup metrics on Android (owned by the Android Telemetry team). 1085 optional AndroidStartupMetric android_startup = 2; 1086 1087 // Trace metadata (applicable to all traces). 1088 optional TraceMetadata trace_metadata = 3; 1089 1090 // Trace stats (applicable to all traces). 1091 optional TraceAnalysisStats trace_stats = 33; 1092 1093 // Returns stack frames missing symbols. 1094 optional UnsymbolizedFrames unsymbolized_frames = 15; 1095 1096 // If the trace contains a heap graph, output allocation statistics. 1097 optional JavaHeapStats java_heap_stats = 17; 1098 1099 // If the trace contains a heap graph, output histogram. 1100 optional JavaHeapHistogram java_heap_histogram = 21; 1101 1102 // Metrics used to find potential culprits of low-memory kills. 1103 optional AndroidLmkReasonMetric android_lmk_reason = 18; 1104 1105 optional AndroidHwuiMetric android_hwui_metric = 20; 1106 1107 optional AndroidDisplayMetrics display_metrics = 22; 1108 1109 optional AndroidTaskNames android_task_names = 23; 1110 1111 optional AndroidThreadTimeInStateMetric android_thread_time_in_state = 24; 1112 1113 // Metric associated with surfaceflinger. 1114 optional AndroidSurfaceflingerMetric android_surfaceflinger = 25; 1115 1116 // GPU metrics on Android. 1117 optional AndroidGpuMetric android_gpu = 26; 1118 1119 // Frame timing and jank root causes for system UI interactions. 1120 optional AndroidSysUiCujMetrics android_sysui_cuj = 27; 1121 1122 // Metric associated with hwcomposer. 1123 optional AndroidHwcomposerMetrics android_hwcomposer = 28; 1124 1125 // Detects common bad patterns that might lead to jank. 1126 optional AndroidJankMetrics android_jank = 29; 1127 1128 // G2D metrics. 1129 optional G2dMetrics g2d = 30; 1130 1131 // Dmabuf heap metrics. 1132 optional AndroidDmaHeapMetric android_dma_heap = 32; 1133 1134 // Demo extensions. 1135 extensions 450 to 499; 1136 1137 // Vendor extensions. 1138 extensions 500 to 1000; 1139 1140 // Chrome metrics. 1141 extensions 1001 to 2000; 1142} 1143 1144// End of protos/perfetto/metrics/metrics.proto 1145