sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: sl@0: class TBTraceBufferK sl@0: { sl@0: public: sl@0: TLinAddr iAddress; sl@0: TUint iStart; sl@0: TUint iEnd; sl@0: TUint iHead; sl@0: volatile TInt iRequestDataSize; sl@0: TUint8* iRecordOffsets; sl@0: TUint iDropped; sl@0: DChunk* iBufferChunk; sl@0: volatile TDfc* iWaitingDfc; sl@0: BTrace::THandler iOldBTraceHandler; sl@0: BTrace::TControlFunction iOldBTraceControl; sl@0: TBool iTimestamp2Enabled; sl@0: TUint iCrashReadPart; sl@0: public: sl@0: TInt Create(TInt aSize); sl@0: void Close(); sl@0: void Reset(TUint aMode); sl@0: TInt RequestData(TInt aSize, TDfc* aDfc); sl@0: 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); sl@0: 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); sl@0: static TInt ControlFunction(BTrace::TControl aFunction, TAny* aArg1, TAny* aArg2); sl@0: void CrashRead(TUint8*& aData, TUint& aSize); sl@0: private: sl@0: 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); sl@0: }; sl@0: sl@0: extern TBTraceBufferK Buffer; sl@0: sl@0: /** sl@0: If this macro is defined a timestamp is added to each fast-trace record; if supported by the platform. sl@0: */ sl@0: #define BTRACE_INCLUDE_TIMESTAMPS sl@0: sl@0: #ifdef __MARM__ sl@0: #ifndef __SMP__ sl@0: #define BTRACE_DRIVER_MACHINE_CODED sl@0: #endif sl@0: #endif sl@0: