diff options
author | fche <fche> | 2005-07-12 21:31:25 +0000 |
---|---|---|
committer | fche <fche> | 2005-07-12 21:31:25 +0000 |
commit | d04cf5ff9d9bbaeb0c7af500ab1e6839d9a55e14 (patch) | |
tree | 7d3966927397848ccae4797de08241b24d5897e1 /buildrun.cxx | |
parent | f4e12f02458ef7846f50c22887a907d93068738a (diff) | |
download | systemtap-steved-d04cf5ff9d9bbaeb0c7af500ab1e6839d9a55e14.tar.gz systemtap-steved-d04cf5ff9d9bbaeb0c7af500ab1e6839d9a55e14.tar.xz systemtap-steved-d04cf5ff9d9bbaeb0c7af500ab1e6839d9a55e14.zip |
2005-07-12 Frank Ch. Eigler <fche@redhat.com>
* buildrun.cxx (compile_pass): Make non-verbose mode quieter.
(run_pass): Spawn stpd for dirty work.
* Makefile.am: Also build stpd into libexecdir.
* configure.ac: Pass LIBEXECDIR.
* Makefile.in, configure, config.in: Regenerated.
* AUTHORS: Update.
Diffstat (limited to 'buildrun.cxx')
-rw-r--r-- | buildrun.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/buildrun.cxx b/buildrun.cxx index 151c5ecd..2ec5e03c 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -10,10 +10,17 @@ #include "buildrun.h" #include <fstream> +#include <sstream> + +extern "C" { +#include "signal.h" +} + using namespace std; + int compile_pass (systemtap_session& s) { @@ -35,8 +42,9 @@ compile_pass (systemtap_session& s) string module_dir = string("/lib/modules/") + s.kernel_release + "/build"; string make_cmd = string("make") + string (" -C \"") + module_dir + string("\""); - if (! s.verbose) make_cmd += " -s"; make_cmd += string(" M=\"") + s.tmpdir + string("\" modules"); + if (! s.verbose) + make_cmd += " -s >/dev/null 2>&1"; if (s.verbose) clog << "Running " << make_cmd << endl; int rc = system (make_cmd.c_str()); @@ -50,8 +58,24 @@ compile_pass (systemtap_session& s) } + int run_pass (systemtap_session& s) { - return 1; + if (s.test_mode) + return 1; // XXX: don't know how to do this yet + else // real run + { + // leave parent process alone + sighandler_t oldsig = signal (SIGINT, SIG_IGN); + + // for now, just spawn stpd + string stpd_cmd = string("/usr/bin/sudo ") + + string(LIBEXECDIR) + "/stpd " + s.tmpdir + "/" + s.module_name + ".ko"; + if (s.verbose) clog << "Running " << stpd_cmd << endl; + int rc = system (stpd_cmd.c_str ()); + + signal (SIGINT, oldsig); + return rc; + } } |