summaryrefslogtreecommitdiffstats
path: root/cache.h
diff options
context:
space:
mode:
authorKent Sebastian <ksebasti@toddy.(none)>2008-10-10 15:40:46 -0400
committerKent Sebastian <ksebasti@toddy.(none)>2008-10-10 15:40:46 -0400
commit06c7e0574aa7781478425d171a885603ad365155 (patch)
treec3a42bc2de20a59ec373f94b1500969223e727b7 /cache.h
parentd68088d095ca865001a5cc3f595982b63c96c418 (diff)
downloadsystemtap-steved-06c7e0574aa7781478425d171a885603ad365155.tar.gz
systemtap-steved-06c7e0574aa7781478425d171a885603ad365155.tar.xz
systemtap-steved-06c7e0574aa7781478425d171a885603ad365155.zip
Functions implementing cache limiting.
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);