diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-10 21:34:27 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-10 21:34:27 +0100 |
commit | 1b9fad80af5504ef03c2a88504dbc47bea003721 (patch) | |
tree | 316616e898f5c4b7375759ac857d3eca1b4beac5 /grapher/grapher.cxx | |
parent | b35632fd3d2547414c80023c5c60c847e3dc92ea (diff) | |
download | systemtap-steved-1b9fad80af5504ef03c2a88504dbc47bea003721.tar.gz systemtap-steved-1b9fad80af5504ef03c2a88504dbc47bea003721.tar.xz systemtap-steved-1b9fad80af5504ef03c2a88504dbc47bea003721.zip |
grapher: integrate graph events from stdin with the stap process framework.
This was the original way to do graphing and had bitrotted some.
* grapher/StapParser.cxx (initIO): new catchHUP argument
(ioCallback): Only disconnect signals, etc. on IN_HUP if catchHUP is
true.
(errIoCallback): Write error messages to stderr, not stdout.
* grapher/grapher.cxx (StapLauncher::launch): Don't catchHUP on our
stap process children.
(ProcWindow::refresh): Display something reasonable for the stap
"process" that is feeding stdin.
(main): Use StapParser::initIO to initialize parser reading from
stdin.
Diffstat (limited to 'grapher/grapher.cxx')
-rw-r--r-- | grapher/grapher.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx index e3d5289a..6dead221 100644 --- a/grapher/grapher.cxx +++ b/grapher/grapher.cxx @@ -293,7 +293,7 @@ int StapLauncher::launch() sp->setProcess(proc); parsers.push_back(sp); parserListChangedSignal().emit(); - sp->initIo(pipefd[0], pipefd[2]); + sp->initIo(pipefd[0], pipefd[2], false); return childPid; } @@ -422,14 +422,19 @@ void ProcWindow::refresh() ++spitr) { shared_ptr<StapProcess> sp = (*spitr)->getProcess(); + Gtk::TreeModel::iterator litr = _listStore->append(); + Gtk::TreeModel::Row row = *litr; if (sp) { - Gtk::TreeModel::iterator litr = _listStore->append(); - Gtk::TreeModel::Row row = *litr; row[_modelColumns._iconName] = sp->pid >= 0 ? "gtk-yes" : "gtk-no"; row[_modelColumns._scriptName] = sp->script; row[_modelColumns._proc] = sp; } + else + { + row[_modelColumns._iconName] = "gtk-yes"; + row[_modelColumns._scriptName] = "standard input"; + } } } @@ -615,11 +620,7 @@ int main(int argc, char** argv) if (argc == 2 && !std::strcmp(argv[1], "-")) { tr1::shared_ptr<StapParser> sp = launcher.makeStapParser(); - sp->setInFd(STDIN_FILENO); - Glib::signal_io().connect(sigc::mem_fun(sp.get(), - &StapParser::ioCallback), - STDIN_FILENO, - Glib::IO_IN | Glib::IO_HUP); + sp->initIo(STDIN_FILENO, -1, true); } else if (argc > 1) { |