0
|
1 |
// Copyright (c) 2008-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 |
/**
|
|
17 |
@file
|
|
18 |
@internalTechnology
|
|
19 |
@prototype
|
|
20 |
*/
|
|
21 |
|
|
22 |
#if !defined(__FTRACE_H__)
|
|
23 |
#define __FTRACE_H__
|
|
24 |
|
|
25 |
/**
|
|
26 |
@internalComponent
|
|
27 |
@prototype
|
|
28 |
*/
|
|
29 |
|
|
30 |
#if ((defined (_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UDEB)) || \
|
|
31 |
(!defined(_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UREL)))
|
134
|
32 |
#include "OstTraceDefinitions.h" // may or may not define OST_TRACE_COMPILER_IN_USE
|
|
33 |
#else
|
|
34 |
#undef OST_TRACE_COMPILER_IN_USE
|
|
35 |
#undef OST_TRACE_CATEGORY
|
|
36 |
#define OST_TRACE_CATEGORY OST_TRACE_CATEGORY_NONE
|
|
37 |
|
|
38 |
#undef OstTrace0
|
|
39 |
#undef OstTrace1
|
|
40 |
#undef OstTraceData
|
|
41 |
#undef OstTraceExt1
|
|
42 |
#undef OstTraceExt2
|
|
43 |
#undef OstTraceExt3
|
|
44 |
#undef OstTraceExt4
|
|
45 |
#undef OstTraceExt5
|
|
46 |
|
|
47 |
#define OstTrace0( aGroupName, aTraceName, aTraceText )
|
|
48 |
#define OstTrace1( aGroupName, aTraceName, aTraceText, aParam )
|
|
49 |
#define OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
|
|
50 |
#define OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam )
|
|
51 |
#define OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
|
|
52 |
#define OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
|
|
53 |
#define OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
|
|
54 |
#define OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
|
0
|
55 |
#endif
|
|
56 |
|
|
57 |
|
134
|
58 |
#if defined (OST_TRACE_COMPILER_IN_USE)
|
|
59 |
// This class is used to reconstruct an RMessage2 object from a message handle so that we can
|
|
60 |
// call RMessagePtr2::Client() and then RThread::Id() to retrieve the client's thread Id.
|
|
61 |
// This is useful for matching client requests to calls to the proxydrive
|
|
62 |
class RDummyMessage : public RMessage2
|
0
|
63 |
{
|
134
|
64 |
public:
|
|
65 |
inline RDummyMessage(TInt aHandle) {iHandle = aHandle; iFunction=-1;}
|
|
66 |
};
|
0
|
67 |
|
|
68 |
|
|
69 |
// This macro retrieves the client thread ID from a message, which is useful for
|
|
70 |
// associating server-side requests with client threads
|
|
71 |
#define TRACETHREADID(aMsg) \
|
|
72 |
RThread clientThread; \
|
|
73 |
TInt64 threadId = KLocalMessageHandle; \
|
|
74 |
if (aMsg.Handle()!=KLocalMessageHandle) \
|
|
75 |
{ \
|
|
76 |
if (aMsg.Client(clientThread) == KErrNone) \
|
|
77 |
{ \
|
|
78 |
threadId = clientThread.Id(); \
|
|
79 |
clientThread.Close(); \
|
|
80 |
} \
|
|
81 |
}
|
|
82 |
|
|
83 |
// This macro retrieves the client thread ID from a message handle
|
|
84 |
#define TRACETHREADIDH(aMsgHandle) \
|
|
85 |
RDummyMessage msg(aMsgHandle); \
|
|
86 |
TRACETHREADID(msg);
|
|
87 |
|
134
|
88 |
#else // #if defined (OST_TRACE_COMPILER_IN_USE)
|
0
|
89 |
|
|
90 |
#define TRACETHREADID(aMsg)
|
|
91 |
#define TRACETHREADIDH(aMsgHandle)
|
|
92 |
|
134
|
93 |
#endif // #if defined (OST_TRACE_COMPILER_IN_USE)
|
0
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
134
|
98 |
|
0
|
99 |
|
134
|
100 |
#endif // #if !defined(__FTRACE_H__)
|
|
101 |
|
|
102 |
|