|
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 |
|
17 |
|
18 /** |
|
19 @file te_tracerecord.h |
|
20 @internalTechnology |
|
21 */ |
|
22 #ifndef TE_TRACERECORD_H_ |
|
23 #define TE_TRACERECORD_H_ |
|
24 |
|
25 #include "te_traceglobals.h" |
|
26 #include "te_apienums.h" |
|
27 #include <e32btrace.h> //for KMaxBTraceDataArray |
|
28 |
|
29 |
|
30 /** |
|
31 * Because we need to transfer data across user and kernel side |
|
32 * and that needs to be able to do a shallow copy we need to keep it really simple. |
|
33 * Methods to fill the variables are provided by TTraceConfigsOperator |
|
34 */ |
|
35 class TTraceConfigs |
|
36 { |
|
37 public: |
|
38 //config stuff relevant to unit testing only |
|
39 TTraceApiUsed iApiUsed; |
|
40 //variability |
|
41 TUint8 iLoggingEnabled; |
|
42 TUint8 iTracingBuiltIn; |
|
43 |
|
44 //Header things |
|
45 TGroupId iGroupId; |
|
46 TComponentId iComponentId; |
|
47 TComponentId iUid3; |
|
48 THasThreadIdentification iHasThreadId; |
|
49 THasProgramCounter iHasProgramCounter; |
|
50 TUint32 iPc; |
|
51 TUint32 iContextId; |
|
52 TTraceId iTraceId; |
|
53 TUint64 iTimestamp; |
|
54 TUint32 iTimestamp2; |
|
55 |
|
56 //payload related |
|
57 TUint32 iUint32[KMaxNumberOfParams]; |
|
58 char iChar[KMaxSizeOfData]; |
|
59 TBuf8<KMaxSizeOfData> iDesC8; |
|
60 TUint32 iRawData[(8+KMaxBTraceDataArray)/4]; |
|
61 TInt iRawDataSize; |
|
62 #ifndef __KERNEL_MODE__ |
|
63 TBuf16<KMaxSizeOfData> iDesC16; |
|
64 #endif |
|
65 TUint16 iAny1; |
|
66 TTemplated4ByteAligned iTemplated; |
|
67 //btrace format related as opposed to utrace |
|
68 TUint8 iFlags; |
|
69 TUint32 iHeader2; |
|
70 TUint32 iExtra; |
|
71 TUint8 iSubCategory; |
|
72 }; |
|
73 |
|
74 class TTraceConfigsOperator |
|
75 { |
|
76 public: |
|
77 static void Init(TTraceConfigs& aConfig); |
|
78 static void SetHeader(TTraceConfigs& aConfig, TClassification aClassification, TComponentId aComponentId, THasThreadIdentification aContextId, THasProgramCounter aPc, TTraceId aTraceId); |
|
79 static void SetOptions(TTraceConfigs& aConfig, TTraceApiUsed aApiUsed, TUint8 aLoggingEnabled, TUint8 aTracingBuiltIn); |
|
80 static void SetData(TTraceConfigs& aConfig, const TUint32 aData1, const TUint32 aData2, const TUint16 aAny1, const TDesC8& aDesC8); |
|
81 // static void SetData(TTraceConfigs& aConfig, const char* aChar, TInt aCharSize, const TUint32* aRawData, TInt aDataSize); |
|
82 static void SetData(TTraceConfigs& aConfig, const char* aData, const TInt aSize); |
|
83 static void SetData(TTraceConfigs& aConfig, const TDesC8& aData); |
|
84 static void SetData(TTraceConfigs& aConfig, const TDesC16& aData); |
|
85 static void SetData(TTraceConfigs& aConfig, const TUint32 aData); |
|
86 static void SetData(TTraceConfigs& aConfig, const TUint32 aData1, const TUint32 aData2); |
|
87 static void SetData(TTraceConfigs& aConfig, const TTemplated4ByteAligned& aData); |
|
88 }; |
|
89 |
|
90 |
|
91 #endif /*TE_TRACERECORD_H_*/ |