Revert of [telemetry] Read MSRs from a separate privileged process. (patchset #3...
commit773f55fe82f0f443408838606dd6cad8df171f39
authorvasilii <vasilii@chromium.org>
Fri, 19 Sep 2014 08:32:28 +0000 (19 01:32 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 19 Sep 2014 08:32:46 +0000 (19 08:32 +0000)
tree5988f80b0ce0c68608e9903c989e3f7bc3bdba3d
parenta3b755859b3113c74df16939f124bc42464092b1
Revert of [telemetry] Read MSRs from a separate privileged process. (patchset #3 id:40001 of https://codereview.chromium.org/578123002/)

Reason for revert:
Fails telemetry_unittests and telemetry_perf_unittests on XP Tests (2) http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%282%29/builds/35314

Traceback (most recent call last):
  run at E:\b\depot_tools\python276_bin\lib\unittest\case.py:331
    testMethod()
  testPowerMonitoringSync at tools\telemetry\telemetry\core\platform\platform_backend_unittest.py:16
    if not platform.CanMonitorPower():
  CanMonitorPower at tools\telemetry\telemetry\core\platform\__init__.py:248
    return self._platform_backend.CanMonitorPower()
  CanMonitorPower at tools\telemetry\telemetry\core\platform\win_platform_backend.py:313
    return self._power_monitor.CanMonitorPower()
  CanMonitorPower at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:51
    if self._PackageEnergyJoules() <= 0:
  _PackageEnergyJoules at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:97
    return (self._backend.ReadMsr(MSR_PKG_ENERGY_STATUS) *
  ReadMsr at tools\telemetry\telemetry\core\platform\win_platform_backend.py:347
    self._StartMsrServerIfNeeded()
  _StartMsrServerIfNeeded at tools\telemetry\telemetry\core\platform\win_platform_backend.py:338
    sys.executable, parameters, elevate_privilege=True)
  LaunchApplication at tools\telemetry\telemetry\core\platform\win_platform_backend.py:293
    if elevate_privilege and not IsCurrentProcessElevated():
  IsCurrentProcessElevated at tools\telemetry\telemetry\core\platform\win_platform_backend.py:80
    win32security.GetTokenInformation(token, win32security.TokenElevation))
error: (87, 'GetTokenInformation', 'The parameter is incorrect.')

Locals:
  handle : -1
  token  : <PyHANDLE:0>

[  FAILED  ] platform.platform_backend_unittest.PlatformBackendTest.testPowerMonitoringSync (3422 ms)

Traceback (most recent call last):
  run at E:\b\depot_tools\python276_bin\lib\unittest\case.py:331
    testMethod()
  wrapper at tools\telemetry\telemetry\decorators.py:84
    func(*args, **kwargs)
  testMsrRuns at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor_unittest.py:19
    if not power_monitor.CanMonitorPower():
  CanMonitorPower at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:51
    if self._PackageEnergyJoules() <= 0:
  _PackageEnergyJoules at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:97
    return (self._backend.ReadMsr(MSR_PKG_ENERGY_STATUS) *
  ReadMsr at tools\telemetry\telemetry\core\platform\win_platform_backend.py:347
    self._StartMsrServerIfNeeded()
  _StartMsrServerIfNeeded at tools\telemetry\telemetry\core\platform\win_platform_backend.py:338
    sys.executable, parameters, elevate_privilege=True)
  LaunchApplication at tools\telemetry\telemetry\core\platform\win_platform_backend.py:293
    if elevate_privilege and not IsCurrentProcessElevated():
  IsCurrentProcessElevated at tools\telemetry\telemetry\core\platform\win_platform_backend.py:80
    win32security.GetTokenInformation(token, win32security.TokenElevation))
error: (87, 'GetTokenInformation', 'The parameter is incorrect.')

Locals:
  handle : -1
  token  : <PyHANDLE:0>

[  FAILED  ] platform.power_monitor.msr_power_monitor_unittest.MsrPowerMonitorTest.testMsrRuns (32 ms)
[----------] 1 test (32 ms total)

Traceback (most recent call last):
  run at E:\b\depot_tools\python276_bin\lib\unittest\case.py:331
    testMethod()
  wrapper at tools\telemetry\telemetry\decorators.py:55
    func(*args, **kwargs)
  BenchmarkSmokeTest at tools\perf\benchmarks\benchmark_unittest.py:59
    self.assertEqual(0, SinglePageBenchmark().Run(options),
  Run at tools\telemetry\telemetry\benchmark.py:95
    page_runner.Run(pt, ps, expectations, finder_options, results)
  Run at tools\telemetry\telemetry\page\page_runner.py:429
    page, credentials_path, possible_browser, results, state)
  _PrepareAndRunPage at tools\telemetry\telemetry\page\page_runner.py:259
    finder_options)
  StartBrowserIfNeeded at tools\telemetry\telemetry\page\page_runner.py:54
    test.WillStartBrowser(possible_browser.platform)
  WillStartBrowser at tools\perf\measurements\webrtc.py:21
    self._power_metric = power.PowerMetric(platform)
  __init__ at tools\perf\metrics\power.py:31
    self._MeasureQuiescentPower(quiescent_measurement_time_s)
  _MeasureQuiescentPower at tools\perf\metrics\power.py:54
    if not self._platform.CanMonitorPower() or \
  CanMonitorPower at tools\telemetry\telemetry\core\platform\__init__.py:248
    return self._platform_backend.CanMonitorPower()
  CanMonitorPower at tools\telemetry\telemetry\core\platform\win_platform_backend.py:313
    return self._power_monitor.CanMonitorPower()
  CanMonitorPower at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:51
    if self._PackageEnergyJoules() <= 0:
  _PackageEnergyJoules at tools\telemetry\telemetry\core\platform\power_monitor\msr_power_monitor.py:97
    return (self._backend.ReadMsr(MSR_PKG_ENERGY_STATUS) *
  ReadMsr at tools\telemetry\telemetry\core\platform\win_platform_backend.py:347
    self._StartMsrServerIfNeeded()
  _StartMsrServerIfNeeded at tools\telemetry\telemetry\core\platform\win_platform_backend.py:338
    sys.executable, parameters, elevate_privilege=True)
  LaunchApplication at tools\telemetry\telemetry\core\platform\win_platform_backend.py:293
    if elevate_privilege and not IsCurrentProcessElevated():
  IsCurrentProcessElevated at tools\telemetry\telemetry\core\platform\win_platform_backend.py:80
    win32security.GetTokenInformation(token, win32security.TokenElevation))
error: (87, 'GetTokenInformation', 'The parameter is incorrect.')

Locals:
  handle : -1
  token  : <PyHANDLE:0>

[  FAILED  ] BenchmarkSmokeTest.webrtc.webrtc_cases (766 ms)

Original issue's description:
> [telemetry] Read MSRs from a separate privileged process.
>
> This allows us to read MSRs on Windows Vista+.
> Also move ReadMsr into PlatformBackend.
>
> BUG=336558
> TEST=tools/telemetry/run_tests msr
>
> Committed: https://crrev.com/2156b0323c83d6f11e68344ecf7e7e0c833cfa14
> Cr-Commit-Position: refs/heads/master@{#295634}

TBR=tonyg@chromium.org,thestig@chromium.org,dtu@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=336558

Review URL: https://codereview.chromium.org/582123003

Cr-Commit-Position: refs/heads/master@{#295678}
tools/telemetry/telemetry/core/platform/msr_server_win.py [deleted file]
tools/telemetry/telemetry/core/platform/platform_backend.py
tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor.py
tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py
tools/telemetry/telemetry/core/platform/win_platform_backend.py