0
|
1 |
// Copyright (c) 2005-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 |
#include <d32btrace.h>
|
|
17 |
|
|
18 |
class TBTraceBufferK
|
|
19 |
{
|
|
20 |
public:
|
|
21 |
TLinAddr iAddress;
|
|
22 |
TUint iStart;
|
|
23 |
TUint iEnd;
|
|
24 |
TUint iHead;
|
|
25 |
volatile TInt iRequestDataSize;
|
|
26 |
TUint8* iRecordOffsets;
|
|
27 |
TUint iDropped;
|
|
28 |
DChunk* iBufferChunk;
|
|
29 |
volatile TDfc* iWaitingDfc;
|
|
30 |
BTrace::THandler iOldBTraceHandler;
|
|
31 |
BTrace::TControlFunction iOldBTraceControl;
|
|
32 |
TBool iTimestamp2Enabled;
|
|
33 |
TUint iCrashReadPart;
|
|
34 |
public:
|
|
35 |
TInt Create(TInt aSize);
|
|
36 |
void Close();
|
|
37 |
void Reset(TUint aMode);
|
|
38 |
TInt RequestData(TInt aSize, TDfc* aDfc);
|
|
39 |
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);
|
|
40 |
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);
|
|
41 |
static TInt ControlFunction(BTrace::TControl aFunction, TAny* aArg1, TAny* aArg2);
|
|
42 |
void CrashRead(TUint8*& aData, TUint& aSize);
|
|
43 |
private:
|
|
44 |
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);
|
|
45 |
};
|
|
46 |
|
|
47 |
extern TBTraceBufferK Buffer;
|
|
48 |
|
|
49 |
/**
|
|
50 |
If this macro is defined a timestamp is added to each fast-trace record; if supported by the platform.
|
|
51 |
*/
|
|
52 |
#define BTRACE_INCLUDE_TIMESTAMPS
|
|
53 |
|
|
54 |
#ifdef __MARM__
|
|
55 |
#ifndef __SMP__
|
|
56 |
#define BTRACE_DRIVER_MACHINE_CODED
|
|
57 |
#endif
|
|
58 |
#endif
|
|
59 |
|