+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.
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;
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;
}
{
cerr << "Copy failed (\"" << module_src_path << "\" to \""
<< s.hash_path << "\"): " << strerror(errno) << endl;
+ s.use_cache = false;
return;
}
<< 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);
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
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;
}
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;
}
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;
}
}
{
// 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)
{