commsfwtools/commstools/utracedecoder/src/logevents/metatraceevent.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <iostream>
       
    17 #include <iomanip>
       
    18 #include <math.h>
       
    19 
       
    20 #include "utracedecoderapp.h"
       
    21 #include "logevents\metatraceevent.h"
       
    22 #include "e32btrace.h"
       
    23 
       
    24 CMetaTraceEvent::CMetaTraceEvent(const CUTraceFrame& aFrame, MEventOutputHandler& aOutputHandler)
       
    25     : CTraceEventBase(aFrame, aOutputHandler)
       
    26     {
       
    27     SetPrefix("EMetaTrace");
       
    28     }
       
    29 
       
    30 CMetaTraceEvent::CMetaTraceEvent(const CMultiPartFrameCollection& aFrameCollection, MEventOutputHandler& aOutputHandler)
       
    31     : CTraceEventBase(aFrameCollection, aOutputHandler)
       
    32     {
       
    33     SetPrefix("EMetaTrace");
       
    34     }
       
    35 
       
    36 void CMetaTraceEvent::Describe(std::ostream& aOutput) const
       
    37     {
       
    38     int subcat = SubCategory();
       
    39 
       
    40     switch (subcat)
       
    41         {
       
    42         case BTrace::EMetaTraceTimestampsInfo:
       
    43 			{
       
    44 			int val = Arg1();
       
    45 			int exponent = (signed char)(val>>24);
       
    46 			int mantissa = val&0xffffff;
       
    47 			double period1 = (double)mantissa * ::pow((double) 2, exponent);
       
    48 			val = *((int*)Data() + 0);
       
    49 			exponent = (signed char)(val>>24);
       
    50 			mantissa = val&0xffffff;
       
    51 			double period2 = (double)mantissa * ::pow((double) 2, exponent);
       
    52 			int flags = *((int*)Data() + 1);
       
    53 			CUTraceDecoderApp::SetTimestampPeriod((flags & 1)? CUTraceDecoderApp::E64Bit: CUTraceDecoderApp::ESplit, period1, period2);
       
    54 
       
    55             aOutput << std::noshowbase << std::nouppercase << std::hex
       
    56                 << "Server Create: [DServer=0x" << std::setw(8) << std::setfill('0') << Arg1()
       
    57                 << "] [Name=" << (Data() + 4)
       
    58                 << "] ";
       
    59 			}
       
    60             break;
       
    61 
       
    62 		default:
       
    63 			;
       
    64 		}
       
    65 	}
       
    66