From e47f92ea31a605802c59541ca325ffd567c45ca4 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 11 Dec 2009 14:03:47 +0100 Subject: grapher: implement restarting a stap process * grapher/StapParser.cxx (StapParser::disconnect): new function * grapher/StapParser.hxx (StapProcess::StapProcess): initialize argv to 0 * grapher/grapher.cxx (StapLauncher::setArgs): Set argv to 0 (StapLauncher launch, launchUsingParser): Refactor launch(), extracting function a that (re)launches a stap process using an existing parser. (StapLauncher::onChildDied): call disconnect() on dead parser. (GrapherWindow::_graphicalLauncher, setGraphicalLauncher): delete member, replacing with... (graphicalLauncher): new variable (ProcModelColumns): Store parser object in the list model instead of just a StapProcess object. (ProcWindow::onRestart): new function (ProcWindow::refresh): Preserve the list selection when the process list is refreshed. (ProcWindow::onSelectionChanged): Manage the restart button's state. --- grapher/StapParser.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/StapParser.hxx') diff --git a/grapher/StapParser.hxx b/grapher/StapParser.hxx index 24e84fc9..169533b6 100644 --- a/grapher/StapParser.hxx +++ b/grapher/StapParser.hxx @@ -18,7 +18,7 @@ namespace systemtap // arguments and script for a stap process struct StapProcess { - StapProcess(pid_t pid_ = -1) : pid(pid_) {} + StapProcess(pid_t pid_ = -1) : argv(0), pid(pid_) {} std::string stapArgs; std::string script; std::string scriptArgs; @@ -67,6 +67,7 @@ namespace systemtap _process = process; } void initIo(int inFd, int errFd, bool catchHUP); + void disconnect(); }; sigc::signal& childDiedSignal(); -- cgit