diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | buildrun.cxx | 10 | ||||
-rw-r--r-- | cache.cxx | 17 | ||||
-rw-r--r-- | hash.cxx | 7 | ||||
-rw-r--r-- | main.cxx | 21 |
5 files changed, 44 insertions, 22 deletions
@@ -1,3 +1,14 @@ +2008-11-29 Frank Ch. Eigler <fche@elastic.org> + + Warnings cleanup. + * buildrun.cxx (verify_uprobes_uptodate, make_uprobes): Simplify + messages. + * cache.cxx (add_to_cache, clean_cache): Reset s.use_cache upon + failure. + * hash.cxx (find_hash): Ditto. + * main.cxx (main): Simplify/conditionalize warning messages. Save + module to $cwd if last_pass==4 but cache encountered errors. + 2008-11-28 Frank Ch. Eigler <fche@elastic.org> PR 6965. diff --git a/buildrun.cxx b/buildrun.cxx index ef2a483f..f9588906 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -201,7 +201,7 @@ verify_uprobes_uptodate (systemtap_session& s) int rc = run_make_cmd(s, make_cmd); if (rc) { clog << "SystemTap's version of uprobes is out of date." << endl; - clog << "As root, run \"make\" in " << uprobes_home << "." << endl; + clog << "As root, run \"make -C " << uprobes_home << "\"." << endl; } return rc; @@ -217,12 +217,8 @@ make_uprobes (systemtap_session& s) string make_cmd = string("make -C ") + uprobes_home; int rc = run_make_cmd(s, make_cmd); - if (s.verbose) { - if (rc) - clog << "Uprobes (re)build failed." << endl; - else - clog << "Uprobes (re)build complete." << endl; - } + if (s.verbose > 1) + clog << "uprobes rebuild rc=" << rc << endl; return rc; } @@ -35,6 +35,7 @@ add_to_cache(systemtap_session& s) { cerr << "Copy failed (\"" << module_src_path << "\" to \"" << s.hash_path << "\"): " << strerror(errno) << endl; + s.use_cache = false; return; } @@ -48,8 +49,13 @@ add_to_cache(systemtap_session& s) << endl; if (copy_file(s.translated_source.c_str(), c_dest_path.c_str()) != 0) { - cerr << "Copy failed (\"" << s.translated_source << "\" to \"" - << c_dest_path << "\"): " << strerror(errno) << endl; + if (s.verbose > 1) + cerr << "Copy failed (\"" << s.translated_source << "\" to \"" + << c_dest_path << "\"): " << strerror(errno) << endl; + // NB: this is not so severe as to prevent reuse of the .ko + // already copied. + // + // s.use_cache = false; } clean_cache(s); @@ -219,9 +225,10 @@ clean_cache(systemtap_session& s) if (s.verbose > 1 && removed_dirs != "") { - //remove trailing ", " - removed_dirs = removed_dirs.substr(0, removed_dirs.length() - 2); - clog << "Cache cleaning successful, removed entries: " << removed_dirs << endl; + //remove trailing ", " + removed_dirs = removed_dirs.substr(0, removed_dirs.length() - 2); + clog << "Cache cleaning successful, removed entries: " + << removed_dirs << endl; } } else @@ -161,9 +161,10 @@ find_hash (systemtap_session& s, const string& script) hashdir += string("/") + result[i*2] + result[i*2 + 1]; if (create_dir(hashdir.c_str()) != 0) { - cerr << "Warning: failed to create cache directory (\"" - << hashdir + "\"): " << strerror(errno) << endl; - cerr << "Disabling cache support." << endl; + if (! s.suppress_warnings) + cerr << "Warning: failed to create cache directory (\"" + << hashdir + "\"): " << strerror(errno) + << ", disabling cache support." << endl; s.use_cache = false; return; } @@ -393,9 +393,10 @@ main (int argc, char * const argv []) if (create_dir(s.data_path.c_str()) == 1) { const char* e = strerror (errno); - cerr << "Warning: failed to create systemtap data directory (\"" - << s.data_path << "\"): " << e << endl; - cerr << "Disabling cache support." << endl; + if (! s.suppress_warnings) + cerr << "Warning: failed to create systemtap data directory (\"" + << s.data_path << "\"): " << e + << ", disabling cache support." << endl; s.use_cache = false; } @@ -405,9 +406,10 @@ main (int argc, char * const argv []) if (create_dir(s.cache_path.c_str()) == 1) { const char* e = strerror (errno); - cerr << "Warning: failed to create cache directory (\"" - << s.cache_path << "\"): " << e << endl; - cerr << "Disabling cache support." << endl; + if (! s.suppress_warnings) + cerr << "Warning: failed to create cache directory (\"" + << s.cache_path << "\"): " << e + << ", disabling cache support." << endl; s.use_cache = false; } } @@ -1062,8 +1064,13 @@ main (int argc, char * const argv []) { // Update cache. Cache cleaning is kicked off at the end of this function. if (s.use_cache) - add_to_cache(s); + 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) + save_module = true; + // Copy module to the current directory. if (save_module && !pending_interrupts) { |