summaryrefslogtreecommitdiffstats
path: root/cache.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-02 15:57:58 -0800
committerJosh Stone <jistone@redhat.com>2010-03-02 16:05:18 -0800
commitd105f6642677bd9ef1b20d1ba180ba0163cb0fa6 (patch)
tree49c4869c7c4a687e692bb33beabab3b008beb43d /cache.cxx
parent9b3c54b2fc836e20a0a7895aa759938e62eaacf9 (diff)
downloadsystemtap-steved-d105f6642677bd9ef1b20d1ba180ba0163cb0fa6.tar.gz
systemtap-steved-d105f6642677bd9ef1b20d1ba180ba0163cb0fa6.tar.xz
systemtap-steved-d105f6642677bd9ef1b20d1ba180ba0163cb0fa6.zip
PR11246 cont'd: Add options for cache control
--disable-cache : turn off all caching --clean-cache : clean up stale entries and then quit --poison-cache : force regeneration of items that would have hit the cache These are undocumented for now, until we decide whether they are generally useful. * main.cxx (main): Parse the new options. * session.h (systemtap_session): Add poison_cache; document the others. * clean.cxx (clean_cache): No longer static. (get_stapconf_from_cache, get_script_from_cache): Respect poison. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
Diffstat (limited to 'cache.cxx')
-rw-r--r--cache.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/cache.cxx b/cache.cxx
index 6b51f21c..13436439 100644
--- a/cache.cxx
+++ b/cache.cxx
@@ -42,8 +42,6 @@ struct cache_ent_info {
void unlink() const;
};
-static void clean_cache(systemtap_session& s);
-
void
add_stapconf_to_cache(systemtap_session& s)
@@ -101,6 +99,9 @@ add_script_to_cache(systemtap_session& s)
bool
get_stapconf_from_cache(systemtap_session& s)
{
+ if (s.poison_cache)
+ return false;
+
string stapconf_dest_path = s.tmpdir + "/" + s.stapconf_name;
int fd_stapconf;
@@ -132,6 +133,9 @@ get_stapconf_from_cache(systemtap_session& s)
bool
get_script_from_cache(systemtap_session& s)
{
+ if (s.poison_cache)
+ return false;
+
string module_dest_path = s.tmpdir + "/" + s.module_name + ".ko";
string c_src_path = s.hash_path;
int fd_module, fd_c;
@@ -215,7 +219,7 @@ get_script_from_cache(systemtap_session& s)
}
-static void
+void
clean_cache(systemtap_session& s)
{
if (s.cache_path != "")