activity_report.proto 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. // Copyright 2016 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. package browser_watcher;
  7. // The state of the system on which Chrome is running (shutting down, battery
  8. // level, load, etc.).
  9. // Next id: 2
  10. message SystemState {
  11. // The state of a system session. A system session begins when the system
  12. // starts and ends when it shuts down.
  13. enum SessionState {
  14. UNKNOWN = 0;
  15. CLEAN = 1; // Normal shutdown.
  16. UNCLEAN = 2; // Abnormal shutdown (system crash, power loss).
  17. }
  18. // The state of the system session that contained Chrome's execution.
  19. optional SessionState session_state = 1;
  20. }
  21. // Next id: 10
  22. message CodeModule {
  23. // The base address of this code module as it was loaded by the process.
  24. optional int64 base_address = 1;
  25. // The size of the code module.
  26. optional int64 size = 2;
  27. // The path or file name that the code module was loaded from.
  28. optional string code_file = 3;
  29. // An identifying string used to discriminate between multiple versions and
  30. // builds of the same code module. This may contain a uuid, timestamp,
  31. // version number, or any combination of this or other information, in an
  32. // implementation-defined format.
  33. optional string code_identifier = 4;
  34. // The filename containing debugging information associated with the code
  35. // module. If debugging information is stored in a file separate from the
  36. // code module itself (as is the case when .pdb or .dSYM files are used),
  37. // this will be different from code_file. If debugging information is
  38. // stored in the code module itself (possibly prior to stripping), this
  39. // will be the same as code_file.
  40. optional string debug_file = 5;
  41. // An identifying string similar to code_identifier, but identifies a
  42. // specific version and build of the associated debug file. This may be
  43. // the same as code_identifier when the debug_file and code_file are
  44. // identical or when the same identifier is used to identify distinct
  45. // debug and code files.
  46. optional string debug_identifier = 6;
  47. // A human-readable representation of the code module's version.
  48. optional string version = 7;
  49. optional int64 shrink_down_delta = 8;
  50. // Whether the module was still loaded into memory.
  51. optional bool is_unloaded = 9;
  52. }
  53. // A typed value holds values of interest or references to such values.
  54. // Next id: 9
  55. message TypedValue {
  56. // A reference to a value of interest.
  57. message Reference {
  58. optional uint64 address = 1;
  59. optional int64 size = 2;
  60. }
  61. oneof value {
  62. bytes bytes_value = 1;
  63. Reference bytes_reference = 2;
  64. string string_value = 3;
  65. Reference string_reference = 4;
  66. string char_value = 5;
  67. bool bool_value = 6;
  68. int64 signed_value = 7;
  69. uint64 unsigned_value = 8;
  70. }
  71. }
  72. // An activity represents information about something of interest on a thread.
  73. // Next id: 18
  74. message Activity {
  75. enum Type {
  76. UNKNOWN = 0;
  77. ACT_TASK_RUN = 1;
  78. ACT_LOCK_ACQUIRE = 2;
  79. ACT_EVENT_WAIT = 3;
  80. ACT_THREAD_JOIN = 4;
  81. ACT_PROCESS_WAIT = 5;
  82. ACT_GENERIC = 6;
  83. }
  84. // Identifies the type of the activity (and specifies which fields are
  85. // relevant).
  86. optional Type type = 1;
  87. // Creation time of the activity.
  88. optional int64 time = 2;
  89. // The address that pushed the activity onto the stack.
  90. optional uint64 address = 11;
  91. // The address that is the origin of the activity. This is useful for things
  92. // like tasks that are posted from a completely different thread though most
  93. // activities will leave it null.
  94. optional uint64 origin_address = 3;
  95. // The sequence identifier of the posted task.
  96. // Expected for ACT_TASK_*
  97. optional uint64 task_sequence_id = 4;
  98. // The memory address of the lock object.
  99. optional uint64 lock_address = 5;
  100. // The memory address of the event object.
  101. optional uint64 event_address = 6;
  102. // A unique identifier for a thread within a process.
  103. optional int64 thread_id = 7;
  104. // A unique identifier for a process.
  105. optional int64 process_id = 8;
  106. // An arbitrary identifier used for association.
  107. optional uint32 generic_id = 12;
  108. // An arbitrary value used for information purposes.
  109. optional int32 generic_data = 13;
  110. // Tag ids 10 and 14-17 are reserved for server side augmentation.
  111. // A key-value store.
  112. map<string, TypedValue> user_data = 9;
  113. }
  114. // Details about an exception.
  115. // Next id: 5
  116. message Exception {
  117. optional uint32 code = 1;
  118. optional uint64 program_counter = 2;
  119. optional uint64 exception_address = 3;
  120. optional int64 time = 4;
  121. }
  122. // The state of a thread.
  123. // Next id: 6
  124. message ThreadState {
  125. // The name of the thread, up to a maxiumum length.
  126. optional string thread_name = 1;
  127. // The identifier of the thread.
  128. optional int64 thread_id = 2;
  129. // The activity stack. |activity_count| specifies the number of activities on
  130. // stack and |activities| holds the base of the stack (up to a maximum size).
  131. optional int32 activity_count = 3;
  132. repeated Activity activities = 4;
  133. // The last exception to be successfully captured. Note this exception may
  134. // have been recovered from.
  135. optional Exception exception = 5;
  136. }
  137. // The state of a process.
  138. // Next id: 7
  139. message ProcessState {
  140. enum Type {
  141. UNKNOWN_PROCESS = 0;
  142. BROWSER_PROCESS = 1;
  143. WATCHER_PROCESS = 2;
  144. }
  145. message MemoryState {
  146. message WindowsMemory {
  147. // The private byte usage of the process. Unit is 4K pages.
  148. optional uint32 process_private_usage = 1;
  149. // The peak working set usage of the process. Unit is 4K pages.
  150. optional uint32 process_peak_workingset_size = 2;
  151. // The peak pagefile usage of the process. Unit is 4K pages.
  152. optional uint32 process_peak_pagefile_usage = 3;
  153. // The allocation request that caused OOM, bytes.
  154. optional uint32 process_allocation_attempt = 4;
  155. // The number of opened handles in the process.
  156. optional uint32 process_handle_count = 5;
  157. }
  158. optional WindowsMemory windows_memory = 1;
  159. }
  160. // The identifier of the process.
  161. optional int64 process_id = 3;
  162. optional Type process_type = 5;
  163. // Note: likely only a subset of modules of interest (e.g. Chromium's own
  164. // modules).
  165. repeated CodeModule modules = 1;
  166. repeated ThreadState threads = 2;
  167. optional MemoryState memory_state = 4;
  168. // A key-value store global to the process.
  169. map<string, TypedValue> data = 6;
  170. }
  171. // Description of a field trial or experiment that the user is currently
  172. // enrolled in. This message is an analogue of the UMA proto in
  173. // third_party/metrics_proto/system_profile.proto. For details about generating
  174. // the identifiers from the field trial and group names, see
  175. // variations::MakeActiveGroupId().
  176. // Next id: 3
  177. message FieldTrial {
  178. // A 32-bit identifier for the name of the field trial.
  179. optional fixed32 name_id = 1;
  180. // A 32-bit identifier for the user's group within the field trial.
  181. optional fixed32 group_id = 2;
  182. }
  183. // Records the state of system memory at the time of crash.
  184. // Next id: 2
  185. message SystemMemoryState {
  186. message WindowsMemory {
  187. // The system commit limit. Unit is number of 4K pages.
  188. optional uint32 system_commit_limit = 1;
  189. // The amount of system commit remaining. Unit is number of 4K pages.
  190. optional uint32 system_commit_remaining = 2;
  191. // The current number of open handles.
  192. optional uint32 system_handle_count = 3;
  193. }
  194. optional WindowsMemory windows_memory = 1;
  195. }
  196. // A stability report contains information pertaining to the execution of a
  197. // single logical instance of a "chrome browser". It is comprised of information
  198. // about the system state and about the chrome browser's processes.
  199. // Next id: 9
  200. // This message would more appropriately be named ActivityReport, but since this
  201. // proto is used in the crash backend, renaming it will take some dancing
  202. // around.
  203. message StabilityReport {
  204. // Whether the report is complete. Reports can be incomplete when the
  205. // recording size quota is hit.
  206. optional bool is_complete = 6;
  207. // The process identifier of the crashed process.
  208. optional int64 crashed_process_id = 8;
  209. // State pertaining to the system.
  210. optional SystemState system_state = 1;
  211. // State pertaining to Chrome's processes.
  212. repeated ProcessState process_states = 2;
  213. // Log messages. This is empty on official builds.
  214. // TODO(manzagop): attribute messages to their process.
  215. repeated string log_messages = 3;
  216. // A global key-value store.
  217. map<string, TypedValue> global_data = 4;
  218. // The field trials the user is currently enrolled in.
  219. repeated FieldTrial field_trials = 5;
  220. optional SystemMemoryState system_memory_state = 7;
  221. }