0
|
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 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 |
// e32\include\drivers\resmanus_trace.h
|
|
15 |
//
|
|
16 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
17 |
// to change without notice. Such APIs should therefore not be used
|
|
18 |
// outside the Kernel and Hardware Services package.
|
|
19 |
//
|
|
20 |
|
|
21 |
/**
|
|
22 |
@file
|
|
23 |
@internalComponent
|
|
24 |
*/
|
|
25 |
#ifndef __RESMANUSCONTROL_TRACE_H__
|
|
26 |
#define __RESMANUSCONTROL_TRACE_H__
|
|
27 |
#ifdef BTRACE_RESMANUS
|
|
28 |
|
|
29 |
//definition of subcategories.
|
|
30 |
#define PRM_US_OPEN_CHANNEL_START BTrace::EOpenChannelUsStart
|
|
31 |
#define PRM_US_OPEN_CHANNEL_END BTrace::EOpenChannelUsEnd
|
|
32 |
#define PRM_US_REGISTER_CLIENT_START BTrace::ERegisterClientUsStart
|
|
33 |
#define PRM_US_REGISTER_CLIENT_END BTrace::ERegisterClientUsEnd
|
|
34 |
#define PRM_US_DEREGISTER_CLIENT_START BTrace::EDeRegisterClientUsStart
|
|
35 |
#define PRM_US_DEREGISTER_CLIENT_END BTrace::EDeRegisterClientUsEnd
|
|
36 |
#define PRM_US_GET_RESOURCE_STATE_START BTrace::EGetResourceStateUsStart
|
|
37 |
#define PRM_US_GET_RESOURCE_STATE_END BTrace::EGetResourceStateUsEnd
|
|
38 |
#define PRM_US_SET_RESOURCE_STATE_START BTrace::ESetResourceStateUsStart
|
|
39 |
#define PRM_US_SET_RESOURCE_STATE_END BTrace::ESetResourceStateUsEnd
|
|
40 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_START BTrace::ECancelGetResourceStateUsStart
|
|
41 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_END BTrace::ECancelGetResourceStateUsEnd
|
|
42 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_START BTrace::ECancelSetResourceStateUsStart
|
|
43 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_END BTrace::ECancelSetResourceStateUsEnd
|
|
44 |
|
199
|
45 |
#define APPEND_VAL(val) \
|
|
46 |
{ \
|
|
47 |
printBuf.Append((TUint8 *)&(val), sizeof(val)); \
|
|
48 |
}
|
|
49 |
#define APPEND_STRING(des_ptr) \
|
|
50 |
{ \
|
|
51 |
TUint length = (des_ptr)->Length(); \
|
|
52 |
printBuf.Append((TUint8 *)&length, sizeof(TUint)); \
|
|
53 |
printBuf.Append(*(des_ptr)); \
|
|
54 |
}
|
|
55 |
|
0
|
56 |
// Macro to output identification information provided in a request to open a channel
|
|
57 |
#define PRM_US_OPEN_CHANNEL_START_TRACE \
|
|
58 |
{ \
|
199
|
59 |
Kern::Printf("PRM_US_OPEN_CHANNEL_START_TRACE");\
|
|
60 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_START, (TInt)(iClient), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
|
0
|
61 |
}
|
|
62 |
|
|
63 |
// Macro to output identification information generated during a request to open a channel
|
|
64 |
#define PRM_US_OPEN_CHANNEL_END_TRACE \
|
|
65 |
{ \
|
199
|
66 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_END, (TInt)(ClientHandle()), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
|
0
|
67 |
}
|
|
68 |
|
|
69 |
// Macro to output information provided for a request to register with the Resource Controller
|
|
70 |
#define PRM_US_REGISTER_CLIENT_START_TRACE \
|
|
71 |
{ \
|
199
|
72 |
TUint32 stateRes32 = ((stateRes[0]&0xFF) << 16) | ((stateRes[1]&0xFF) << 8) | ((stateRes[2]&0xFF));\
|
|
73 |
TBuf8<80> printBuf; \
|
0
|
74 |
printBuf.Zero(); \
|
199
|
75 |
APPEND_STRING(iUserNameUsed); \
|
|
76 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_REGISTER_CLIENT_START, (TInt)ClientHandle(), stateRes32, printBuf.Ptr(), printBuf.Length()); \
|
0
|
77 |
}
|
|
78 |
|
|
79 |
// Macro to output information after issuing a request to register with the Resource Controller
|
|
80 |
#define PRM_US_REGISTER_CLIENT_END_TRACE \
|
|
81 |
{ \
|
|
82 |
BTraceContext8(BTrace::EResourceManagerUs, PRM_US_REGISTER_CLIENT_END, (TInt)(ClientHandle()), r); \
|
|
83 |
}
|
|
84 |
|
|
85 |
// Macro to output information provided for a request to de-register with the Resource Controller
|
|
86 |
#define PRM_US_DEREGISTER_CLIENT_START_TRACE \
|
|
87 |
{ \
|
199
|
88 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_DEREGISTER_CLIENT_START, (TInt)(ClientHandle()), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
|
0
|
89 |
}
|
|
90 |
|
|
91 |
// Macro to output information after issuing a request to de-register with the Resource Controller
|
|
92 |
#define PRM_US_DEREGISTER_CLIENT_END_TRACE \
|
|
93 |
{ \
|
|
94 |
BTraceContext4(BTrace::EResourceManagerUs, PRM_US_DEREGISTER_CLIENT_END, (TInt)(ClientHandle())); \
|
|
95 |
}
|
|
96 |
|
|
97 |
// Macro to output information provided for a request to get the state of a resource
|
|
98 |
#define PRM_US_GET_RESOURCE_STATE_START_TRACE \
|
|
99 |
{ \
|
199
|
100 |
TBuf8<80> printBuf; \
|
|
101 |
printBuf.Zero(); \
|
|
102 |
APPEND_STRING(iUserNameUsed); \
|
0
|
103 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_GET_RESOURCE_STATE_START, resourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
|
|
104 |
}
|
|
105 |
|
|
106 |
// Macro to output information on completion of a request to get the state of a resource
|
|
107 |
#define PRM_US_GET_RESOURCE_STATE_END_TRACE \
|
|
108 |
{ \
|
199
|
109 |
TBuf8<80> printBuf; \
|
0
|
110 |
printBuf.Zero(); \
|
199
|
111 |
APPEND_VAL(aClient); \
|
|
112 |
APPEND_VAL(aResult); \
|
0
|
113 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_GET_RESOURCE_STATE_END, aResourceId, aLevel, printBuf.Ptr(), printBuf.Length()); \
|
|
114 |
}
|
|
115 |
|
|
116 |
// Macro to output information provided for a request to set the state of a resource
|
|
117 |
#define PRM_US_SET_RESOURCE_STATE_START_TRACE \
|
|
118 |
{ \
|
199
|
119 |
TBuf8<80> printBuf; \
|
0
|
120 |
printBuf.Zero(); \
|
199
|
121 |
TInt ch = ClientHandle(); \
|
|
122 |
APPEND_VAL(ch); \
|
|
123 |
APPEND_STRING(iUserNameUsed); \
|
0
|
124 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_SET_RESOURCE_STATE_START, resourceId, newState, printBuf.Ptr(), printBuf.Length()); \
|
|
125 |
}
|
|
126 |
|
|
127 |
// Macro to output information on completion of a request to set the state of a resource
|
|
128 |
#define PRM_US_SET_RESOURCE_STATE_END_TRACE \
|
|
129 |
{ \
|
199
|
130 |
TBuf8<80> printBuf; \
|
0
|
131 |
printBuf.Zero(); \
|
199
|
132 |
APPEND_VAL(aClient); \
|
|
133 |
APPEND_VAL(aResult); \
|
0
|
134 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_SET_RESOURCE_STATE_END, aResourceId, aLevel, printBuf.Ptr(), printBuf.Length()); \
|
|
135 |
}
|
|
136 |
|
|
137 |
// Macro to output information provided for a request to cancel the get resource state requests for a resource
|
|
138 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE \
|
|
139 |
{ \
|
199
|
140 |
TBuf8<80> printBuf; \
|
|
141 |
printBuf.Zero(); \
|
|
142 |
APPEND_STRING(iUserNameUsed); \
|
0
|
143 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_GET_RESOURCE_STATE_START, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
|
|
144 |
}
|
|
145 |
|
|
146 |
// Macro to output information on completion of a request to cancel the get resource state requests for a resource
|
|
147 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE \
|
|
148 |
{ \
|
199
|
149 |
TBuf8<80> printBuf; \
|
|
150 |
printBuf.Zero(); \
|
|
151 |
APPEND_STRING(iUserNameUsed); \
|
0
|
152 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_GET_RESOURCE_STATE_END, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
|
|
153 |
}
|
|
154 |
|
|
155 |
// Macro to output information provided for a request to cancel the set resource state requests for a resource
|
|
156 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE \
|
|
157 |
{ \
|
199
|
158 |
TBuf8<80> printBuf; \
|
|
159 |
printBuf.Zero(); \
|
|
160 |
APPEND_STRING(iUserNameUsed); \
|
0
|
161 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_SET_RESOURCE_STATE_START, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
|
|
162 |
}
|
|
163 |
|
|
164 |
// Macro to output information on completion of a request to cancel the get resource state requests for a resource
|
|
165 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE \
|
|
166 |
{ \
|
199
|
167 |
TBuf8<80> printBuf; \
|
|
168 |
printBuf.Zero(); \
|
|
169 |
APPEND_STRING(iUserNameUsed); \
|
0
|
170 |
BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_SET_RESOURCE_STATE_END, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
|
|
171 |
}
|
|
172 |
|
|
173 |
|
|
174 |
#else
|
|
175 |
|
|
176 |
#define PRM_US_OPEN_CHANNEL_START_TRACE
|
|
177 |
#define PRM_US_OPEN_CHANNEL_END_TRACE
|
|
178 |
#define PRM_US_REGISTER_CLIENT_START_TRACE
|
|
179 |
#define PRM_US_REGISTER_CLIENT_END_TRACE
|
|
180 |
#define PRM_US_DEREGISTER_CLIENT_START_TRACE
|
|
181 |
#define PRM_US_DEREGISTER_CLIENT_END_TRACE
|
|
182 |
#define PRM_US_GET_RESOURCE_STATE_START_TRACE
|
|
183 |
#define PRM_US_GET_RESOURCE_STATE_END_TRACE
|
|
184 |
#define PRM_US_SET_RESOURCE_STATE_START_TRACE
|
|
185 |
#define PRM_US_SET_RESOURCE_STATE_END_TRACE
|
|
186 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE
|
|
187 |
#define PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE
|
|
188 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE
|
|
189 |
#define PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE
|
|
190 |
|
|
191 |
#endif //BTRACE_RESMANUS
|
|
192 |
|
|
193 |
#endif //__RESMANUSCONTROL_TRACE_H__
|
|
194 |
|