| Index: chrome/browser/chromeos/power/cpu_data_collector.h
|
| diff --git a/chrome/browser/chromeos/power/cpu_data_collector.h b/chrome/browser/chromeos/power/cpu_data_collector.h
|
| index c9b4bcb849d6b87f9aabc9dbfa2ae48f85aeddae..1a772ef1e469b1e0b1764b857a774061bf6c11b2 100644
|
| --- a/chrome/browser/chromeos/power/cpu_data_collector.h
|
| +++ b/chrome/browser/chromeos/power/cpu_data_collector.h
|
| @@ -12,6 +12,7 @@
|
| #include <string>
|
| #include <vector>
|
|
|
| +#include "base/files/file_util.h"
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/time/time.h"
|
| @@ -71,6 +72,36 @@ class CpuDataCollector {
|
| // CPU state occupancy samples.
|
| void Start();
|
|
|
| + // Read CPU frequency data of a specific CPU from the file in |path| and fill
|
| + // |cpu_freq_state_names| and |freq_sample| with the data.
|
| + // Sample file looks like:
|
| + // 126000 223344
|
| + // 216000 93495
|
| + // ...
|
| + // 1800000 321907
|
| + static bool ReadCpuFreqTimeInState(
|
| + const base::FilePath& path,
|
| + std::vector<std::string>* cpu_freq_state_names,
|
| + CpuDataCollector::StateOccupancySample* freq_sample);
|
| +
|
| + // Read CPU frequency data of all CPUs from the file in |path| and fill
|
| + // |cpu_freq_state_names| and |freq_samples| with the data. |cpu_count| is the
|
| + // number of possible CPUs on the system. Note that |freq_samples| is not
|
| + // empty and sample at index i in |freq_samples| corresponds to the freq state
|
| + // information of the i-th CPU. |cpu_online| of each sample must be set before
|
| + // calling this function.
|
| + // Sample file looks like:
|
| + // freq cpu0 cpu1
|
| + // 126000 223344 223311
|
| + // 216000 93495 93450
|
| + // ...
|
| + // 1800000 321907 331897
|
| + static bool ReadCpuFreqAllTimeInState(
|
| + int cpu_count,
|
| + const base::FilePath& path,
|
| + std::vector<std::string>* cpu_freq_state_names,
|
| + std::vector<CpuDataCollector::StateOccupancySample>* freq_samples);
|
| +
|
| private:
|
| // Posts callbacks to the blocking pool which collect CPU state occupancy
|
| // samples from the sysfs.
|
|
|