summaryrefslogtreecommitdiffstats
path: root/grapher/StapParser.cxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-11 14:03:47 +0100
committerTim Moore <timoore@redhat.com>2009-12-11 14:16:26 +0100
commite47f92ea31a605802c59541ca325ffd567c45ca4 (patch)
tree8a10b369ed8836cf9c87cadc45050e67d768ca09 /grapher/StapParser.cxx
parente83324285bb277300f5c91ee1c2a39bf04df502d (diff)
downloadsystemtap-steved-e47f92ea31a605802c59541ca325ffd567c45ca4.tar.gz
systemtap-steved-e47f92ea31a605802c59541ca325ffd567c45ca4.tar.xz
systemtap-steved-e47f92ea31a605802c59541ca325ffd567c45ca4.zip
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.
Diffstat (limited to 'grapher/StapParser.cxx')
-rw-r--r--grapher/StapParser.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/grapher/StapParser.cxx b/grapher/StapParser.cxx
index 2513680b..2595e8cc 100644
--- a/grapher/StapParser.cxx
+++ b/grapher/StapParser.cxx
@@ -288,4 +288,22 @@ vector<string> commaSplit(const boost::sub_range<Glib::ustring>& range)
_inFd, inCond);
}
+
+ void StapParser::disconnect()
+ {
+ if (_ioConnection.connected())
+ _ioConnection.disconnect();
+ if (_errIoConnection.connected())
+ _errIoConnection.disconnect();
+ if (_inFd >= 0)
+ {
+ close(_inFd);
+ _inFd = -1;
+ }
+ if (_errFd >= 0)
+ {
+ close(_errFd);
+ _errFd = -1;
+ }
+ }
}