| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Parses a PerfStatProto from serialized data |perf_stat|, if it exists. | 125 // Parses a PerfStatProto from serialized data |perf_stat|, if it exists. |
| 126 // Only one of these may contain data. If both |perf_data| and |perf_stat| | 126 // Only one of these may contain data. If both |perf_data| and |perf_stat| |
| 127 // contain data, it is counted as an error and neither is parsed. | 127 // contain data, it is counted as an error and neither is parsed. |
| 128 // |incognito_observer| indicates whether an incognito window had been opened | 128 // |incognito_observer| indicates whether an incognito window had been opened |
| 129 // during the profile collection period. If there was an incognito window, | 129 // during the profile collection period. If there was an incognito window, |
| 130 // discard the incoming data. | 130 // discard the incoming data. |
| 131 // |trigger_event| is the cause of the perf data collection. | 131 // |trigger_event| is the cause of the perf data collection. |
| 132 // |result| is the return value of running perf/quipper. It is 0 if successful | 132 // |result| is the return value of running perf/quipper. It is 0 if successful |
| 133 // and nonzero if not successful. | 133 // and nonzero if not successful. |
| 134 void ParseOutputProtoIfValid( | 134 void ParseOutputProtoIfValid( |
| 135 scoped_ptr<WindowedIncognitoObserver> incognito_observer, | 135 std::unique_ptr<WindowedIncognitoObserver> incognito_observer, |
| 136 scoped_ptr<SampledProfile> sampled_profile, | 136 std::unique_ptr<SampledProfile> sampled_profile, |
| 137 int result, | 137 int result, |
| 138 const std::vector<uint8_t>& perf_data, | 138 const std::vector<uint8_t>& perf_data, |
| 139 const std::vector<uint8_t>& perf_stat); | 139 const std::vector<uint8_t>& perf_stat); |
| 140 | 140 |
| 141 // Called when a session restore has finished. | 141 // Called when a session restore has finished. |
| 142 void OnSessionRestoreDone(int num_tabs_restored); | 142 void OnSessionRestoreDone(int num_tabs_restored); |
| 143 | 143 |
| 144 // Turns off perf collection. Does not delete any data that was already | 144 // Turns off perf collection. Does not delete any data that was already |
| 145 // collected and stored in |cached_perf_data_|. | 145 // collected and stored in |cached_perf_data_|. |
| 146 void Deactivate(); | 146 void Deactivate(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // collections. | 187 // collections. |
| 188 void OnUserLoggedIn(); | 188 void OnUserLoggedIn(); |
| 189 | 189 |
| 190 // Selects a random time in the upcoming profiling interval that begins at | 190 // Selects a random time in the upcoming profiling interval that begins at |
| 191 // |next_profiling_interval_start_|. Schedules |timer_| to invoke | 191 // |next_profiling_interval_start_|. Schedules |timer_| to invoke |
| 192 // DoPeriodicCollection() when that time comes. | 192 // DoPeriodicCollection() when that time comes. |
| 193 void ScheduleIntervalCollection(); | 193 void ScheduleIntervalCollection(); |
| 194 | 194 |
| 195 // Collects perf data for a given |trigger_event|. Calls perf via the ChromeOS | 195 // Collects perf data for a given |trigger_event|. Calls perf via the ChromeOS |
| 196 // debug daemon's dbus interface. | 196 // debug daemon's dbus interface. |
| 197 void CollectIfNecessary(scoped_ptr<SampledProfile> sampled_profile); | 197 void CollectIfNecessary(std::unique_ptr<SampledProfile> sampled_profile); |
| 198 | 198 |
| 199 // Collects perf data on a repeating basis by calling CollectIfNecessary() and | 199 // Collects perf data on a repeating basis by calling CollectIfNecessary() and |
| 200 // reschedules it to be collected again. | 200 // reschedules it to be collected again. |
| 201 void DoPeriodicCollection(); | 201 void DoPeriodicCollection(); |
| 202 | 202 |
| 203 // Collects perf data after a resume. |sleep_duration| is the duration the | 203 // Collects perf data after a resume. |sleep_duration| is the duration the |
| 204 // system was suspended before resuming. |time_after_resume_ms| is how long | 204 // system was suspended before resuming. |time_after_resume_ms| is how long |
| 205 // ago the system resumed. | 205 // ago the system resumed. |
| 206 void CollectPerfDataAfterResume(const base::TimeDelta& sleep_duration, | 206 void CollectPerfDataAfterResume(const base::TimeDelta& sleep_duration, |
| 207 const base::TimeDelta& time_after_resume); | 207 const base::TimeDelta& time_after_resume); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // (currently only Intel uarchs supported), or a CPU model name substring. | 266 // (currently only Intel uarchs supported), or a CPU model name substring. |
| 267 std::string FindBestCpuSpecifierFromParams( | 267 std::string FindBestCpuSpecifierFromParams( |
| 268 const std::map<std::string, std::string>& params, | 268 const std::map<std::string, std::string>& params, |
| 269 const CPUIdentity& cpuid); | 269 const CPUIdentity& cpuid); |
| 270 | 270 |
| 271 } // namespace internal | 271 } // namespace internal |
| 272 | 272 |
| 273 } // namespace metrics | 273 } // namespace metrics |
| 274 | 274 |
| 275 #endif // CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ | 275 #endif // CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_ |
| OLD | NEW |