diff options
-rw-r--r-- | cache.cxx | 11 | ||||
-rw-r--r-- | hash.cxx | 2 | ||||
-rw-r--r-- | main.cxx | 15 | ||||
-rw-r--r-- | session.h | 1 |
4 files changed, 17 insertions, 12 deletions
@@ -57,15 +57,18 @@ add_to_cache(systemtap_session& s) string stapconf_src_path = s.tmpdir + "/" + s.stapconf_name; if (!copy_file(stapconf_src_path, s.stapconf_path, verbose)) { - s.use_cache = false; - return; + // NB: this is not so severe as to prevent reuse of the .ko + // already copied. + // + // s.use_script_cache = false; + // return; } string module_src_path = s.tmpdir + "/" + s.module_name + ".ko"; STAP_PROBE2(stap, cache__add__module, module_src_path.c_str(), s.hash_path.c_str()); if (!copy_file(module_src_path, s.hash_path, verbose)) { - s.use_cache = false; + s.use_script_cache = false; return; } // Copy the signature file, if any. It is not an error if this fails. @@ -83,7 +86,7 @@ add_to_cache(systemtap_session& s) // NB: this is not so severe as to prevent reuse of the .ko // already copied. // - // s.use_cache = false; + // s.use_script_cache = false; } } @@ -170,7 +170,7 @@ create_hashdir (systemtap_session& s, const string& result, string& hashdir) cerr << "Warning: failed to create cache directory (\"" << hashdir + "\"): " << strerror(errno) << ", disabling cache support." << endl; - s.use_cache = false; + s.use_cache = s.use_script_cache = false; return false; } } @@ -536,6 +536,7 @@ main (int argc, char * const argv []) s.perfmon=0; s.symtab = false; s.use_cache = true; + s.use_script_cache = true; s.tapset_compile_coverage = false; s.need_uprobes = false; s.consult_symtab = false; @@ -584,7 +585,7 @@ main (int argc, char * const argv []) cerr << "Warning: failed to create systemtap data directory (\"" << s.data_path << "\"): " << e << ", disabling cache support." << endl; - s.use_cache = false; + s.use_cache = s.use_script_cache = false; } if (s.use_cache) @@ -597,7 +598,7 @@ main (int argc, char * const argv []) cerr << "Warning: failed to create cache directory (\"" << s.cache_path << "\"): " << e << ", disabling cache support." << endl; - s.use_cache = false; + s.use_cache = s.use_script_cache = false; } } @@ -781,7 +782,7 @@ main (int argc, char * const argv []) } } - s.use_cache = false; + s.use_script_cache = false; break; case 'r': @@ -797,7 +798,7 @@ main (int argc, char * const argv []) case 'k': s.keep_tmpdir = true; - s.use_cache = false; /* User wants to keep a usable build tree. */ + s.use_script_cache = false; /* User wants to keep a usable build tree. */ break; case 'g': @@ -1276,7 +1277,7 @@ main (int argc, char * const argv []) << endl; // Generate hash. There isn't any point in generating the hash // if last_pass is 2, since we'll quit before using it. - else if (s.last_pass != 2 && s.use_cache) + else if (s.last_pass != 2 && s.use_script_cache) { ostringstream o; unsigned saved_verbose; @@ -1374,12 +1375,12 @@ main (int argc, char * const argv []) else { // Update cache. Cache cleaning is kicked off at the beginning of this function. - if (s.use_cache) + if (s.use_script_cache) add_to_cache(s); // We may need to save the module in $CWD if the cache was // inaccessible for some reason. - if (! s.use_cache && s.last_pass == 4) + if (! s.use_script_cache && s.last_pass == 4) save_module = true; // Copy module to the current directory. @@ -127,6 +127,7 @@ struct systemtap_session // Cache data bool use_cache; + bool use_script_cache; std::string cache_path; std::string hash_path; std::string stapconf_path; |