summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@toddy.(none)>2008-10-17 17:28:46 -0400
committerroot <root@toddy.(none)>2008-10-17 17:28:46 -0400
commitf604f54a6df38a064787a381852ceb98e229f9e9 (patch)
tree8dddafcf18f6847df63cdee1965d4225c0611ef4
parentfffd8e13b84c121be4657a91042d050094fbfb99 (diff)
downloadsystemtap-steved-f604f54a6df38a064787a381852ceb98e229f9e9.tar.gz
systemtap-steved-f604f54a6df38a064787a381852ceb98e229f9e9.tar.xz
systemtap-steved-f604f54a6df38a064787a381852ceb98e229f9e9.zip
Added creation of a default cache limit file if it doesn't exist.
-rw-r--r--cache.cxx10
-rw-r--r--cache.h1
2 files changed, 7 insertions, 4 deletions
diff --git a/cache.cxx b/cache.cxx
index 750e2309..acab0b84 100644
--- a/cache.cxx
+++ b/cache.cxx
@@ -158,11 +158,13 @@ clean_cache(systemtap_session& s)
}
else
{
- //file doesnt exist or error
- if (s.verbose > 1)
- clog << "Missing cache limit file " << s.cache_path << "/" << SYSTEMTAP_CACHE_MAX_FILENAME << ", I/O error or invalid content." << endl;
+ //file doesnt exist, create a default size
+ ofstream default_cache_max(cache_max_filename.c_str(), ios::out);
+ default_cache_max << SYSTEMTAP_CACHE_DEFAULT_MB << endl;
+ cache_mb_max = SYSTEMTAP_CACHE_DEFAULT_MB;
- return;
+ if (s.verbose > 1)
+ clog << "Cache limit file " << s.cache_path << "/" << SYSTEMTAP_CACHE_MAX_FILENAME << " missing, creating default." << endl;
}
//glob for all kernel modules in the cache dir
diff --git a/cache.h b/cache.h
index f5256518..0cd433e4 100644
--- a/cache.h
+++ b/cache.h
@@ -1,4 +1,5 @@
#define SYSTEMTAP_CACHE_MAX_FILENAME "cache_mb_limit"
+#define SYSTEMTAP_CACHE_DEFAULT_MB 64
struct cache_ent_info {
std::string path;