os/kernelhwsrv/kernel/eka/include/drivers/btrace.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/btrace.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,59 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include <d32btrace.h>
    1.20 +
    1.21 +class TBTraceBufferK
    1.22 +	{
    1.23 +public:
    1.24 +	TLinAddr			iAddress;
    1.25 +	TUint				iStart;
    1.26 +	TUint				iEnd;
    1.27 +	TUint				iHead;
    1.28 +	volatile TInt		iRequestDataSize;
    1.29 +	TUint8*				iRecordOffsets;
    1.30 +	TUint				iDropped;
    1.31 +	DChunk*				iBufferChunk;
    1.32 +	volatile TDfc*		iWaitingDfc;
    1.33 +	BTrace::THandler	iOldBTraceHandler;
    1.34 +	BTrace::TControlFunction	iOldBTraceControl;
    1.35 +	TBool				iTimestamp2Enabled;
    1.36 +	TUint				iCrashReadPart;
    1.37 +public:
    1.38 +	TInt Create(TInt aSize);
    1.39 +	void Close();
    1.40 +	void Reset(TUint aMode);
    1.41 +	TInt RequestData(TInt aSize, TDfc* aDfc);
    1.42 +	static TBool Trace(TUint32 aHeader,TUint32 aHeader2,const TUint32 aContext,const TUint32 a1,const TUint32 a2,const TUint32 a3,const TUint32 aExtra,const TUint32 aPc);
    1.43 +	static TBool TraceWithTimestamp2(TUint32 aHeader,TUint32 aHeader2,const TUint32 aContext,const TUint32 a1,const TUint32 a2,const TUint32 a3,const TUint32 aExtra,const TUint32 aPc);	
    1.44 +	static TInt ControlFunction(BTrace::TControl aFunction, TAny* aArg1, TAny* aArg2);
    1.45 +	void CrashRead(TUint8*& aData, TUint& aSize);
    1.46 +private:
    1.47 +	static TBool Trace_Impl(TUint32 aHeader,TUint32 aHeader2,const TUint32 aContext,const TUint32 a1,const TUint32 a2,const TUint32 a3,const TUint32 aExtra, const TUint32 aPc, const TBool aIncTimestamp2);
    1.48 +	};
    1.49 +
    1.50 +extern TBTraceBufferK Buffer;
    1.51 +
    1.52 +/**
    1.53 +If this macro is defined a timestamp is added to each fast-trace record; if supported by the platform.
    1.54 +*/
    1.55 +#define BTRACE_INCLUDE_TIMESTAMPS
    1.56 +
    1.57 +#ifdef __MARM__
    1.58 +#ifndef __SMP__
    1.59 +#define BTRACE_DRIVER_MACHINE_CODED
    1.60 +#endif
    1.61 +#endif
    1.62 +