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

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

Issue 607733002: [telemetry] Detect and correct overflow in Intel energy MSRs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Docstring. Created 6 years, 3 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/platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/linux_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
index 9e6cb55c75771cad435fcb9fdcf071ef1bb59b52..bea862803c9ed720698ed20b3697ea12252e7b7b 100644
--- a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
@@ -103,7 +103,7 @@ class LinuxPlatformBackend(
def StopMonitoringPower(self):
return self._power_monitor.StopMonitoringPower()
- def ReadMsr(self, msr_number):
+ def ReadMsr(self, msr_number, start=0, length=64):
cmd = ['/usr/sbin/rdmsr', '-d', str(msr_number)]
(out, err) = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
@@ -114,7 +114,7 @@ class LinuxPlatformBackend(
result = int(out)
except ValueError:
raise OSError('Cannot interpret rdmsr output: %s' % out)
- return result
+ return result >> start & ((1 << length) - 1)
def _IsIpfwKernelModuleInstalled(self):
return 'ipfw_mod' in subprocess.Popen(
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698