* [Bug translator/6872] module cache cleaner
[not found] <20080907200626.6872.fche@redhat.com>
@ 2008-09-19 17:59 ` ksebasti at redhat dot com
2008-09-26 18:12 ` ksebasti at redhat dot com
[not found] ` <20081003210412.27915.qmail@sourceware.org>
2 siblings, 0 replies; 3+ messages in thread
From: ksebasti at redhat dot com @ 2008-09-19 17:59 UTC (permalink / raw)
To: systemtap
------- Additional Comments From ksebasti at redhat dot com 2008-09-19 17:58 -------
Created an attachment (id=2957)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=2957&action=view)
Shell script to clean oldest modules when cache folder is above a certain size
This is a small shell script which will remove the folder of the oldest modules
in the cache dir (based on access time) until it is below the max cache size,
which can be an environment variable $SYSTEMTAP_MAX_CACHE_SIZE or defaults to
16MiB (2^24 bytes).
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6872
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug translator/6872] module cache cleaner
[not found] <20080907200626.6872.fche@redhat.com>
2008-09-19 17:59 ` [Bug translator/6872] module cache cleaner ksebasti at redhat dot com
@ 2008-09-26 18:12 ` ksebasti at redhat dot com
[not found] ` <20081003210412.27915.qmail@sourceware.org>
2 siblings, 0 replies; 3+ messages in thread
From: ksebasti at redhat dot com @ 2008-09-26 18:12 UTC (permalink / raw)
To: systemtap
------- Additional Comments From ksebasti at redhat dot com 2008-09-26 18:11 -------
Created an attachment (id=2962)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=2962&action=view)
patch to integrate cache clean script into main.cxx
This patch adds the clean script to main.cxx, after the temp directory is
removed. I tested it on a local build and it works nicely.
The current limit is defined in a macro in cache.h, set to 20mb. This is just a
random guess at an appropriate size.
Ideas:
* modify the script to output the name/path of the removed folder to be extra
verbose
(these 2 would probably require more members in struct systemtap_session)
* there should probably be a cl switch to disable (or enable?) the cache
clearing
* specify the max cache size as a cl switch
* a better eviction policy than oldest by access time ?
If any of those sound good let me know and I can work on it.
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #2957 is|0 |1
obsolete| |
http://sourceware.org/bugzilla/show_bug.cgi?id=6872
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bug translator/6872] module cache cleaner
[not found] ` <20081003210412.27915.qmail@sourceware.org>
@ 2008-10-05 18:22 ` Frank Ch. Eigler
0 siblings, 0 replies; 3+ messages in thread
From: Frank Ch. Eigler @ 2008-10-05 18:22 UTC (permalink / raw)
To: ksebasti; +Cc: systemtap
Hi -
This is looking better and better. The code seems like it could go in
as it is right now, though I'd like to make (or see made) some minor
changes to it as style matters:
* The main.cxx code that runs get_cache_max() then clean_cache() could
just go into cache.cxx:add_to_cache().
* Status messages could get printed in situ, rather than indirectly
via returned result codes and then if/else checks.
* get_cache_max() could bypass the stringstream / getline business
and just
std::ifstream foo ("cache_max_mb");
unsigned num; foo >> num;
You wouldn't need a separate function. Plus, if merged with
clean_cache(), you wouldn't need a new session variable either.
* Consider adding the cache_ent_info to a set<> (parametrized with the
weight-comparer function for implicit sorting -- which should take
const-refs by the way), rather than a vector<> that's later sorted.
Then you get a sorted iteration later from begin()..end().
- FChE
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-05 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20080907200626.6872.fche@redhat.com>
2008-09-19 17:59 ` [Bug translator/6872] module cache cleaner ksebasti at redhat dot com
2008-09-26 18:12 ` ksebasti at redhat dot com
[not found] ` <20081003210412.27915.qmail@sourceware.org>
2008-10-05 18:22 ` Frank Ch. Eigler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).