Changeset 10923


Ignore:
Timestamp:
Jul 1, 2010, 4:26:30 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #1521 "memory cache to reduce disk IO" -- improve one of the debugging messages

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/cache.c

    r10865 r10923  
    2020
    2121#define MY_NAME "Cache"
     22
     23#define dbgmsg( ... ) \
     24    do { \
     25        if( tr_deepLoggingIsActive( ) ) \
     26            tr_deepLog( __FILE__, __LINE__, MY_NAME, __VA_ARGS__ ); \
     27    } while( 0 )
     28
    2229
    2330/****
     
    157164    const uint32_t offset        = b->offset;
    158165
    159 //fprintf( stderr, "flushing %d contiguous blocks from [%d to %d)\n", n, pos, n+pos );
     166//fprintf( stderr, "flushing %d contiguous blocks [%d-%d) from cache to disk\n", n, pos, n+pos );
    160167
    161168    for( i=pos; i<pos+n; ++i ) {
     
    362369    const tr_block_index_t end  = tr_torPieceFirstBlock( torrent, file->lastPiece ) + tr_torPieceCountBlocks( torrent, file->lastPiece );
    363370    const int pos = findPiece( cache, torrent, file->firstPiece );
    364 //fprintf( stderr, "flushing file %d, which is blocks [%zu...%zu)\n", (int)i, (size_t)begin, (size_t)end );
     371    dbgmsg( "flushing file %d from cache to disk: blocks [%zu...%zu)", (int)i, (size_t)begin, (size_t)end );
    365372
    366373    /* flush out all the blocks in that file */
  • trunk/libtransmission/peer-mgr.c

    r10895 r10923  
    14991499                            if( ( file->firstPiece <= p ) && ( p <= file->lastPiece ) ) {
    15001500                                if( tr_cpFileIsComplete( &tor->completion, fileIndex ) ) {
    1501 fprintf( stderr, "flushing complete file %d (%s)\n", fileIndex, tor->info.files[fileIndex].name );
    15021501                                    tr_cacheFlushFile( tor->session->cache, tor, fileIndex );
    15031502                                    tr_torrentFileCompleted( tor, fileIndex );
Note: See TracChangeset for help on using the changeset viewer.