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

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

Issue 190743002: Measure private dirty memory on OS that have /proc (e.g. Linux). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test Created 6 years, 9 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py b/tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py
index aabeba11cdedecdc592dfa012a93eeaad9ec4aa1..8a7ddd0d81593fd16f8825b97c2a98c684106e4b 100644
--- a/tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py
@@ -59,8 +59,15 @@ class ProcSupportingPlatformBackend(platform_backend.PlatformBackend):
wss = int(stats[23]) * resource.getpagesize()
wss_peak = (self._ConvertKbToByte(status['VmHWM'])
if 'VmHWM' in status else wss)
+
+ private_dirty_bytes = 0
+ for line in self._GetProcFileForPid(pid, 'smaps').splitlines():
+ if line.startswith('Private_Dirty:'):
+ private_dirty_bytes += self._ConvertKbToByte(line.split(':')[1].strip())
+
return {'VM': vm,
'VMPeak': vm_peak,
+ 'PrivateDirty': private_dirty_bytes,
'WorkingSetSize': wss,
'WorkingSetSizePeak': wss_peak}
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698