int dump_object_depot(int argCount, char** args) { if (argCount != 2) kprintf("usage: %s [address]\n", args[0]); else dump_object_depot((object_depot*)parse_expression(args[1])); return 0; }
static int dump_cache_info(int argc, char* argv[]) { if (argc < 2) { kprintf("usage: slab_cache [address]\n"); return 0; } ObjectCache* cache = (ObjectCache*)parse_expression(argv[1]); kprintf("name: %s\n", cache->name); kprintf("lock: %p\n", &cache->lock); kprintf("object_size: %lu\n", cache->object_size); kprintf("alignment: %" B_PRIuSIZE "\n", cache->alignment); kprintf("cache_color_cycle: %lu\n", cache->cache_color_cycle); kprintf("total_objects: %lu\n", cache->total_objects); kprintf("used_count: %lu\n", cache->used_count); kprintf("empty_count: %lu\n", cache->empty_count); kprintf("pressure: %lu\n", cache->pressure); kprintf("slab_size: %lu\n", cache->slab_size); kprintf("usage: %lu\n", cache->usage); kprintf("maximum: %lu\n", cache->maximum); kprintf("flags: 0x%lx\n", cache->flags); kprintf("cookie: %p\n", cache->cookie); kprintf("resize entry don't wait: %p\n", cache->resize_entry_dont_wait); kprintf("resize entry can wait: %p\n", cache->resize_entry_can_wait); kprintf(" slab chunk size used offset free\n"); SlabList::Iterator iterator = cache->empty.GetIterator(); if (iterator.HasNext()) kprintf("empty:\n"); while (::slab* slab = iterator.Next()) dump_slab(slab); iterator = cache->partial.GetIterator(); if (iterator.HasNext()) kprintf("partial:\n"); while (::slab* slab = iterator.Next()) dump_slab(slab); iterator = cache->full.GetIterator(); if (iterator.HasNext()) kprintf("full:\n"); while (::slab* slab = iterator.Next()) dump_slab(slab); if ((cache->flags & CACHE_NO_DEPOT) == 0) { kprintf("depot:\n"); dump_object_depot(&cache->depot); } return 0; }