diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-01 17:27:53 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-02 16:05:17 -0800 |
commit | 63d530ab4dacb908c7262be59098ef026e186a30 (patch) | |
tree | 8c1b6873409027d0d0ff284f6ec44b1f2a844a31 /cache.cxx | |
parent | 42f13348b90fa59532a0c8159dc390cd7a50de0f (diff) | |
download | systemtap-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 'cache.cxx')
-rw-r--r-- | cache.cxx | 11 |
1 files changed, 7 insertions, 4 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; } } |