summaryrefslogtreecommitdiffstats
path: root/base/process_util_linux.cc
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 17:28:25 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 17:28:25 +0000
commitfd940fcb22ba591ed1f24b91de77457c8558b14b (patch)
tree382be1d36dd7636b4f907eacb7f75686515dc553 /base/process_util_linux.cc
parent6ddf367cd5db2374c77c697cb75e582f486e60a5 (diff)
downloadchromium_src-fd940fcb22ba591ed1f24b91de77457c8558b14b.zip
chromium_src-fd940fcb22ba591ed1f24b91de77457c8558b14b.tar.gz
chromium_src-fd940fcb22ba591ed1f24b91de77457c8558b14b.tar.bz2
Update ProcessIterator::CheckForNextProcess to get exe name from /proc/pid/exe.
The startup performance_ui_tests have been hanging on the perf bots since they were upgraded to precise. I tracked this down to GetRunningChromeProcesses() not returning all of the chrome processes so the ProxyLauncher can't kill them all. When the ProxyLauncher doesn't kill all child chrome processes, the buildbot step hangs. It turns out that when the test hangs, there is a chrome process which has correct entries in /proc/pid/cmdline and /proc/pid/exe, but the short executable name in /proc/pid/stat is "dconf worker" instead of "chrome". This fools the NamedProcessIterator into not matching it as a chrome process. This incorrect information in /proc/pid/stat is bizarre and I have no idea what the root cause is. But since there was a TODO here anyway to get the process name from cmdline instead of stat, I went ahead and did that as a workaround. BUG=235893 TEST=Startup performance_ui_tests and base_unittests R=jar@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/14561002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_linux.cc')
-rw-r--r--base/process_util_linux.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index e06d99c..2c2824f 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -391,10 +391,7 @@ bool ProcessIterator::CheckForNextProcess() {
entry_.ppid_ = GetProcStatsFieldAsInt(proc_stats, VM_PPID);
entry_.gid_ = GetProcStatsFieldAsInt(proc_stats, VM_PGRP);
entry_.cmd_line_args_.assign(cmd_line_args.begin(), cmd_line_args.end());
-
- // TODO(port): read pid's commandline's $0, like killall does. Using the
- // short name between openparen and closeparen won't work for long names!
- entry_.exe_file_ = GetProcStatsFieldAsString(proc_stats, VM_COMM);
+ entry_.exe_file_ = GetProcessExecutablePath(pid).BaseName().value();
return true;
}