Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: base/process/process_metrics_mac.cc

Issue 2667023004: Add comments explaining Task Manager idle wakeups computation. (Closed)
Patch Set: Restore code, add a comment. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/process/process_metrics.cc ('K') | « base/process/process_metrics.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« base/process/process_metrics.cc ('K') | « base/process/process_metrics.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698