Changeset 7592


Ignore:
Timestamp:
Jan 3, 2009, 2:43:17 AM (12 years ago)
Author:
charles
Message:

(trunk libT) add "deep log" message to help track down freeze reported by the|Navigator. also, small + cheap speedup in tr_deepLoggingIsActive()

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.c

    r7589 r7592  
    199199    struct tr_peerIo ** peers;
    200200
    201 
    202201    /* allocateBandwidth() is a helper function with two purposes:
    203202     * 1. allocate bandwidth to b and its subtree
     
    223222        const int increment = 1024;
    224223        const int bytesUsed = tr_peerIoFlush( peers[i], dir, increment );
     224
     225        dbgmsg( "peer #%d of %d used %.2f KiB in this pass", i, n, bytesUsed/1024.0 );
    225226
    226227        if( bytesUsed == increment )
  • trunk/libtransmission/utils.c

    r7581 r7592  
    223223}
    224224
    225 int
     225tr_bool
    226226tr_deepLoggingIsActive( void )
    227227{
    228     return IsDebuggerPresent() || (tr_getLog()!=NULL);
     228    static tr_bool deepLoggingIsActive = -1;
     229
     230    if( deepLoggingIsActive == -1 )
     231        deepLoggingIsActive = IsDebuggerPresent() || (tr_getLog()!=NULL);
     232
     233    return deepLoggingIsActive;
    229234}
    230235
  • trunk/libtransmission/utils.h

    r7581 r7592  
    183183FILE*          tr_getLog( void );
    184184
    185 int            tr_deepLoggingIsActive( void );
     185tr_bool        tr_deepLoggingIsActive( void );
    186186
    187187void           tr_deepLog( const char * file,
Note: See TracChangeset for help on using the changeset viewer.