kerneltest/e32utils/analyse/trace.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     1 // Copyright (c) 2000-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 the License "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 #ifndef __TRACE__
       
    17 #define __TRACE__
       
    18 
       
    19 #include <utility>
       
    20 
       
    21 typedef unsigned char TraceData;
       
    22 typedef unsigned long PC;
       
    23 
       
    24 struct Process
       
    25 	{
       
    26 	int iId;
       
    27 	char* iName;
       
    28 	};
       
    29 
       
    30 struct Thread
       
    31 	{
       
    32 	int iId;
       
    33 	char* iName;
       
    34 	const Process* iProcess;
       
    35 	int iIndex;
       
    36 	};
       
    37 
       
    38 class Sampler
       
    39 	{
       
    40 public:
       
    41 	virtual void Sample(unsigned aNumber, const Thread& aThread, PC aPc) =0;
       
    42 	virtual void Complete(unsigned aTotal, unsigned aActive) =0;
       
    43 	};
       
    44 
       
    45 class Decoder;
       
    46 class NonXIP;
       
    47 
       
    48 class Trace
       
    49 	{
       
    50 public:
       
    51 	Trace();
       
    52 	~Trace();
       
    53 	void Load(const char* aTraceFile, unsigned aBegin, unsigned aEnd);
       
    54 	void Decode(Sampler& aSampler, NonXIP* aNonXIP);
       
    55 private:
       
    56 	TraceData* iTrace;
       
    57 	int iLength;
       
    58 	Decoder* iDecoder;
       
    59 	};
       
    60 
       
    61 #endif // __TRACE__