summaryrefslogtreecommitdiffstats
path: root/cache.h
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-10-13 14:38:03 +1000
committerddomingo <ddomingo@redhat.com>2008-10-13 14:38:03 +1000
commitf4e4014f97627cfd36429d1c5b8e65373a837875 (patch)
treea36ae1581270ca034e211e67a8ad45e4aa6a25d7 /cache.h
parent74939defa679347fdd0b32d804b24b9976cb7cf3 (diff)
parent180b066c1d27320c1d706e35f56c8dc165d89583 (diff)
downloadsystemtap-steved-f4e4014f97627cfd36429d1c5b8e65373a837875.tar.gz
systemtap-steved-f4e4014f97627cfd36429d1c5b8e65373a837875.tar.xz
systemtap-steved-f4e4014f97627cfd36429d1c5b8e65373a837875.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 9c171c42..f5256518 100644
--- a/cache.h
+++ b/cache.h
@@ -1,2 +1,19 @@
+#define SYSTEMTAP_CACHE_MAX_FILENAME "cache_mb_limit"
+
+struct cache_ent_info {
+ std::string path;
+ size_t size;
+ long weight; //lower == removed earlier
+};
+
+struct weight_sorter {
+ bool operator() (const struct cache_ent_info& c1, const struct cache_ent_info& c2) const
+ { return c1.weight < c2.weight;}
+};
+
void add_to_cache(systemtap_session& s);
bool get_from_cache(systemtap_session& s);
+void clean_cache(systemtap_session& s);
+long get_cache_file_size(const std::string &cache_ent_path);
+long get_cache_file_weight(const std::string &cache_ent_path);
+void unlink_cache_entry(const std::string &cache_ent_path);