summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'buildrun.cxx')
-rw-r--r--buildrun.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index 867d0d0e..130f4a1b 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -92,6 +92,15 @@ compile_pass (systemtap_session& s)
}
+template <typename T>
+static string
+stringify(T t)
+{
+ ostringstream s;
+ s << t;
+ return s.str ();
+}
+
int
run_pass (systemtap_session& s)
@@ -114,8 +123,15 @@ run_pass (systemtap_session& s)
string stpd_cmd = string("/usr/bin/sudo ")
+ string(PKGLIBDIR) + "/stpd "
+ "-r " // disable relayfs
- + (s.verbose ? "" : "-q ")
- + s.tmpdir + "/" + s.module_name + ".ko";
+ + (s.verbose ? "" : "-q ");
+
+ if (s.cmd != "")
+ stpd_cmd += "-c \"" + s.cmd + "\" ";
+
+ if (s.target_pid)
+ stpd_cmd += "-t " + stringify(s.target_pid) + " ";
+
+ stpd_cmd += s.tmpdir + "/" + s.module_name + ".ko";
if (s.verbose) clog << "Running " << stpd_cmd << endl;
rc = system (stpd_cmd.c_str ());