Populate ChromeOS hardware_class in metrics log

Populate ChromeOS's hardware class in MetricsLog.RecordCoreSystemProfile
by implementing ChromeOS version of the HardwareModelName so that the
hardware_class field can be filled even for logs from previous run.
This is to fix large amount of ChromeOS reports have no hardware_class
problem.

This cl doesn't implement anything new but moves part of the
GetShortHardwareClass to ChromeOS's base::SysInfo::HardwareModelName().
This cl also does some cleanup in chromeos_metrics_provider and
removes GetShortHardwareClass function in variations_field_trial_creator.
The features::kUmaShortHWClass is always set to true now so some
conditions are no longer needed. The GetShortHardwareClass function is
replaced by base::SysInfo::HardwareModelName().

This cl will also affect our cloned install detection logic because
ChromeOS machine id can also be detected. Though, we'll not reset
client_ids because previously we never ran that logic.

Bug: 1110166
Change-Id: Ia4261fe7da575eb12e0b9d6148924922bed2a168
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321834
Commit-Queue: Weilun Shi <sweilun@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#793335}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6e1cd63cb9502fc7f2a139ea2e8cc2c3e6a5c9e8
1 file changed
tree: 73ec04e4f4573ab2feb8062eede2afcb3dad4dc3
  1. BUILD.gn
  2. DEPS
  3. OWNERS
  4. README
  5. android/
  6. android_metrics_provider.cc
  7. android_metrics_provider.h
  8. android_metrics_provider_unittest.cc
  9. call_stack_profile_builder.cc
  10. call_stack_profile_builder.h
  11. call_stack_profile_builder_unittest.cc
  12. call_stack_profile_collector.cc
  13. call_stack_profile_collector.h
  14. call_stack_profile_encoding.cc
  15. call_stack_profile_encoding.h
  16. call_stack_profile_metadata.cc
  17. call_stack_profile_metadata.h
  18. call_stack_profile_metadata_unittest.cc
  19. call_stack_profile_metrics_provider.cc
  20. call_stack_profile_metrics_provider.h
  21. call_stack_profile_metrics_provider_unittest.cc
  22. call_stack_profile_params.h
  23. child_call_stack_profile_collector.cc
  24. child_call_stack_profile_collector.h
  25. child_call_stack_profile_collector_unittest.cc
  26. clean_exit_beacon.cc
  27. clean_exit_beacon.h
  28. client_info.cc
  29. client_info.h
  30. cloned_install_detector.cc
  31. cloned_install_detector.h
  32. cloned_install_detector_unittest.cc
  33. component_metrics_provider.cc
  34. component_metrics_provider.h
  35. component_metrics_provider_unittest.cc
  36. content/
  37. cpu_metrics_provider.cc
  38. cpu_metrics_provider.h
  39. daily_event.cc
  40. daily_event.h
  41. daily_event_unittest.cc
  42. data_use_tracker.cc
  43. data_use_tracker.h
  44. data_use_tracker_unittest.cc
  45. date_changed_helper.cc
  46. date_changed_helper.h
  47. date_changed_helper_unittest.cc
  48. delegating_provider.cc
  49. delegating_provider.h
  50. demographic_metrics_provider.cc
  51. demographic_metrics_provider.h
  52. demographic_metrics_provider_unittest.cc
  53. drive_metrics_provider.cc
  54. drive_metrics_provider.h
  55. drive_metrics_provider_android.cc
  56. drive_metrics_provider_fuchsia.cc
  57. drive_metrics_provider_ios.mm
  58. drive_metrics_provider_linux.cc
  59. drive_metrics_provider_mac.mm
  60. drive_metrics_provider_unittest.cc
  61. drive_metrics_provider_win.cc
  62. enabled_state_provider.cc
  63. enabled_state_provider.h
  64. entropy_state.cc
  65. entropy_state.h
  66. entropy_state_provider.cc
  67. entropy_state_provider.h
  68. entropy_state_provider_unittest.cc
  69. entropy_state_unittest.cc
  70. environment_recorder.cc
  71. environment_recorder.h
  72. environment_recorder_unittest.cc
  73. expired_histogram_util.cc
  74. expired_histogram_util.h
  75. expired_histograms_checker.cc
  76. expired_histograms_checker.h
  77. expired_histograms_checker_unittest.cc
  78. field_trials_provider.cc
  79. field_trials_provider.h
  80. field_trials_provider_unittest.cc
  81. file_metrics_provider.cc
  82. file_metrics_provider.h
  83. file_metrics_provider_unittest.cc
  84. generate_expired_histograms_array.gni
  85. histogram_encoder.cc
  86. histogram_encoder.h
  87. histogram_encoder_unittest.cc
  88. library_support/
  89. log_decoder.cc
  90. log_decoder.h
  91. log_decoder_unittest.cc
  92. log_store.h
  93. machine_id_provider.h
  94. machine_id_provider_nonwin.cc
  95. machine_id_provider_nonwin_unittest.cc
  96. machine_id_provider_win.cc
  97. machine_id_provider_win_unittest.cc
  98. metrics_log.cc
  99. metrics_log.h
  100. metrics_log_manager.cc
  101. metrics_log_manager.h
  102. metrics_log_manager_unittest.cc
  103. metrics_log_store.cc
  104. metrics_log_store.h
  105. metrics_log_store_unittest.cc
  106. metrics_log_unittest.cc
  107. metrics_log_uploader.h
  108. metrics_pref_names.cc
  109. metrics_pref_names.h
  110. metrics_provider.cc
  111. metrics_provider.h
  112. metrics_reporting_default_state.cc
  113. metrics_reporting_default_state.h
  114. metrics_reporting_service.cc
  115. metrics_reporting_service.h
  116. metrics_rotation_scheduler.cc
  117. metrics_rotation_scheduler.h
  118. metrics_scheduler.cc
  119. metrics_scheduler.h
  120. metrics_service.cc
  121. metrics_service.h
  122. metrics_service_accessor.cc
  123. metrics_service_accessor.h
  124. metrics_service_client.cc
  125. metrics_service_client.h
  126. metrics_service_client_unittest.cc
  127. metrics_service_unittest.cc
  128. metrics_state_manager.cc
  129. metrics_state_manager.h
  130. metrics_state_manager_unittest.cc
  131. metrics_switches.cc
  132. metrics_switches.h
  133. metrics_upload_scheduler.cc
  134. metrics_upload_scheduler.h
  135. net/
  136. persistent_histograms.cc
  137. persistent_histograms.h
  138. persistent_system_profile.cc
  139. persistent_system_profile.h
  140. persistent_system_profile_unittest.cc
  141. public/
  142. reporting_service.cc
  143. reporting_service.h
  144. reporting_service_unittest.cc
  145. serialization/
  146. single_sample_metrics.cc
  147. single_sample_metrics.h
  148. single_sample_metrics_factory_impl.cc
  149. single_sample_metrics_factory_impl.h
  150. single_sample_metrics_factory_impl_unittest.cc
  151. stability_metrics_helper.cc
  152. stability_metrics_helper.h
  153. stability_metrics_helper_unittest.cc
  154. stability_metrics_provider.cc
  155. stability_metrics_provider.h
  156. stability_metrics_provider_unittest.cc
  157. structured/
  158. system_memory_stats_recorder.h
  159. system_memory_stats_recorder_linux.cc
  160. system_session_analyzer/
  161. test/
  162. ui/
  163. ukm_demographic_metrics_provider.h
  164. unsent_log_store.cc
  165. unsent_log_store.h
  166. unsent_log_store_metrics.cc
  167. unsent_log_store_metrics.h
  168. unsent_log_store_metrics_impl.cc
  169. unsent_log_store_metrics_impl.h
  170. unsent_log_store_metrics_impl_unittest.cc
  171. unsent_log_store_unittest.cc
  172. url_constants.cc
  173. url_constants.h
  174. version_utils.cc
  175. version_utils.h