From 97ac7257f656cba2ffba7fcefae6cad0cd41efb6 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 1 Nov 2011 17:19:26 +0000 Subject: [PATCH] mmlr + bonefish: Add helper macros for placing markers in the source, so we can get the address ranges of code we're interested in. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43071 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/debug.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/headers/private/kernel/debug.h b/headers/private/kernel/debug.h index 051a62dbed..5cca136b9b 100644 --- a/headers/private/kernel/debug.h +++ b/headers/private/kernel/debug.h @@ -82,6 +82,25 @@ # define KDEBUG_ONLY(x) /* nothing */ #endif + +// Macros for for placing marker functions. They can be used to mark the +// beginning and end of code sections (e.g. used in the slab code). +#define RANGE_MARKER_FUNCTION(functionName) \ + void functionName() {} +#define RANGE_MARKER_FUNCTION_BEGIN(scope) \ + RANGE_MARKER_FUNCTION(scope##_begin) +#define RANGE_MARKER_FUNCTION_END(scope) \ + RANGE_MARKER_FUNCTION(scope##_end) + +#define RANGE_MARKER_FUNCTION_PROTOTYPE(functionName) \ + void functionName(); +#define RANGE_MARKER_FUNCTION_PROTOTYPES(scope) \ + RANGE_MARKER_FUNCTION_PROTOTYPE(scope##_begin) \ + RANGE_MARKER_FUNCTION_PROTOTYPE(scope##_end) +#define RANGE_MARKER_FUNCTION_ADDRESS_RANGE(scope) \ + (addr_t)&scope##_begin, (addr_t)&scope##_end + + // command return value #define B_KDEBUG_ERROR 4 #define B_KDEBUG_RESTART_PIPE 5