summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2011-04-26 16:37:21 +0000
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2011-04-26 16:37:21 +0000
commit542492fc7c44c3fbf12ccb22dbae2ad89df2df27 (patch)
tree35a6b5b166b0f608d4494f4b36367690bae1488e /client
parent2a1357e4b0b6cb33c072825b0fb845b9e1b25604 (diff)
perf profiler: exec perf record so it is stoppable
perf was being executed via a shell, this means that the pid in self._process.pid will be the pid of the shell and the actual pid of perf will be a child of that process. This would be fine in practice except that the signal being used to stop perf is SIGINT, and this is being sent to the shell. The shell won't necessarily deliver this to its child process (no controlling tty) so what happens is that the shell ignores the signal and we get stuck in self._process.wait() There's no reason to keep the intermediate shell around, so prefix the command with "exec" so that the shell replaces itself with perf and the pid we know is perf, and SIGINT is sent to perf. Signed-off-by: Scott James Remnant <keybuk@chromium.org> git-svn-id: svn://test.kernel.org/autotest/trunk@5325 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'client')
-rw-r--r--client/profilers/perf/perf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/profilers/perf/perf.py b/client/profilers/perf/perf.py
index 90c33b86..7eff135c 100644
--- a/client/profilers/perf/perf.py
+++ b/client/profilers/perf/perf.py
@@ -34,7 +34,7 @@ class perf(profiler.profiler):
def start(self, test):
self.logfile = os.path.join(test.profdir, "perf")
- cmd = ("%s record -a -o %s" %
+ cmd = ("exec %s record -a -o %s" %
(self.perf_bin, self.logfile))
for event in self.events:
cmd += " -e %s" % event