diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-08 23:17:47 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-08 23:34:00 +0100 |
commit | 8cabc8bcdcd22e8726734f1a18f23ed7d9c19e9f (patch) | |
tree | 5cc6fc14a7b51859a0bf181c10d08b5d75fff03f /grapher/StapParser.cxx | |
parent | cfd482078cd4805076cc6fd7e4e8642b97a03b25 (diff) | |
download | systemtap-steved-8cabc8bcdcd22e8726734f1a18f23ed7d9c19e9f.tar.gz systemtap-steved-8cabc8bcdcd22e8726734f1a18f23ed7d9c19e9f.tar.xz systemtap-steved-8cabc8bcdcd22e8726734f1a18f23ed7d9c19e9f.zip |
grapher: start of a dialog for displaying active stap processes
The names of active scripts are displayed in a list; mock buttons
suggest being able to stop and restart them.
* grapher/processwindow.glade: new file
* grapher/Makefile.am: add processwindow.glade to installed files
* grapher/StapParser.hxx (StapProcess): new class
(StapParser): factor out members that are now in StapProcess
(ioCallback): Use the new childDied signal instead of aborting the
whole grapher when a child dies.
* grapher/grapher.cxx (ProcModelColumns, ProcWindow): classes for
displaying stap process window.
(GrapherWindow::on_menu_proc_window): new function
Diffstat (limited to 'grapher/StapParser.cxx')
-rw-r--r-- | grapher/StapParser.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/grapher/StapParser.cxx b/grapher/StapParser.cxx index 653c00de..b82cc024 100644 --- a/grapher/StapParser.cxx +++ b/grapher/StapParser.cxx @@ -25,6 +25,12 @@ namespace systemtap using namespace std; using namespace std::tr1; + sigc::signal<void, pid_t>& childDiedSignal() + { + static sigc::signal<void, pid_t> deathSignal; + return deathSignal; + } + vector<string> commaSplit(const boost::sub_range<Glib::ustring>& range) { using namespace boost; @@ -72,7 +78,7 @@ vector<string> commaSplit(const boost::sub_range<Glib::ustring>& range) using namespace boost; if (ioCondition & Glib::IO_HUP) { - _win->hide(); + childDiedSignal().emit(getPid()); return true; } if ((ioCondition & Glib::IO_IN) == 0) @@ -82,7 +88,7 @@ vector<string> commaSplit(const boost::sub_range<Glib::ustring>& range) bytes_read = read(_inFd, buf, sizeof(buf) - 1); if (bytes_read <= 0) { - _win->hide(); + childDiedSignal().emit(getPid()); return true; } _buffer.append(buf, bytes_read); @@ -242,7 +248,7 @@ vector<string> commaSplit(const boost::sub_range<Glib::ustring>& range) bytes_read = read(_errFd, buf, sizeof(buf) - 1); if (bytes_read <= 0) { - _win->hide(); + cerr << "StapParser: error reading from stderr!\n"; return true; } if (write(STDOUT_FILENO, buf, bytes_read) < 0) |