sampled_profile.proto 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. syntax = "proto2";
  5. option optimize_for = LITE_RUNTIME;
  6. option java_package = "org.chromium.components.metrics";
  7. option java_outer_classname = "SampledProfileProtos";
  8. package metrics;
  9. import "call_stack_profile.proto";
  10. import "execution_context.proto";
  11. import "perf_data.proto";
  12. import "perf_stat.proto";
  13. import "system_profile.proto";
  14. // Protocol buffer for collected sample-based profiling data.
  15. // Contains the parameters and data from a single profile collection event.
  16. // Next tag: 21
  17. message SampledProfile {
  18. // Indicates the event that triggered this collection.
  19. enum TriggerEvent {
  20. UNKNOWN_TRIGGER_EVENT = 0;
  21. // The profile was triggered by periodic sampling. Periodically sampled
  22. // profiles are collected once per uniformly sized period interval. Within
  23. // each interval, the sampled data is collected at a random time. For
  24. // example, if the interval is 60 s, then data would be collected at a
  25. // random point in each of the intervals [0, 60 s), [60 s, 120 s), etc.
  26. PERIODIC_COLLECTION = 1;
  27. // The profile was collected upon resume from suspend.
  28. RESUME_FROM_SUSPEND = 2;
  29. // The profile was collected upon restoring a previous session.
  30. RESTORE_SESSION = 3;
  31. // The profile was collected at process startup.
  32. PROCESS_STARTUP = 4;
  33. // The profile was collected after jank was detected while executing a task.
  34. JANKY_TASK = 5;
  35. // The profile was collected after a thread was determined to be hung.
  36. THREAD_HUNG = 6;
  37. // The heap profile was triggered by periodic sampling. The time intervals
  38. // between trigger events conform to the Poisson process with certain mean
  39. // interval between collections.
  40. PERIODIC_HEAP_COLLECTION = 7;
  41. }
  42. optional TriggerEvent trigger_event = 1;
  43. // The process in which the profile was collected.
  44. optional Process process = 11;
  45. // The thread in which the profile was collected.
  46. optional Thread thread = 12;
  47. // Map of Chrome PIDs running on the system when the profile was collected.
  48. // Each Chrome PID is mapped to its process type.
  49. // This field and the below thread_types field assume that the PID/TID
  50. // information are collected in a short duration for a single session such
  51. // that, the PID/TID reuse is highly unlikely.
  52. // The information from these two fields is used to map chrome samples
  53. // collected for a specific PID/TID to the corresponding process type and
  54. // thread type.
  55. map<uint32, Process> process_types = 13;
  56. // A list of pids that belong to Lacros binaries, which are a subset of the
  57. // keys of the process_types above.
  58. repeated uint32 lacros_pids = 18 [packed = true];
  59. // The version string of the Lacros Chrome browser running on a CrOS machine.
  60. // It a 4-tuple of numbers separated by dots.
  61. // Note: unlike the app_version in the system_profile.proto, this does not
  62. // include any additional suffixes such as development build or bitness.
  63. // This, and lacros_channel are only populated when lacros binaries are
  64. // found in the running processes, i.e. when lacros_pids is not empty.
  65. optional string lacros_version = 19;
  66. // The channel of the Lacros Chrome browser running on a CrOS machine.
  67. optional SystemProfileProto.Channel lacros_channel = 20;
  68. // Map of Chrome TIDs running on the system when the profile was collected.
  69. // Each Chrome TID is mapped to its thread type.
  70. map<uint32, Thread> thread_types = 14;
  71. // Fields 2-3: Time durations are given in ticks, and represent system uptime
  72. // rather than wall time.
  73. // Time after system boot when the collection took place, in milliseconds.
  74. optional int64 ms_after_boot = 2;
  75. // Time after last login when the collection took place, in milliseconds.
  76. optional int64 ms_after_login = 3;
  77. // The duration for which the machine was suspended prior to collecting the
  78. // sampled profile. Only set when |trigger_event| is RESUME_FROM_SUSPEND.
  79. optional int64 suspend_duration_ms = 5;
  80. // Number of milliseconds after a resume that profile was collected. Only set
  81. // when |trigger_event| is RESUME_FROM_SUSPEND.
  82. optional int64 ms_after_resume = 6;
  83. // Number of tabs restored during a session restore. Only set when
  84. // |trigger_event| is RESTORE_SESSION.
  85. optional int32 num_tabs_restored = 7;
  86. // Number of milliseconds after a session restore that a profile was
  87. // collected. Only set when |trigger_event| is RESTORE_SESSION.
  88. optional int64 ms_after_restore = 8;
  89. // Sampled profile data collected from Linux perf tool.
  90. optional PerfDataProto perf_data = 4;
  91. // Sampled profile data collected by periodic sampling of call stacks.
  92. optional CallStackProfile call_stack_profile = 9;
  93. // Perf counter data collected using "perf stat".
  94. optional PerfStatProto perf_stat = 10;
  95. // The maximum frequency in MHz reported for each logical CPU on the device.
  96. // This is a repeated field, where entry 0 corresponds to core 0, entry 1 to
  97. // core 1, and so on. The field is optional and populated only for metrics
  98. // that can use the max frequency to compute a CPU utilization metric, e.g.
  99. // when measuring CPU cycles.
  100. repeated uint32 cpu_max_frequency_mhz = 15;
  101. // The pressure-stall information that describes the state of CPU utilization
  102. // of the system.
  103. // The percent of the time that runnable processes are delayed because the CPU
  104. // is unavailable, accumulated over 10 seconds.
  105. optional float psi_cpu_last_10s_pct = 16;
  106. // The percent of the time that runnable processes are delayed because the CPU
  107. // is unavailable, accumulated over 60 seconds.
  108. optional float psi_cpu_last_60s_pct = 17;
  109. }