projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Track memory usage statistics for cached data.
[bluesky.git]
/
bluesky
/
debug.c
diff --git
a/bluesky/debug.c
b/bluesky/debug.c
index
b030b7f
..
312a0e1
100644
(file)
--- a/
bluesky/debug.c
+++ b/
bluesky/debug.c
@@
-22,9
+22,9
@@
static void inode_dump(gpointer key, gpointer value, gpointer user_data)
g_print("Inode %"PRIu64":\n", inode->inum);
g_print("Inode %"PRIu64":\n", inode->inum);
- gboolean locked =
FALS
E;
+ gboolean locked =
TRU
E;
if (g_mutex_trylock(inode->lock)) {
if (g_mutex_trylock(inode->lock)) {
- locked =
TRU
E;
+ locked =
FALS
E;
g_mutex_unlock(inode->lock);
}
g_print(" Locked: %c Refcount: %d\n",
g_mutex_unlock(inode->lock);
}
g_print(" Locked: %c Refcount: %d\n",
@@
-39,6
+39,9
@@
static void inode_dump(gpointer key, gpointer value, gpointer user_data)
void bluesky_debug_dump(BlueSkyFS *fs)
{
g_print("*** DEBUG DUMP FOR FILESYSTEM %s ***\n", fs->name);
void bluesky_debug_dump(BlueSkyFS *fs)
{
g_print("*** DEBUG DUMP FOR FILESYSTEM %s ***\n", fs->name);
+ g_print("Cached blocks: %d\tDirty blocks: %d\n",
+ g_atomic_int_get(&fs->cache_total),
+ g_atomic_int_get(&fs->cache_dirty));
g_print("Cached inodes: %u\tNext inode: %"PRIu64"\n",
g_hash_table_size(fs->inodes), fs->next_inum);
g_print("Cached inodes: %u\tNext inode: %"PRIu64"\n",
g_hash_table_size(fs->inodes), fs->next_inum);