summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-01 17:27:53 -0800
committerJosh Stone <jistone@redhat.com>2010-03-02 16:05:17 -0800
commit63d530ab4dacb908c7262be59098ef026e186a30 (patch)
tree8c1b6873409027d0d0ff284f6ec44b1f2a844a31 /main.cxx
parent42f13348b90fa59532a0c8159dc390cd7a50de0f (diff)
downloadsystemtap-steved-63d530ab4dacb908c7262be59098ef026e186a30.tar.gz
systemtap-steved-63d530ab4dacb908c7262be59098ef026e186a30.tar.xz
systemtap-steved-63d530ab4dacb908c7262be59098ef026e186a30.zip
PR11246: Add more granular cache control
There are some module options that require us to disable caching for the script, but before now this had a global effect. There are some cache objects, like tracepoint and @cast query modules, which we would like to cache even when the script itself needs to be uncached. * session.h (systemtap_session): New use_script_cache flag. * main.cxx (main): -m & -k can just disable the script cache. Failure to create the cache directories still disables all caching. * hash.cxx (create_hashdir): Failure disables all caching. * cache.cxx (add_to_cache): Failure only toggles the script caching. If the stapconf fails though, we don't need to block the .ko reuse.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/main.cxx b/main.cxx
index 21a4b136..5255b5bf 100644
--- a/main.cxx
+++ b/main.cxx
@@ -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.