Changeset 1046

Show
Ignore:
Timestamp:
04/26/08 09:42:39 (13 years ago)
Author:
ppalmers
Message:

debug message cleanup. move #defines into config.h.in.

Files:

Legend:

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

    r1042 r1046  
    3939#define HAVE_LRINTF $HAVE_LRINTF 
    4040 
    41 #define DEBUG_IMPLEMENT_BACKLOG     0 
     41// use a RT-safe message buffer for debug output 
     42// useful to disable this when the code aborts/segfaults to 
     43// not lose debug output. should be enabled though. 
     44#define DEBUG_USE_MESSAGE_BUFFER             1 
     45// max message length in the debug messagebuffer 
     46#define DEBUG_MAX_MESSAGE_LENGTH           512 
     47// number of messages in the debug messagebuffer (power of two) 
     48#define DEBUG_MB_BUFFERS                  1024 
     49 
     50// support a debug backlog 
     51// note that this does not influence non-debug builds 
     52#define DEBUG_BACKLOG_SUPPORT                0 
     53// number of messages in the backlog buffer (power of two) 
     54#define DEBUG_BACKLOG_MB_BUFFERS            64 
     55 
     56// support backtrace debugging 
     57// note that this does not influence non-debug builds 
     58#define DEBUG_BACKTRACE_SUPPORT              0 
     59// max length of backtrace 
     60#define DEBUG_MAX_BACKTRACE_LENGTH           8 
     61// max amount of function pointers to keep track of 
     62#define DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN  64 
    4263 
    4364// make this zero to disable the most extreme 
    4465// debug logging in the critical sections 
    4566#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 
    5167 
    5268// watchdog 
  • trunk/libffado/src/debugmodule/debugmodule.cpp

    r1030 r1046  
    9292 
    9393    // bypass for performance 
    94 #ifdef IMPLEMENT_BACKLOG 
     94#if DEBUG_BACKLOG_SUPPORT 
    9595    if (level > BACKLOG_MIN_LEVEL  
    9696        && level > m_level) { 
     
    124124    } 
    125125 
    126 #ifdef IMPLEMENT_BACKLOG 
     126#if DEBUG_BACKLOG_SUPPORT 
    127127    // print to backlog if necessary 
    128128    if (level <= BACKLOG_MIN_LEVEL) { 
     
    146146{ 
    147147    // bypass for performance 
    148 #ifdef IMPLEMENT_BACKLOG 
     148#if DEBUG_BACKLOG_SUPPORT 
    149149    if (level > BACKLOG_MIN_LEVEL  
    150150        && level > m_level) { 
     
    203203    } 
    204204 
    205 #ifdef IMPLEMENT_BACKLOG 
     205#if DEBUG_BACKLOG_SUPPORT 
    206206    // print to backlog if necessary 
    207207    if (level <= BACKLOG_MIN_LEVEL) { 
     
    240240DebugModuleManager::DebugModuleManager() 
    241241    : mb_initialized(0) 
     242#if DEBUG_USE_MESSAGE_BUFFER 
    242243    , mb_inbuffer(0) 
    243244    , mb_outbuffer(0) 
    244245    , mb_overruns(0) 
     246#endif 
     247#if DEBUG_BACKTRACE_SUPPORT 
    245248    , m_backtrace_buffer_nb_seen(0) 
    246 #ifdef IMPLEMENT_BACKLOG 
     249#endif 
     250#if DEBUG_BACKLOG_SUPPORT 
    247251    , bl_mb_inbuffer(0) 
    248252#endif 
     
    266270        return; 
    267271 
     272#if DEBUG_USE_MESSAGE_BUFFER 
    268273    pthread_mutex_lock(&mb_write_lock); 
    269274    mb_initialized = 0; 
     
    273278    pthread_join(mb_writer_thread, NULL); 
    274279    mb_flush(); 
    275  
     280#endif 
     281 
     282#if DEBUG_BACKTRACE_SUPPORT 
    276283    pthread_mutex_lock(&m_backtrace_lock); 
    277284    // print a list of the symbols seen in a backtrace 
     
    287294    } 
    288295    pthread_mutex_unlock(&m_backtrace_lock); 
    289  
     296#endif 
     297 
     298#if DEBUG_USE_MESSAGE_BUFFER 
    290299    if (mb_overruns) 
    291300        fprintf(stderr, "WARNING: %d message buffer overruns!\n", 
     
    296305    pthread_mutex_destroy(&mb_write_lock); 
    297306    pthread_cond_destroy(&mb_ready_cond); 
    298  
     307#endif 
     308 
     309#if DEBUG_BACKTRACE_SUPPORT 
    299310    pthread_mutex_destroy(&m_backtrace_lock); 
    300  
    301 #ifdef IMPLEMENT_BACKLOG 
     311#endif 
     312 
     313#if DEBUG_BACKLOG_SUPPORT 
    302314    pthread_mutex_destroy(&bl_mb_write_lock); 
    303315#endif 
     
    314326        //         cout << "DebugModuleManager init..." << endl; 
    315327 
     328#if DEBUG_USE_MESSAGE_BUFFER 
     329    pthread_mutex_init(&mb_flush_lock, NULL); 
    316330    pthread_mutex_init(&mb_write_lock, NULL); 
    317     pthread_mutex_init(&mb_flush_lock, NULL); 
    318331    pthread_cond_init(&mb_ready_cond, NULL); 
    319  
    320     pthread_mutex_init(&m_backtrace_lock, NULL); 
    321332 
    322333    mb_overruns = 0; 
    323334    mb_initialized = 1; 
    324335 
    325 #ifdef IMPLEMENT_BACKLOG 
    326     pthread_mutex_init(&bl_mb_write_lock, NULL); 
    327 #endif 
    328  
    329336    if (pthread_create(&mb_writer_thread, NULL, &mb_thread_func, (void *)this) != 0) 
    330337         mb_initialized = 0; 
     338#endif 
     339 
     340#if DEBUG_BACKTRACE_SUPPORT 
     341    pthread_mutex_init(&m_backtrace_lock, NULL); 
     342#endif 
     343 
     344#if DEBUG_BACKLOG_SUPPORT 
     345    pthread_mutex_init(&bl_mb_write_lock, NULL); 
     346#endif 
    331347 
    332348    return true; 
     
    413429DebugModuleManager::flush() 
    414430{ 
    415 #ifdef DEBUG_USE_MESSAGE_BUFFER 
     431#if DEBUG_USE_MESSAGE_BUFFER 
    416432    mb_flush(); 
    417433#else 
     
    420436} 
    421437 
     438#if DEBUG_USE_MESSAGE_BUFFER 
    422439void 
    423440DebugModuleManager::mb_flush() 
     
    439456} 
    440457 
    441 #ifdef IMPLEMENT_BACKLOG 
     458void * 
     459DebugModuleManager::mb_thread_func(void *arg) 
     460
     461 
     462    DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 
     463 
     464    /* The mutex is only to eliminate collisions between multiple 
     465     * writer threads and protect the condition variable. */ 
     466     pthread_mutex_lock(&m->mb_write_lock); 
     467 
     468    while (m->mb_initialized) { 
     469         pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 
     470 
     471         /* releasing the mutex reduces contention */ 
     472         pthread_mutex_unlock(&m->mb_write_lock); 
     473         m->mb_flush(); 
     474         pthread_mutex_lock(&m->mb_write_lock); 
     475    } 
     476 
     477     pthread_mutex_unlock(&m->mb_write_lock); 
     478 
     479    return NULL; 
     480
     481#endif 
     482 
     483#if DEBUG_BACKLOG_SUPPORT 
    442484void 
    443485DebugModuleManager::showBackLog() 
     
    491533    pthread_mutex_unlock(&m->mb_flush_lock); 
    492534} 
    493 #endif 
    494  
    495 void * 
    496 DebugModuleManager::mb_thread_func(void *arg) 
    497 
    498  
    499     DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 
    500  
    501     /* The mutex is only to eliminate collisions between multiple 
    502      * writer threads and protect the condition variable. */ 
    503      pthread_mutex_lock(&m->mb_write_lock); 
    504  
    505     while (m->mb_initialized) { 
    506          pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 
    507  
    508          /* releasing the mutex reduces contention */ 
    509          pthread_mutex_unlock(&m->mb_write_lock); 
    510          m->mb_flush(); 
    511          pthread_mutex_lock(&m->mb_write_lock); 
    512     } 
    513  
    514      pthread_mutex_unlock(&m->mb_write_lock); 
    515  
    516     return NULL; 
    517 
    518  
    519 #ifdef IMPLEMENT_BACKLOG 
     535 
    520536void 
    521537DebugModuleManager::backlog_print(const char *msg) 
     
    543559DebugModuleManager::print(const char *msg) 
    544560{ 
    545 #ifdef DEBUG_USE_MESSAGE_BUFFER 
     561#if DEBUG_USE_MESSAGE_BUFFER 
    546562    unsigned int ntries; 
    547563    struct timespec wait = {0,50000}; 
    548 #endif 
    549564 
    550565    if (!mb_initialized) { 
     
    556571    } 
    557572 
    558 #ifdef DEBUG_USE_MESSAGE_BUFFER 
    559573    ntries=1; 
    560574    while (ntries) { // try a few times 
     
    580594} 
    581595 
     596#if DEBUG_BACKTRACE_SUPPORT 
    582597void 
    583598DebugModuleManager::printBacktrace(int len) 
     
    586601    int chars_written=0; 
    587602 
    588     if(len>MAX_BACKTRACE_SIZE) { 
    589         len = MAX_BACKTRACE_SIZE
     603    if(len > DEBUG_MAX_BACKTRACE_LENGTH) { 
     604        len = DEBUG_MAX_BACKTRACE_LENGTH
    590605    } 
    591606 
     
    609624        seen = false; 
    610625        int j; 
    611         for (j=0; j<m_backtrace_buffer_nb_seen & j < MAX_BACKTRACE_FUNCTIONS_SEEN; j++) { 
     626        for (j=0; j<m_backtrace_buffer_nb_seen & j < DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN; j++) { 
    612627            if(m_backtrace_buffer_seen[j] == m_backtrace_buffer[i]) { 
    613628                seen = true; 
     
    625640    pthread_mutex_unlock(&m_backtrace_lock); 
    626641} 
     642#endif 
    627643 
    628644//---------------------------------------- 
  • trunk/libffado/src/debugmodule/debugmodule.h

    r1030 r1046  
    4646#define DEBUG_LEVEL_ULTRA_VERBOSE  8 
    4747 
    48 #define DEBUG_MAX_MESSAGE_LENGTH 512 
    49  
    50 #define MAX_BACKTRACE_SIZE 32 
    51 #define MAX_BACKTRACE_FUNCTIONS_SEEN 128 
    52  
    5348/* MB_NEXT() relies on the fact that MB_BUFFERS is a power of two */ 
    54 #define MB_BUFFERS          (1<<16) 
    55  
    56 #define MB_NEXT(index)      (((index)+1) & (MB_BUFFERS-1)) 
    57  
     49#define MB_NEXT(index)      (((index)+1) & (DEBUG_MB_BUFFERS-1)) 
    5850#define MB_BUFFERSIZE       DEBUG_MAX_MESSAGE_LENGTH 
    5951 
    60 #ifdef DEBUG 
    61     #if DEBUG_IMPLEMENT_BACKLOG 
    62         #define IMPLEMENT_BACKLOG 
    63     #endif 
    64 #endif 
    65  
    66 #ifdef IMPLEMENT_BACKLOG 
     52// no backtrace support when not debugging 
     53#ifndef DEBUG 
     54    #undef DEBUG_BACKTRACE_SUPPORT 
     55    #define DEBUG_BACKTRACE_SUPPORT 0 
     56#endif 
     57 
     58// no backlog support when not debugging 
     59#ifndef DEBUG 
     60    #undef DEBUG_BACKLOG_SUPPORT 
     61    #define DEBUG_BACKLOG_SUPPORT 0 
     62#endif 
     63 
    6764// the backlog is a similar buffer as the message buffer 
    68 #define BACKLOG_MB_BUFFERS      (256) 
    69 #define BACKLOG_MB_NEXT(index)  (((index)+1) & (BACKLOG_MB_BUFFERS-1)) 
    70 #define BACKLOG_MIN_LEVEL       DEBUG_LEVEL_VERY_VERBOSE 
    71 #endif 
     65#define DEBUG_BACKLOG_MB_NEXT(index)  (((index)+1) & (DEBUG_BACKLOG_MB_BUFFERS-1)) 
     66#define DEBUG_BACKLOG_MIN_LEVEL       DEBUG_LEVEL_VERY_VERBOSE 
    7267 
    7368#define debugFatal( format, args... )                               \ 
     
    155150#define flushDebugOutput()      DebugModuleManager::instance()->flush() 
    156151 
    157 #ifdef IMPLEMENT_BACKLOG 
     152#if DEBUG_BACKLOG_SUPPORT 
    158153 
    159154#define debugShowBackLog() \ 
     
    249244 
    250245/* 
     246 * Backtrace support 
     247 */ 
     248#ifdef DEBUG 
     249    #if DEBUG_BACKTRACE_SUPPORT 
     250        #define debugPrintBacktrace( _SIZE_ )                       \ 
     251            DebugModuleManager::instance()->printBacktrace( _SIZE_ ); 
     252    #endif 
     253#else 
     254    #define debugPrintBacktrace( _SIZE_ ) 
     255#endif 
     256 
     257/* 
    251258 * helper functions 
    252259 */ 
     
    313320    void flush(); 
    314321 
     322#if DEBUG_BACKLOG_SUPPORT 
    315323    // the backlog is a ringbuffer of all the messages 
    316324    // that have been recorded using the debugPrint 
     
    321329    void showBackLog(); 
    322330    void showBackLog(int nblines); 
    323  
     331#endif 
     332 
     333#if DEBUG_BACKTRACE_SUPPORT 
    324334    void printBacktrace(int len); 
     335#endif 
     336 
    325337protected: 
    326338    bool registerModule( DebugModule& debugModule ); 
     
    330342 
    331343    void print(const char *msg); 
     344 
     345#if DEBUG_BACKLOG_SUPPORT 
    332346    void backlog_print(const char *msg); 
     347#endif 
    333348 
    334349private: 
     
    338353    typedef std::vector< DebugModule* >::iterator DebugModuleVectorIterator; 
    339354 
    340     char mb_buffers[MB_BUFFERS][MB_BUFFERSIZE]; 
    341355    unsigned int mb_initialized; 
     356 
     357#if DEBUG_USE_MESSAGE_BUFFER 
     358    char mb_buffers[DEBUG_MB_BUFFERS][MB_BUFFERSIZE]; 
    342359    unsigned int mb_inbuffer; 
    343360    unsigned int mb_outbuffer; 
     
    347364    pthread_mutex_t mb_flush_lock; 
    348365    pthread_cond_t mb_ready_cond; 
    349  
     366#endif 
     367 
     368#if DEBUG_BACKTRACE_SUPPORT 
    350369    pthread_mutex_t m_backtrace_lock; 
    351370    char m_backtrace_strbuffer[MB_BUFFERSIZE]; 
    352     void *m_backtrace_buffer[MAX_BACKTRACE_SIZE]; 
    353     void *m_backtrace_buffer_seen[MAX_BACKTRACE_FUNCTIONS_SEEN]; 
     371    void *m_backtrace_buffer[DEBUG_MAX_BACKTRACE_LENGTH]; 
     372    void *m_backtrace_buffer_seen[DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN]; 
    354373    int m_backtrace_buffer_nb_seen; 
    355      
     374#endif 
     375 
    356376    static void *mb_thread_func(void *arg); 
    357377    void mb_flush(); 
    358378 
    359 #ifdef IMPLEMENT_BACKLOG 
     379#if DEBUG_BACKLOG_SUPPORT 
    360380    // the backlog 
    361     char bl_mb_buffers[BACKLOG_MB_BUFFERS][MB_BUFFERSIZE]; 
     381    char bl_mb_buffers[DEBUG_BACKLOG_MB_BUFFERS][MB_BUFFERSIZE]; 
    362382    unsigned int bl_mb_inbuffer; 
    363383    pthread_mutex_t bl_mb_write_lock; 
     
    368388}; 
    369389 
    370  
    371 /* 
    372  * Backtrace support 
    373  */ 
    374 #ifdef DEBUG 
    375     #define debugPrintBacktrace( _SIZE_ )                       \ 
    376         DebugModuleManager::instance()->printBacktrace( _SIZE_ ); 
    377 #else 
    378     #define debugPrintBacktrace( _SIZE_ ) 
    379 #endif 
    380  
    381  
    382 #endif 
     390#endif 
  • trunk/libffado/src/ffado.cpp

    r967 r1046  
    9797    struct _ffado_device *dev = new struct _ffado_device; 
    9898 
    99     debugWarning("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__); 
     99    printMessage("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__); 
    100100 
    101101    if(!dev) { 
     
    248248        return ffado_wait_ok; 
    249249    } else if (result == DeviceManager::eWR_Xrun) { 
    250         debugWarning("Handled XRUN\n"); 
     250        debugOutput(DEBUG_LEVEL_NORMAL, "Handled XRUN\n"); 
    251251        xruns++; 
    252252        return ffado_wait_xrun; 
  • trunk/libffado/src/libieee1394/ARMHandler.cpp

    r864 r1046  
    2424#include "ARMHandler.h" 
    2525 
    26 IMPL_DEBUG_MODULE( ARMHandler, ARMHandler, DEBUG_LEVEL_VERBOSE); 
     26IMPL_DEBUG_MODULE( ARMHandler, ARMHandler, DEBUG_LEVEL_NORMAL); 
    2727/** 
    2828 * @param start          identifies addressrange 
     
    6868 
    6969bool ARMHandler::handleRead(struct raw1394_arm_request *req) { 
    70     debugOutput(DEBUG_LEVEL_VERBOSE,"Read\n"); 
     70    debugOutput(DEBUG_LEVEL_VERBOSE, "Read\n"); 
    7171    printRequest(req); 
    7272    return true; 
     
    7474 
    7575bool ARMHandler::handleWrite(struct raw1394_arm_request *req) { 
    76     debugOutput(DEBUG_LEVEL_VERBOSE,"Write\n"); 
     76    debugOutput(DEBUG_LEVEL_VERBOSE, "Write\n"); 
    7777    printRequest(req); 
    7878    return true; 
     
    8080 
    8181bool ARMHandler::handleLock(struct raw1394_arm_request *req) { 
    82     debugOutput(DEBUG_LEVEL_VERBOSE,"Lock\n"); 
     82    debugOutput(DEBUG_LEVEL_VERBOSE, "Lock\n"); 
    8383    printRequest(req); 
    8484    return true; 
     
    109109 
    110110void ARMHandler::printRequest(struct raw1394_arm_request *arm_req) { 
    111     debugOutput(DEBUG_LEVEL_VERBOSE," request info: \n"); 
    112     debugOutput(DEBUG_LEVEL_VERBOSE,"  from node 0x%04X to node 0x%04X\n", 
     111    debugOutput(DEBUG_LEVEL_VERBOSE, " request info: \n"); 
     112    debugOutput(DEBUG_LEVEL_VERBOSE, "  from node 0x%04X to node 0x%04X\n", 
    113113        arm_req->source_nodeid, arm_req->destination_nodeid); 
    114     debugOutput(DEBUG_LEVEL_VERBOSE,"  tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n", 
     114    debugOutput(DEBUG_LEVEL_VERBOSE, "  tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n", 
    115115        arm_req->tlabel, arm_req->tcode, arm_req->extended_transaction_code); 
    116     debugOutput(DEBUG_LEVEL_VERBOSE,"  generation: %lu\n", 
     116    debugOutput(DEBUG_LEVEL_VERBOSE, "  generation: %lu\n", 
    117117        arm_req->generation); 
    118     debugOutput(DEBUG_LEVEL_VERBOSE,"  buffer length: %lu\n", 
     118    debugOutput(DEBUG_LEVEL_VERBOSE, "  buffer length: %lu\n", 
    119119        arm_req->buffer_length); 
    120120    printBufferBytes(DEBUG_LEVEL_VERBOSE, arm_req->buffer_length, arm_req->buffer); 
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1044 r1046  
    421421    } else { 
    422422        #ifdef DEBUG 
    423         debugError("raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 
    424               nodeId, addr, length); 
     423        debugOutput(DEBUG_LEVEL_NORMAL, 
     424                    "raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 
     425                    nodeId, addr, length); 
    425426        #endif 
    426427        return false; 
  • trunk/libffado/src/libieee1394/IsoHandler.cpp

    r1040 r1046  
    429429        if (dropped_cycles < 0) { 
    430430            debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d, 'skipped'=%u\n",  
    431                         this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 
     431                        this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 
    432432        } 
    433433        if (dropped_cycles > 0) { 
    434             debugWarning("(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u, cycle=%d, m_last_cycle=%d\n", 
    435                 this, dropped_cycles, cycle, dropped, skipped, cycle, m_last_cycle); 
     434            debugOutput(DEBUG_LEVEL_NORMAL, 
     435                        "(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u, cycle=%d, m_last_cycle=%d\n", 
     436                        this, dropped_cycles, cycle, dropped, skipped, cycle, m_last_cycle); 
    436437            m_dropped += dropped_cycles; 
    437438        } 
     
    537538        #ifdef DEBUG 
    538539        if(skipped) { 
    539             debugWarning("(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n",  
    540                          this, skipped, cycle, m_last_cycle, dropped); 
     540            debugOutput(DEBUG_LEVEL_NORMAL, 
     541                        "(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n",  
     542                        this, skipped, cycle, m_last_cycle, dropped); 
    541543        } 
    542544        if (dropped_cycles < 0) {  
     
    545547        } 
    546548        if (dropped_cycles > 0) { 
    547             debugWarning("(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d, skipped: %d)\n", 
    548                          this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 
    549             m_dropped += dropped_cycles; 
     549            debugOutput(DEBUG_LEVEL_NORMAL, 
     550                        "(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d, skipped: %d)\n", 
     551                        this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 
     552            m_dropped += dropped_cycles - skipped; 
    550553        } 
    551554        #endif 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r1036 r1046  
    352352            // this is an xrun situation 
    353353            m_in_xrun = true; 
    354             debugWarning("Should update state to WaitingForStreamDisable due to dropped packet xrun\n"); 
     354            debugOutput(DEBUG_LEVEL_NORMAL, "Should update state to WaitingForStreamDisable due to dropped packet xrun\n"); 
    355355            m_cycle_to_switch_state = CYCLE_TIMER_GET_CYCLES(pkt_ctr) + 1; // switch in the next cycle 
    356356            m_next_state = ePS_WaitingForStreamDisable; 
     
    391391            // they represent a discontinuity in the timestamps, and hence are 
    392392            // to be dealt with 
    393             debugWarning("(%p) Correcting timestamp for dropped cycles, discarding packet...\n", this); 
     393            debugOutput(DEBUG_LEVEL_NORMAL, "(%p) Correcting timestamp for dropped cycles, discarding packet...\n", this); 
    394394            m_data_buffer->setBufferTailTimestamp(substractTicks(m_last_timestamp, 
    395395                                                                 (uint64_t)(getNominalFramesPerPacket() 
     
    439439        // allow for the xrun to be picked up 
    440440        if (result2 == eCRV_XRun) { 
    441             debugWarning("processPacketData xrun\n"); 
     441            debugOutput(DEBUG_LEVEL_NORMAL, "processPacketData xrun\n"); 
    442442            m_in_xrun = true; 
    443443            debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 
     
    497497        if(m_state == ePS_Running) { 
    498498            debugShowBackLogLines(200); 
    499             debugWarning("dropped packets xrun\n"); 
     499            debugOutput(DEBUG_LEVEL_NORMAL, "dropped packets xrun\n"); 
    500500            debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to dropped packets xrun\n"); 
    501501            m_cycle_to_switch_state = CYCLE_TIMER_GET_CYCLES(pkt_ctr) + 1; 
     
    623623            // allow for the xrun to be picked up 
    624624            if (result2 == eCRV_XRun) { 
    625                 debugWarning("generatePacketData xrun\n"); 
     625                debugOutput(DEBUG_LEVEL_NORMAL, "generatePacketData xrun\n"); 
    626626                m_in_xrun = true; 
    627627                debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 
     
    661661            } 
    662662        } else if (result == eCRV_XRun) { // pick up the possible xruns 
    663             debugWarning("generatePacketHeader xrun\n"); 
     663            debugOutput(DEBUG_LEVEL_NORMAL, "generatePacketHeader xrun\n"); 
    664664            m_in_xrun = true; 
    665665            debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to header xrun\n"); 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r1045 r1046  
    149149        if (result == ETIMEDOUT) { 
    150150            debugOutput(DEBUG_LEVEL_VERBOSE, 
    151                         "(%p) pthread_cond_timedwait() timed out (result=%d)\n", 
     151                        "(%p) sem_timedwait() timed out (result=%d)\n", 
    152152                        this, result); 
    153153            return eAR_Timeout; 
    154154        } else if (result == EINTR) { 
    155155            debugOutput(DEBUG_LEVEL_VERBOSE, 
    156                         "(%p) pthread_cond_[timed]wait() interrupted by signal (result=%d)\n", 
     156                        "(%p) sem_[timed]wait() interrupted by signal (result=%d)\n", 
    157157                        this, result); 
    158158            return eAR_Interrupted; 
    159159        } else { 
    160             debugError("(%p) pthread_cond_[timed]wait error (result=%d)\n",  
     160            debugError("(%p) sem_[timed]wait error (result=%d)\n",  
    161161                        this, result); 
    162162            debugError("(%p) timeout_sec=%d timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n",  
     
    10021002 
    10031003        if ((*it)->xrunOccurred()) { 
    1004             debugWarning("Xrun on RECV SP %p due to ISO side xrun\n",*it); 
     1004            debugOutput(DEBUG_LEVEL_NORMAL, 
     1005                        "Xrun on RECV SP %p due to ISO side xrun\n", *it); 
    10051006            (*it)->dumpInfo(); 
    10061007        } 
    10071008        if (!((*it)->canClientTransferFrames(m_period))) { 
    1008             debugWarning("Xrun on RECV SP %p due to buffer side xrun\n",*it); 
     1009            debugOutput(DEBUG_LEVEL_NORMAL, 
     1010                        "Xrun on RECV SP %p due to buffer side xrun\n", *it); 
    10091011            (*it)->dumpInfo(); 
    10101012        } 
     
    10141016          ++it ) { 
    10151017        if ((*it)->xrunOccurred()) { 
    1016             debugWarning("Xrun on XMIT SP %p due to ISO side xrun\n",*it); 
     1018            debugOutput(DEBUG_LEVEL_NORMAL, 
     1019                        "Xrun on XMIT SP %p due to ISO side xrun\n", *it); 
    10171020        } 
    10181021        if (!((*it)->canClientTransferFrames(m_period))) { 
    1019             debugWarning("Xrun on XMIT SP %p due to buffer side xrun\n",*it); 
     1022            debugOutput(DEBUG_LEVEL_NORMAL, 
     1023                        "Xrun on XMIT SP %p due to buffer side xrun\n", *it); 
    10201024        } 
    10211025    } 
    10221026#endif 
    1023  
    10241027    m_nbperiods++; 
    1025  
    10261028    // now we can signal the client that we are (should be) ready 
    10271029    return !xrun_occurred;