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

Unified Diff: tools/telemetry/telemetry/core/platform/mac_platform_backend.py

Issue 501813002: [Telemetry] Fix idle wakeup reporting in the face of dead processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cpu_stats comment. Created 6 years, 4 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
Index: tools/telemetry/telemetry/core/platform/mac_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
index 1823483406064106f1870b2d00b8f1fdb1339b7d..814f0c6b2fcffe928a4847e1587c73c00cc0b5cf 100644
--- a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
@@ -9,6 +9,7 @@ import time
from telemetry import decorators
from telemetry.core.platform import platform_backend
from telemetry.core.platform import posix_platform_backend
+from telemetry.core.platform import process_statistic_timeline_data
from telemetry.core.platform.power_monitor import powermetrics_power_monitor
try:
@@ -46,13 +47,14 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
# Sometimes top won't return anything here, just ignore such cases -
# crbug.com/354812 .
if top_output[-2] != 'IDLEW':
- return 0
+ return process_statistic_timeline_data.IdleWakeupTimelineData(pid, 0)
# Numbers reported by top may have a '+' appended.
wakeup_count = int(top_output[-1].strip('+ '))
- return wakeup_count
+ return process_statistic_timeline_data.IdleWakeupTimelineData(pid,
+ wakeup_count)
def GetCpuStats(self, pid):
- """Return current cpu processing time of pid in seconds."""
+ """Returns a dict of cpu statistics for the process represented by |pid|."""
class ProcTaskInfo(ctypes.Structure):
"""Struct for proc_pidinfo() call."""
_fields_ = [("pti_virtual_size", ctypes.c_uint64),

Powered by Google App Engine
This is Rietveld 408576698