In preparation for logging more mmap-cache statistics get rid of this
piecemeal stats accessor api and just have a debug log output function
for producing the stats.
Updates the one call site using these accessors, moving what that site
did into the new log function. So the output is unchanged for now,
just a trivial refactor.
return add_mmap(m, f, prot, context, keep_always, offset, size, st, ret, ret_size);
}
-unsigned mmap_cache_get_hit(MMapCache *m) {
+void mmap_cache_stats_log_debug(MMapCache *m) {
assert(m);
- return m->n_hit;
-}
-
-unsigned mmap_cache_get_missed(MMapCache *m) {
- assert(m);
-
- return m->n_missed;
+ log_debug("mmap cache statistics: %u hit, %u miss", m->n_hit, m->n_missed);
}
static void mmap_cache_process_sigbus(MMapCache *m) {
MMapFileDescriptor * mmap_cache_add_fd(MMapCache *m, int fd);
void mmap_cache_free_fd(MMapCache *m, MMapFileDescriptor *f);
-unsigned mmap_cache_get_hit(MMapCache *m);
-unsigned mmap_cache_get_missed(MMapCache *m);
+void mmap_cache_stats_log_debug(MMapCache *m);
bool mmap_cache_got_sigbus(MMapCache *m, MMapFileDescriptor *f);
safe_close(j->inotify_fd);
if (j->mmap) {
- log_debug("mmap cache statistics: %u hit, %u miss", mmap_cache_get_hit(j->mmap), mmap_cache_get_missed(j->mmap));
+ mmap_cache_stats_log_debug(j->mmap);
mmap_cache_unref(j->mmap);
}