mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl
changeset 25 d881023c13eb
parent 0 a2952bb97e68
child 32 edd273b3192a
equal deleted inserted replaced
21:a05c44bc3c61 25:d881023c13eb
    69 void CMmMtpDpPerfLog::WriteFormat( TRefByValue<const TDesC> aFmt, ... )
    69 void CMmMtpDpPerfLog::WriteFormat( TRefByValue<const TDesC> aFmt, ... )
    70     {
    70     {
    71     VA_LIST list;
    71     VA_LIST list;
    72     VA_START( list, aFmt );
    72     VA_START( list, aFmt );
    73 
    73 
    74     TBuf<KMtpLogBufferSize> buf;
    74     HBufC* buf = HBufC::New( KMtpLogBufferSize );
    75     
    75     if ( buf )
    76     buf.AppendFormatList( aFmt, list, &iOverflowHandler );
    76         {
    77     Write( buf );
    77         buf->Des().AppendFormatList( aFmt, list, &iOverflowHandler );
       
    78         Write( *buf );
       
    79         delete buf;
       
    80         }
    78     }
    81     }
    79 
    82 
    80 void CMmMtpDpPerfLog::Start( const TDesC& aDescription )
    83 void CMmMtpDpPerfLog::Start( const TDesC& aDescription )
    81     {
    84     {
    82     TInt index = 0;
    85     TInt index = 0;
   185     
   188     
   186     averageTimeDecimal.AppendNum( averageTimeDecimalValue );
   189     averageTimeDecimal.AppendNum( averageTimeDecimalValue );
   187     
   190     
   188     if (totalTimeValue <= 0xFFFFFFFF)
   191     if (totalTimeValue <= 0xFFFFFFFF)
   189         {
   192         {
       
   193         //Define the ptr on stack to avoid compiling warnning for wiscw udeb
       
   194         TPtrC ptr( iDescription[index] );
   190         WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u.%S ms, average time = %u.%S ms</PERFLOG>" ), 
   195         WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u.%S ms, average time = %u.%S ms</PERFLOG>" ), 
   191             iTitle, 
   196             iTitle, 
   192             &iDescription[index], 
   197             &ptr,
   193             iTotalUsage[index], 
   198             iTotalUsage[index], 
   194             lastTimeValue, 
   199             lastTimeValue, 
   195             &lastTimeDecimal, 
   200             &lastTimeDecimal, 
   196             I64LOW(totalTimeValue), 
   201             I64LOW(totalTimeValue), 
   197             &totalTimeDecimal, 
   202             &totalTimeDecimal, 
   198             averageTimeValue, 
   203             averageTimeValue, 
   199             &averageTimeDecimal );
   204             &averageTimeDecimal );
   200         }
   205         }
   201     else
   206     else
   202         {
   207         {
       
   208         //Define the ptr on stack to avoid compiling warnning for wiscw udeb
       
   209         TPtrC ptr( iDescription[index] );
   203         WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u%u.%S ms, average time = %u.%S ms</PERFLOG>" ), 
   210         WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u%u.%S ms, average time = %u.%S ms</PERFLOG>" ), 
   204             iTitle, 
   211             iTitle, 
   205             &iDescription[index], 
   212             &ptr,
   206             iTotalUsage[index], 
   213             iTotalUsage[index], 
   207             lastTimeValue, 
   214             lastTimeValue, 
   208             &lastTimeDecimal, 
   215             &lastTimeDecimal, 
   209             I64HIGH(totalTimeValue), 
   216             I64HIGH(totalTimeValue), 
   210             I64LOW(totalTimeValue),
   217             I64LOW(totalTimeValue),