* Changed macros that enable tracing for individual components from

defined/undefined to numeric values (0 for undefined). This allows for
  trace levels.
* Set SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT default to 1, since this is
  what one usually wants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25213 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-04-27 14:24:18 +00:00
parent 5975ad0cfc
commit 6bf15ffcdc
11 changed files with 33 additions and 27 deletions
+18 -14
View File
@@ -14,20 +14,24 @@
#endif #endif
// macros that enable tracing for individual components #if ENABLE_TRACING
//#define BMESSAGE_TRACING // macros specifying the tracing level for individual components (0 is disabled)
//#define BLOCK_CACHE_TRANSACTION_TRACING
//#define KERNEL_HEAP_TRACING #define BMESSAGE_TRACING 0
//#define PAGE_ALLOCATION_TRACING #define BLOCK_CACHE_TRANSACTION_TRACING 0
//#define PARANOIA_TRACING #define KERNEL_HEAP_TRACING 0
//#define PARANOIA_TRACING_STACK_TRACE 0 #define PAGE_ALLOCATION_TRACING 0
//#define OBJECT_CACHE_TRACING #define PARANOIA_TRACING 0
//#define RUNTIME_LOADER_TRACING #define PARANOIA_TRACING_STACK_TRACE 0 /* stack traced depth */
//#define SIGNAL_TRACING #define OBJECT_CACHE_TRACING 0
//#define SYSCALL_TRACING #define RUNTIME_LOADER_TRACING 0
//#define SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT #define SIGNAL_TRACING 0
//#define TEAM_TRACING #define SYSCALL_TRACING 0
//#define USER_MALLOC_TRACING #define SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT 1
#define TEAM_TRACING 0
#define USER_MALLOC_TRACING 0
#endif // ENABLE_TRACING
#endif // KERNEL_TRACING_CONFIG_H #endif // KERNEL_TRACING_CONFIG_H
+1 -1
View File
@@ -40,7 +40,7 @@
#define DEBUG_FUNCTION_ENTER2 //debug_printf("thread: 0x%x; line: %04ld: func: %s\n", find_thread(NULL), __LINE__, __PRETTY_FUNCTION__); #define DEBUG_FUNCTION_ENTER2 //debug_printf("thread: 0x%x; line: %04ld: func: %s\n", find_thread(NULL), __LINE__, __PRETTY_FUNCTION__);
#ifdef BMESSAGE_TRACING #if BMESSAGE_TRACING
# define KTRACE(format...) ktrace_printf(format) # define KTRACE(format...) ktrace_printf(format)
#else #else
# define KTRACE(format...) # define KTRACE(format...)
+1 -1
View File
@@ -196,7 +196,7 @@ union paranoia_slot {
// #pragma mark - Tracing // #pragma mark - Tracing
#ifdef PARANOIA_TRACING #if PARANOIA_TRACING
namespace ParanoiaTracing { namespace ParanoiaTracing {
+1 -1
View File
@@ -100,7 +100,7 @@ static spinlock sDeferredFreeListLock;
// #pragma mark - Tracing // #pragma mark - Tracing
#ifdef KERNEL_HEAP_TRACING #if KERNEL_HEAP_TRACING
namespace KernelHeapTracing { namespace KernelHeapTracing {
class Allocate : public AbstractTraceEntry { class Allocate : public AbstractTraceEntry {
+1 -1
View File
@@ -60,7 +60,7 @@ static status_t deliver_signal(struct thread *thread, uint signal,
// #pragma mark - signal tracing // #pragma mark - signal tracing
#ifdef SIGNAL_TRACING #if SIGNAL_TRACING
namespace SignalTracing { namespace SignalTracing {
+1 -1
View File
@@ -178,7 +178,7 @@ static depot_magazine *alloc_magazine();
static void free_magazine(depot_magazine *magazine); static void free_magazine(depot_magazine *magazine);
#ifdef OBJECT_CACHE_TRACING #if OBJECT_CACHE_TRACING
namespace ObjectCacheTracing { namespace ObjectCacheTracing {
+6 -4
View File
@@ -58,7 +58,9 @@ static struct mutex sGenericSyscallLock;
static struct list sGenericSyscalls; static struct list sGenericSyscalls;
#if SYSCALL_TRACING
static int dump_syscall_tracing(int argc, char** argv); static int dump_syscall_tracing(int argc, char** argv);
#endif
static generic_syscall * static generic_syscall *
@@ -214,7 +216,7 @@ generic_syscall_init(void)
return B_ERROR; return B_ERROR;
} }
#if ENABLE_TRACING && defined(SYSCALL_TRACING) #if SYSCALL_TRACING
add_debugger_command_etc("straced", &dump_syscall_tracing, add_debugger_command_etc("straced", &dump_syscall_tracing,
"Dump recorded syscall trace entries", "Dump recorded syscall trace entries",
"Prints recorded trace entries. It is wrapper for the \"traced\"\n" "Prints recorded trace entries. It is wrapper for the \"traced\"\n"
@@ -311,7 +313,7 @@ unregister_generic_syscall(const char *subsystem, uint32 version)
// #pragma mark - syscall tracing // #pragma mark - syscall tracing
#ifdef SYSCALL_TRACING #if SYSCALL_TRACING
namespace SyscallTracing { namespace SyscallTracing {
@@ -458,7 +460,7 @@ extern "C" void trace_pre_syscall(uint32 syscallNumber, const void* parameters);
void void
trace_pre_syscall(uint32 syscallNumber, const void* parameters) trace_pre_syscall(uint32 syscallNumber, const void* parameters)
{ {
#ifdef SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT #if SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT
if (syscallNumber != SYSCALL_KTRACE_OUTPUT) if (syscallNumber != SYSCALL_KTRACE_OUTPUT)
#endif #endif
{ {
@@ -472,7 +474,7 @@ extern "C" void trace_post_syscall(int syscallNumber, uint64 returnValue);
void void
trace_post_syscall(int syscallNumber, uint64 returnValue) trace_post_syscall(int syscallNumber, uint64 returnValue)
{ {
#ifdef SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT #if SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT
if (syscallNumber != SYSCALL_KTRACE_OUTPUT) if (syscallNumber != SYSCALL_KTRACE_OUTPUT)
#endif #endif
{ {
+1 -1
View File
@@ -88,7 +88,7 @@ spinlock team_spinlock = 0;
// #pragma mark - Tracing // #pragma mark - Tracing
#ifdef TEAM_TRACING #if TEAM_TRACING
namespace TeamTracing { namespace TeamTracing {
class TeamForked : public AbstractTraceEntry { class TeamForked : public AbstractTraceEntry {
+1 -1
View File
@@ -66,7 +66,7 @@ static spinlock sPageLock;
static sem_id sWriterWaitSem; static sem_id sWriterWaitSem;
#ifdef PAGE_ALLOCATION_TRACING #if PAGE_ALLOCATION_TRACING
namespace PageAllocationTracing { namespace PageAllocationTracing {
+1 -1
View File
@@ -34,7 +34,7 @@
using namespace BPrivate; using namespace BPrivate;
#ifdef USER_MALLOC_TRACING #if USER_MALLOC_TRACING
# define KTRACE(format...) ktrace_printf(format) # define KTRACE(format...) ktrace_printf(format)
#else #else
# define KTRACE(format...) do {} while (false) # define KTRACE(format...) do {} while (false)
+1 -1
View File
@@ -125,7 +125,7 @@ atoi(const char* num)
} }
#ifdef RUNTIME_LOADER_TRACING #if RUNTIME_LOADER_TRACING
void void
ktrace_printf(const char *format, ...) ktrace_printf(const char *format, ...)