56
|
1 |
// Copyright (c) 2007-2010 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 |
// Base-class handler interface for BTrace categories
|
|
15 |
//
|
|
16 |
|
|
17 |
#ifndef __BTRACECATEGORYHANDLER_H__
|
|
18 |
#define __BTRACECATEGORYHANDLER_H__
|
|
19 |
|
|
20 |
|
|
21 |
// Include files
|
|
22 |
#include <kernel/kernel.h>
|
|
23 |
|
|
24 |
|
|
25 |
// Forward declarations
|
|
26 |
class DTraceCoreWriter;
|
|
27 |
class DTraceCoreSettings;
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Saved activation item for multipart traces
|
|
31 |
*/
|
|
32 |
class TMultiPartActivationInfo
|
|
33 |
{
|
|
34 |
public:
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Constructor sets member variables to zero
|
|
38 |
*/
|
|
39 |
TMultiPartActivationInfo()
|
|
40 |
{
|
|
41 |
iComponentId = 0;
|
|
42 |
iTraceWord = 0;
|
|
43 |
iMultiPartId = 0;
|
|
44 |
}
|
|
45 |
|
|
46 |
TUint32 iComponentId;
|
|
47 |
TUint32 iTraceWord;
|
|
48 |
TUint32 iMultiPartId;
|
|
49 |
};
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Category-specific handler interface which can be registered to DTraceCoreBTraceHandler.
|
|
53 |
*/
|
|
54 |
class DBTraceCategoryHandler : public DBase
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Constructor
|
|
60 |
*/
|
|
61 |
IMPORT_C DBTraceCategoryHandler();
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor
|
|
65 |
*/
|
|
66 |
IMPORT_C ~DBTraceCategoryHandler();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Registers the categories to BTrace handler
|
|
70 |
*/
|
|
71 |
IMPORT_C TInt Register();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Called before SetWriter with interrupts enabled
|
|
75 |
*
|
|
76 |
* @param aWriter The writer to be used
|
|
77 |
*/
|
|
78 |
IMPORT_C virtual void PrepareSetWriter( DTraceCoreWriter* aWriter );
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Sets the active writer. This is called with interrupts disabled
|
|
82 |
*
|
|
83 |
* @param aWriter The writer to be used
|
|
84 |
*/
|
|
85 |
IMPORT_C virtual void SetWriter( DTraceCoreWriter* aWriter );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Sets the active settings.
|
|
89 |
*
|
|
90 |
* @param aSettings The settings to be used
|
|
91 |
*/
|
|
92 |
IMPORT_C virtual void SetSettings( DTraceCoreSettings* aSettings );
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Category-specific handler function.
|
|
96 |
*
|
|
97 |
* @param aHeader BTrace header
|
|
98 |
* @param aHeader2 Extra header data
|
|
99 |
* @param aContext The thread context in which this function was called
|
|
100 |
* @param a1 The first trace parameter
|
|
101 |
* @param a2 The second trace parameter
|
|
102 |
* @param a3 The third trace parameter
|
|
103 |
* @param aExtra Extra trace data
|
|
104 |
* @param aPc The program counter value
|
|
105 |
* @return ETrue if trace was processed, EFalse if not
|
|
106 |
*/
|
|
107 |
virtual TBool HandleFrame( TUint32 aHeader, TUint32 aHeader2, const TUint32 aContext,
|
|
108 |
const TUint32 a1, const TUint32 a2, const TUint32 a3,
|
|
109 |
const TUint32 aExtra, const TUint32 aPc ) = 0;
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Adds a category to the list of categories to be registered
|
|
113 |
*
|
|
114 |
* @param aCategory The category to be registered
|
|
115 |
*/
|
|
116 |
IMPORT_C TInt AddCategory( TUint8 aCategory );
|
|
117 |
|
|
118 |
private:
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Unregisters from BTrace handler. Called from destructor
|
|
122 |
*/
|
|
123 |
void Unregister();
|
|
124 |
|
|
125 |
protected:
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Currently active writer
|
|
129 |
*/
|
|
130 |
DTraceCoreWriter* iWriter;
|
|
131 |
|
|
132 |
/**
|
|
133 |
* Currently active settings
|
|
134 |
*/
|
|
135 |
DTraceCoreSettings* iSettings;
|
|
136 |
|
|
137 |
private:
|
|
138 |
|
|
139 |
/**
|
|
140 |
* The categories of this handler
|
|
141 |
*/
|
|
142 |
RArray< TUint8 > iCategories;
|
|
143 |
};
|
|
144 |
|
|
145 |
#endif
|
|
146 |
|
|
147 |
// End of File
|