From 5eb9da355ae6b7a44bbc1c6085c870b2620e50e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 1 Mar 2007 13:09:41 +0000 Subject: [PATCH] * The KDL commands cache/cache_ref will now also print the type of the cache. * Made the output look a bit more like that of the other commands. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20279 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/vm.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 39e0fb7a0a..c6a4766e51 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -2035,6 +2035,25 @@ dump_cache_chain(int argc, char **argv) } +static const char * +cache_type_to_string(int32 type) +{ + switch (type) { + case CACHE_TYPE_RAM: + return "RAM"; + case CACHE_TYPE_DEVICE: + return "device"; + case CACHE_TYPE_VNODE: + return "vnode"; + case CACHE_TYPE_NULL: + return "null"; + + default: + return "unknown"; + } +} + + static int dump_cache(int argc, char **argv) { @@ -2086,7 +2105,7 @@ dump_cache(int argc, char **argv) } if (showCacheRef) { - kprintf("cache_ref at %p:\n", cacheRef); + kprintf("CACHE_REF %p:\n", cacheRef); if (!showCache) kprintf(" cache: %p\n", cacheRef->cache); kprintf(" ref_count: %ld\n", cacheRef->ref_count); @@ -2103,11 +2122,12 @@ dump_cache(int argc, char **argv) } if (showCache) { - kprintf("cache at %p:\n", cache); + kprintf("CACHE %p:\n", cache); if (!showCacheRef) kprintf(" cache_ref: %p\n", cache->ref); kprintf(" source: %p\n", cache->source); kprintf(" store: %p\n", cache->store); + kprintf(" type: %s\n", cache_type_to_string(cache->type)); kprintf(" virtual_base: 0x%Lx\n", cache->virtual_base); kprintf(" virtual_size: 0x%Lx\n", cache->virtual_size); kprintf(" temporary: %ld\n", cache->temporary);