* Moved more debug macros to kernel_debug_config.h.

* Turned the checks for all those macros to "#if"s instead of "#ifdef"s.
* Introduced macro KDEBUG_LEVEL which serves as a master setting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28248 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-10-20 14:24:46 +00:00
parent 1894a0a98b
commit 59dbd26f5f
13 changed files with 116 additions and 67 deletions
+8 -7
View File
@@ -21,6 +21,8 @@
#include <vm_page.h>
#include <vm_cache.h>
#include "kernel_debug_config.h"
//#define TRACE_FILE_MAP
#ifdef TRACE_FILE_MAP
@@ -34,7 +36,6 @@
// for the whole map.
// TODO: it would be nice if we could free a file map in low memory situations.
#define DEBUG_FILE_MAP
#define CACHED_FILE_EXTENTS 2
// must be smaller than MAX_FILE_IO_VECS
@@ -51,7 +52,7 @@ struct file_extent_array {
};
class FileMap
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
: public DoublyLinkedListLinkImpl<FileMap>
#endif
{
@@ -94,7 +95,7 @@ private:
bool fCacheAll;
};
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
typedef DoublyLinkedList<FileMap> FileMapList;
static FileMapList sList;
@@ -111,7 +112,7 @@ FileMap::FileMap(struct vnode* vnode, off_t size)
{
mutex_init(&fLock, "file map");
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
MutexLocker _(sLock);
sList.Add(this);
#endif
@@ -123,7 +124,7 @@ FileMap::~FileMap()
_Free();
mutex_destroy(&fLock);
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
MutexLocker _(sLock);
sList.Remove(this);
#endif
@@ -459,7 +460,7 @@ FileMap::Translate(off_t offset, size_t size, file_io_vec* vecs, size_t* _count,
// #pragma mark -
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
static int
dump_file_map(int argc, char** argv)
@@ -553,7 +554,7 @@ dump_file_map_stats(int argc, char** argv)
extern "C" status_t
file_map_init(void)
{
#ifdef DEBUG_FILE_MAP
#if DEBUG_FILE_MAP
add_debugger_command_etc("file_map", &dump_file_map,
"Dumps the specified file map.",
"[-p] <file-map>\n"