summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
diff options
context:
space:
mode:
authordsmith <dsmith>2006-06-30 18:24:43 +0000
committerdsmith <dsmith>2006-06-30 18:24:43 +0000
commitb40af7ee2b7ec2a0bdabf4e1b2ecfceec1de33be (patch)
tree46c20d503390c2e1de2de8f6a46622f2ec02fc57 /buildrun.cxx
parent1a5293af69dfe577b04ac0abe366bd1c0434930b (diff)
downloadsystemtap-steved-b40af7ee2b7ec2a0bdabf4e1b2ecfceec1de33be.tar.gz
systemtap-steved-b40af7ee2b7ec2a0bdabf4e1b2ecfceec1de33be.tar.xz
systemtap-steved-b40af7ee2b7ec2a0bdabf4e1b2ecfceec1de33be.zip
2006-06-30 David Smith <dsmith@redhat.com>
* tapsets.cxx (dwflpp::dwfl_assert): Added optional extra_msg parameter to be able to print out extra error message. (dwflpp::setup): Uses new 'extra_msg' parameter to dwfl_assert() to ask user to install kernel-debuginfo when dwfl_linux_kernel_report_kernel() or dwfl_linux_kernel_report_modules() fails (Bugzilla #2669). * buildrun.cxx (compile_pass): Checks to make sure module build directory exists before trying to run make there (Bugzilla #2669).
Diffstat (limited to 'buildrun.cxx')
-rw-r--r--buildrun.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index ab2b85f6..8573fbf6 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -16,6 +16,11 @@ extern "C" {
#include "signal.h"
#include <sys/wait.h>
#include <pwd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
}
@@ -81,9 +86,20 @@ compile_pass (systemtap_session& s)
o.close ();
- // Run make
+ // Generate module directory pathname and make sure it exists.
string module_dir = string("/lib/modules/")
+ s.kernel_release + "/build";
+ struct stat st;
+ rc = stat(module_dir.c_str(), &st);
+ if (rc != 0)
+ {
+ clog << "Module directory " << module_dir << " check failed: "
+ << strerror(errno) << endl
+ << "Make sure kernel devel is installed." << endl;
+ return rc;
+ }
+
+ // Run make
string make_cmd = string("make")
+ string (" -C \"") + module_dir + string("\"");
make_cmd += string(" M=\"") + s.tmpdir + string("\" modules");