This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [Bug translator/6872] module cache cleaner
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: ksebasti at redhat dot com
- Cc: systemtap at sources dot redhat dot com
- Date: Sun, 5 Oct 2008 14:21:37 -0400
- Subject: Re: [Bug translator/6872] module cache cleaner
- References: <20080907200626.6872.fche@redhat.com> <20081003210412.27915.qmail@sourceware.org>
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