summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buildrun.cxx16
-rw-r--r--hash.cxx14
2 files changed, 29 insertions, 1 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index 71e6df56..a40dab15 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -442,6 +442,14 @@ make_tracequery(systemtap_session& s, string& name,
// make the module
string make_cmd = "make -C '" + s.kernel_build_tree + "'"
+ " M='" + dir + "' modules";
+
+ // Add architecture
+ make_cmd += string(" ARCH=") + lex_cast_qstring(s.architecture);
+
+ // Add any custom kbuild flags
+ for (unsigned k=0; k<s.kbuildflags.size(); k++)
+ make_cmd += string(" ") + lex_cast_qstring(s.kbuildflags[k]);
+
if (s.verbose < 4)
make_cmd += " >/dev/null 2>&1";
return run_make_cmd(s, make_cmd);
@@ -491,6 +499,14 @@ make_typequery_kmod(systemtap_session& s, const string& header, string& name)
// make the module
string make_cmd = "make -C '" + s.kernel_build_tree + "'"
+ " M='" + dir + "' modules";
+
+ // Add architecture
+ make_cmd += string(" ARCH=") + lex_cast_qstring(s.architecture);
+
+ // Add any custom kbuild flags
+ for (unsigned k=0; k<s.kbuildflags.size(); k++)
+ make_cmd += string(" ") + lex_cast_qstring(s.kbuildflags[k]);
+
if (s.verbose < 4)
make_cmd += " >/dev/null 2>&1";
return run_make_cmd(s, make_cmd);
diff --git a/hash.cxx b/hash.cxx
index 6e798f81..105e1115 100644
--- a/hash.cxx
+++ b/hash.cxx
@@ -190,6 +190,7 @@ find_script_hash (systemtap_session& s, const string& script, const hash &base)
for (unsigned i = 0; i < s.macros.size(); i++)
h.add(s.macros[i]);
+ // Add any custom kbuild flags (-B)
for (unsigned i = 0; i < s.kbuildflags.size(); i++)
h.add(s.kbuildflags[i]);
@@ -236,7 +237,9 @@ find_stapconf_hash (systemtap_session& s, const hash& base)
{
hash h(base);
- // The basic hash should be good enough for STAPCONF variables
+ // Add any custom kbuild flags
+ for (unsigned i = 0; i < s.kbuildflags.size(); i++)
+ h.add(s.kbuildflags[i]);
// Get the directory path to store our cached stapconf parameters
string result, hashdir;
@@ -268,6 +271,10 @@ find_tracequery_hash (systemtap_session& s, const string& header)
// Add the tracepoint header to the computed hash
h.add_file(header);
+ // Add any custom kbuild flags
+ for (unsigned i = 0; i < s.kbuildflags.size(); i++)
+ h.add(s.kbuildflags[i]);
+
// Get the directory path to store our cached module
string result, hashdir;
h.result(result);
@@ -287,6 +294,11 @@ find_typequery_hash (systemtap_session& s, const string& name)
// Add the typequery name to distinguish the hash
h.add(name);
+ if (name[0] == 'k')
+ // Add any custom kbuild flags
+ for (unsigned i = 0; i < s.kbuildflags.size(); i++)
+ h.add(s.kbuildflags[i]);
+
// Get the directory path to store our cached module
string result, hashdir;
h.result(result);