From d04cf5ff9d9bbaeb0c7af500ab1e6839d9a55e14 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 12 Jul 2005 21:31:25 +0000 Subject: 2005-07-12 Frank Ch. Eigler * 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. --- buildrun.cxx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'buildrun.cxx') 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 +#include + +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; + } } -- cgit