Changeset 790

Show
Ignore:
Timestamp:
12/31/07 05:50:33 (16 years ago)
Author:
ppalmers
Message:

add debugging code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp

    r750 r790  
    3434                 getConfigRom().getNodeId() ); 
    3535 
    36     // the saffire pro doesn't seem to like it if the commands are too fast 
     36    // the saffire doesn't seem to like it if the commands are too fast 
    3737    if (AVC::AVCCommand::getSleepAfterAVCCommand() < 1000) { 
    3838        AVC::AVCCommand::setSleepAfterAVCCommand( 1000 ); 
     
    4646    bool result=true; 
    4747    debugOutput(DEBUG_LEVEL_VERBOSE, "Building a Focusrite Saffire mixer...\n"); 
    48      
     48 
    4949    destroyMixer(); 
    50      
     50 
    5151    // create the mixer object container 
    5252    m_MixerContainer = new Control::Container("Mixer"); 
  • trunk/libffado/src/debugmodule/debugmodule.h

    r777 r790  
    142142#ifdef IMPLEMENT_BACKLOG 
    143143 
    144 #define debugShowBackLog()          DebugModuleManager::instance()->showBackLog() 
    145 #define debugShowBackLogLines(x)    DebugModuleManager::instance()->showBackLog(x) 
     144#define debugShowBackLog() \ 
     145    {                                                       \ 
     146        m_debugModule.print( DebugModule::eDL_Warning,      \ 
     147                             __FILE__,                      \ 
     148                             __FUNCTION__,                  \ 
     149                             __LINE__,                      \ 
     150                             "Backlog print requested\n");  \ 
     151        DebugModuleManager::instance()->showBackLog();      \ 
     152    } 
     153#define debugShowBackLogLines(x) \ 
     154    {                                                       \ 
     155        m_debugModule.print( DebugModule::eDL_Warning,      \ 
     156                             __FILE__,                      \ 
     157                             __FUNCTION__,                  \ 
     158                             __LINE__,                      \ 
     159                             "Backlog print requested\n");  \ 
     160        DebugModuleManager::instance()->showBackLog(x);     \ 
     161    } 
    146162 
    147163#else 
  • trunk/libffado/src/libieee1394/IsoHandler.cpp

    r777 r790  
    435435                    int cycle, unsigned int dropped) { 
    436436 
    437     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
     437    debugOutput( DEBUG_LEVEL_ULTRA_VERBOSE, 
    438438                    "sending packet: length=%d, cycle=%d\n", 
    439439                    *length, cycle ); 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp

    r779 r790  
    8686                  unsigned int cycle, unsigned int dropped) 
    8787{ 
     88    #ifdef DEBUG 
     89    static uint32_t now_prev=0; 
     90    static uint64_t now_prev_ticks=0; 
     91    #endif 
     92 
    8893    struct iec61883_packet *packet = (struct iec61883_packet *) data; 
    8994    assert(packet); 
     
    9499                  (length >= 2*sizeof(quadlet_t)); 
    95100    if(ok) { 
    96         uint64_t now = m_1394service.getCycleTimer(); 
     101        uint32_t now = m_1394service.getCycleTimer(); 
     102 
     103        #ifdef DEBUG 
     104        uint64_t now_ticks = CYCLE_TIMER_TO_TICKS(now); 
     105 
     106        if (diffTicks(now_ticks, now_prev_ticks) < 0) { 
     107            debugWarning("non-monotonic CTR on cycle %04u: %llu -> %llu\n", cycle, now_prev_ticks, now_ticks); 
     108            debugWarning("                               : %08X -> %08X\n", now_prev, now); 
     109            debugOutput ( DEBUG_LEVEL_VERBOSE, 
     110                        " current: %011llu (%03us %04ucy %04uticks)\n", 
     111                        now, 
     112                        (unsigned int)TICKS_TO_SECS( now ), 
     113                        (unsigned int)TICKS_TO_CYCLES( now ), 
     114                        (unsigned int)TICKS_TO_OFFSET( now ) ); 
     115            debugOutput ( DEBUG_LEVEL_VERBOSE, 
     116                        " prev   : %011llu (%03us %04ucy %04uticks)\n", 
     117                        now_prev, 
     118                        (unsigned int)TICKS_TO_SECS( now_prev ), 
     119                        (unsigned int)TICKS_TO_CYCLES( now_prev ), 
     120                        (unsigned int)TICKS_TO_OFFSET( now_prev ) ); 
     121        } 
     122        now_prev = now; 
     123        now_prev_ticks=now_ticks; 
     124        #endif 
     125 
    97126        //=> convert the SYT to a full timestamp in ticks 
    98127        m_last_timestamp = sytRecvToFullTicks((uint32_t)ntohs(packet->syt), 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp

    r783 r790  
    282282            debugWarning ( "Problem encoding Packet Ports\n" ); 
    283283        } 
    284         debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT DATA: TSP=%011llu (%04u)\n", 
     284        debugOutput ( DEBUG_LEVEL_ULTRA_VERBOSE, "XMIT DATA (cy %04d): TSP=%011llu (%04u)\n", 
    285285                    cycle, m_last_timestamp, ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
    286286        return eCRV_OK; 
     
    297297{ 
    298298    struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 
    299     debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT NONE: CY=%04u, TSP=%011llu (%04u)\n", 
     299    debugOutput ( DEBUG_LEVEL_ULTRA_VERBOSE, "XMIT NONE (cy %04d): CY=%04u, TSP=%011llu (%04u)\n", 
    300300                cycle, m_last_timestamp, ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
    301301 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r784 r790  
    753753            int d = m_SyncSource->getSyncDelay() + TICKS_PER_CYCLE; 
    754754            m_SyncSource->setSyncDelay(d); 
     755            d = m_SyncSource->getSyncDelay(); 
     756            debugOutput(DEBUG_LEVEL_VERBOSE, "Increased the Sync delay to: %d\n", d); 
    755757 
    756758            #ifdef DEBUG 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r765 r790  
    11511151    ffado_timestamp_t max_abs_diff = one_update_step * (1.0 + max_deviation); 
    11521152     
     1153    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " nbframes: %d, m_update_period: %d \n", nbframes, m_update_period); 
     1154    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " tail TS: "TIMESTAMP_FORMAT_SPEC", next tail TS: "TIMESTAMP_FORMAT_SPEC"\n",  
     1155                                          m_buffer_tail_timestamp, m_buffer_next_tail_timestamp); 
     1156    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " new TS: "TIMESTAMP_FORMAT_SPEC", wrapped new TS: "TIMESTAMP_FORMAT_SPEC"\n",  
     1157                                          new_timestamp, ts); 
     1158 
    11531159    if (diff > max_abs_diff) { 
     1160        debugShowBackLogLines(100); 
    11541161        debugWarning("(%p) difference rather large (+): diff="TIMESTAMP_FORMAT_SPEC", max="TIMESTAMP_FORMAT_SPEC", "TIMESTAMP_FORMAT_SPEC", "TIMESTAMP_FORMAT_SPEC"\n", 
    11551162            this, diff, max_abs_diff, ts, pred_buffer_next_tail_timestamp); 
    1156 //         debugShowBackLogLines(40); 
    11571163    } else if (diff < -max_abs_diff) { 
     1164        debugShowBackLogLines(100); 
    11581165        debugWarning("(%p) difference rather large (-): diff="TIMESTAMP_FORMAT_SPEC", max="TIMESTAMP_FORMAT_SPEC", "TIMESTAMP_FORMAT_SPEC", "TIMESTAMP_FORMAT_SPEC"\n", 
    11591166            this, diff, -max_abs_diff, ts, pred_buffer_next_tail_timestamp); 
    1160 //         debugShowBackLogLines(40); 
    11611167    } 
    11621168 
  • trunk/libffado/src/SConscript

    r787 r790  
    265265        "test-dll" : "libutil/test-dll.cpp", \ 
    266266        "test-unittests-util" : "libutil/unittests.cpp", \ 
     267        "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \ 
    267268} 
    268269