X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fdebug.c;h=cfb6a81977a5e65d68eaee3ec4effb9b37caa701;hb=60b4792d65ba4b2a45733894f6a57e6581ddc487;hp=b409c74b492be2110ff0682978683a10f773cb6a;hpb=348aaaad42163d6829112c9b18026c16b09e1914;p=bluesky.git diff --git a/bluesky/debug.c b/bluesky/debug.c index b409c74..cfb6a81 100644 --- a/bluesky/debug.c +++ b/bluesky/debug.c @@ -35,6 +35,17 @@ static void inode_dump(gpointer key, gpointer value, gpointer user_data) inode->change_count, inode->change_commit); } +static void cloudlog_dump(gpointer key, gpointer value, gpointer user_data) +{ + BlueSkyCloudLog *log = (BlueSkyCloudLog *)value; + + for (int i = 0; i < sizeof(BlueSkyCloudID); i++) { + g_print("%02x", (uint8_t)(log->id.bytes[i])); + } + g_print(": ty=%d inode=%"PRIu64" locs=%x\n", + log->type, log->inum, log->location_flags); +} + /* Dump a summary of filesystem state as it is cached in memory. */ void bluesky_debug_dump(BlueSkyFS *fs) { @@ -58,6 +69,10 @@ void bluesky_debug_dump(BlueSkyFS *fs) g_print("\n"); g_hash_table_foreach(fs->inodes, inode_dump, fs); + + g_print("\nLog Objects:\n"); + g_hash_table_foreach(fs->locations, cloudlog_dump, fs); + g_print("\n"); } /* Statistics counters: for operation counts, bytes transferred, etc. */