diff --git a/mozilla/testing/performance/talos/cmanager_mac.py b/mozilla/testing/performance/talos/cmanager_mac.py index 98eaa981e64..10e1dbdcd7f 100644 --- a/mozilla/testing/performance/talos/cmanager_mac.py +++ b/mozilla/testing/performance/talos/cmanager_mac.py @@ -60,32 +60,32 @@ import ffprocess def GetProcessData(pid): """Runs a ps on the process identified by pid and returns the output line - as a list (uid, pid, ppid, cpu, pri, ni, vsz, rss, wchan, stat, tt, time, command) + as a list (pid, vsz, rss) """ - command = ['ps -Acup'+str(pid)] + command = ['ps -o pid,vsize,rss -p'+str(pid)] handle = subprocess.Popen(command, stdout=subprocess.PIPE, universal_newlines=True, shell=True) handle.wait() data = handle.stdout.readlines() - # find all matching processes and add them to the list - for line in data: - if line.find(str(pid)) >= 0: - # splits by whitespace - line = line.split() - if (line[1] == str(pid)): - return line + # First line is header output should look like: + # PID VSZ RSS + # 3210 75964 920 + line = data[1] + line = line.split() + if (line[0] == str(pid)): + return line def GetPrivateBytes(pid): """Calculate the amount of private, writeable memory allocated to a process. """ psData = GetProcessData(pid) - return psData[5] + return psData[2] def GetResidentSize(pid): """Retrieve the current resident memory for a given process""" psData = GetProcessData(pid) - return psData[4] + return psData[1] def GetCpuTime(pid): # return all zeros for now on this platform as per 7/18/07 perf meeting