Chromium Code Reviews| Index: base/process/process_metrics_mac.cc |
| diff --git a/base/process/process_metrics_mac.cc b/base/process/process_metrics_mac.cc |
| index 7fc931748ae3fa292c45fd509a9fd81db24a0a27..a3c2d6a14aa6acbd2e07e9afd6a55a836bbb3f10 100644 |
| --- a/base/process/process_metrics_mac.cc |
| +++ b/base/process/process_metrics_mac.cc |
| @@ -324,6 +324,17 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() { |
| // where TASK_POWER_INFO isn't supported yet. |
| return 0; |
| } |
| + |
| + // The task_power_info struct contains two wakeup counters: |
| + // task_interrupt_wakeups and task_platform_idle_wakeups. |
| + // task_interrupt_wakeups is the total number of wakeups generated by the |
| + // process, and is the number that Activity Monitor reports. |
| + // task_platform_idle_wakeups is a subset of task_interrupt_wakeups that |
| + // tallies the number of times the processor was taken out of its low-power |
| + // idle state to handle a wakeup. task_platform_idle_wakeups therefore result |
| + // in a greater power increase than the other interrupts which occur while the |
| + // CPU is already working, and reducing them has a greater overall impact on |
| + // power usage. See the powermetrics man page for more info. |
|
brucedawson
2017/02/02 19:52:03
That's pretty cool. I wish we had that information
|
| return CalculateIdleWakeupsPerSecond( |
| power_info_data.task_platform_idle_wakeups); |
| } |