Changeset 1007

Show
Ignore:
Timestamp:
04/23/08 03:23:04 (13 years ago)
Author:
ppalmers
Message:

move conditional compilation switch for RT-safe debug buffer to config.h.in

make the use of a non-rt buffer an error condition for non-debug builds. people (esp packagers) should use the rt-safe versions for normal builds.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/config.h.in

    r1005 r1007  
    4444// debug logging in the critical sections 
    4545#define DEBUG_EXTREME_ENABLE        0 
     46 
     47// use a RT-safe message buffer for debug output 
     48// useful to disable this when the code aborts/segfaults to 
     49// not lose debug output. should be enabled though. 
     50#define DEBUG_USE_MESSAGE_BUFFER    1 
    4651 
    4752// watchdog 
  • trunk/libffado/src/debugmodule/debugmodule.cpp

    r864 r1007  
    2424 
    2525#include "debugmodule.h" 
     26#include "config.h" 
    2627 
    2728#include <stdarg.h> 
     
    3233#include <time.h> 
    3334 
    34 #define DO_MESSAGE_BUFFER_PRINT 
    35  
    36 #ifndef DO_MESSAGE_BUFFER_PRINT 
    37     #warning Printing debug info without ringbuffer, not RT-safe! 
     35#if DEBUG_USE_MESSAGE_BUFFER 
     36#else 
     37    #ifdef DEBUG 
     38        #warning Printing debug info without ringbuffer, not RT-safe! 
     39    #else 
     40        #error Printing debug info without ringbuffer, not RT-safe (not allowed for non-debug builds)! 
     41    #endif 
    3842#endif 
    3943 
     
    389393DebugModuleManager::flush() 
    390394{ 
    391 #ifdef DO_MESSAGE_BUFFER_PRINT 
     395#ifdef DEBUG_USE_MESSAGE_BUFFER 
    392396    mb_flush(); 
    393397#else 
     
    519523DebugModuleManager::print(const char *msg) 
    520524{ 
    521 #ifdef DO_MESSAGE_BUFFER_PRINT 
     525#ifdef DEBUG_USE_MESSAGE_BUFFER 
    522526    unsigned int ntries; 
    523527    struct timespec wait = {0,50000}; 
     
    532536    } 
    533537 
    534 #ifdef DO_MESSAGE_BUFFER_PRINT 
     538#ifdef DEBUG_USE_MESSAGE_BUFFER 
    535539    ntries=1; 
    536540    while (ntries) { // try a few times