]> sourceware.org Git - systemtap.git/commitdiff
buildrun/caching warning cleanup
authorFrank Ch. Eigler <fche@elastic.org>
Sat, 29 Nov 2008 21:43:41 +0000 (16:43 -0500)
committerFrank Ch. Eigler <fche@elastic.org>
Sat, 29 Nov 2008 21:43:41 +0000 (16:43 -0500)
ChangeLog
buildrun.cxx
cache.cxx
hash.cxx
main.cxx

index 102cf73342494fdf7df6f636eadfe7ef1fd9c913..80cb6b3cdb88c39ae05f72efdd984b3bad57e8fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index ef2a483ff5e361b72ae22627705d6730710e599a..f95889066fd5de9ef0907e629e448b10f892a470 100644 (file)
@@ -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;
 }
index acab0b841f9211d7ca9b8b6332b1dd8b9eb3e367..b1d3aa8adca878f924e8d471332906cfa57d5226 100644 (file)
--- a/cache.cxx
+++ b/cache.cxx
@@ -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
index 450393918119385dc91731bff4ed7b88cd35f3b7..a10815c9788baea57e35bd48de17feafa29dabfa 100644 (file)
--- a/hash.cxx
+++ b/hash.cxx
@@ -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;
        }
index 91c20ddb75aeae4a8aa3e35294c62f2ddd2e4959..9d322fe47fd26dd76cd052bccb0db4d9fae9e3e6 100644 (file)
--- a/main.cxx
+++ b/main.cxx
@@ -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)
         {
This page took 0.099103 seconds and 5 git commands to generate.