diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 00:41:02 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 00:41:02 +0000 |
commit | bc52042b608630aab63e9254ad06c2e0e20372d1 (patch) | |
tree | 425090afbace4ee497253b7c606e30828c2767d8 /tools | |
parent | 9ea0a0e1fba313a222c72a939e1e004c66be6cce (diff) | |
download | chromium_src-bc52042b608630aab63e9254ad06c2e0e20372d1.zip chromium_src-bc52042b608630aab63e9254ad06c2e0e20372d1.tar.gz chromium_src-bc52042b608630aab63e9254ad06c2e0e20372d1.tar.bz2 |
[Telemetry] Fix GetChildPids() on windows.
This fixes the process metrics on the windows page cyclers. The bug was that
wmic process doesn't output fields in the same order as they are specified. So
even though we specified ProcessId,ParentProcessId, it was outputting parent
first. So I corrected pid_ppid -> ppid, pid. I also changed the order we
specify the fields to enhance readability, but that is a functional no-op.
BUG=196411
TEST=python tools\perf\run_multipage_benchmarks --browser=system page_cycler tools\perf\page_sets\page_cycler\moz.json
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/12659006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/telemetry/telemetry/core/chrome/win_platform_backend.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/telemetry/telemetry/core/chrome/win_platform_backend.py b/tools/telemetry/telemetry/core/chrome/win_platform_backend.py index 5a0c4e1..126a1bd 100644 --- a/tools/telemetry/telemetry/core/chrome/win_platform_backend.py +++ b/tools/telemetry/telemetry/core/chrome/win_platform_backend.py @@ -87,12 +87,13 @@ class WinPlatformBackend(platform_backend.PlatformBackend): """Retunds a list of child pids of |pid|.""" child_pids = [] pid_ppid_list = subprocess.Popen(['wmic', 'process', 'get', - 'ProcessId,ParentProcessId'], + 'ParentProcessId,ProcessId'], stdout=subprocess.PIPE).communicate()[0] for pid_ppid in pid_ppid_list.splitlines()[1:]: #skip header if not pid_ppid: continue - pid_ppid = pid_ppid.split() - if int(pid_ppid[1].strip()) == pid: - child_pids.append(int(pid_ppid[0].strip())) + curr_ppid, curr_pid = pid_ppid.split() + if int(curr_ppid) == pid: + child_pids.append(int(curr_pid)) + child_pids.extend(self.GetChildPids(int(curr_pid))) return child_pids |