First public contribution.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * ---------------TTraceContext-----------------------
28 Define the context of a trace packet by setting its attributes.
30 The module UID is defaulted according to the FW_DEFAULT_MODULEUID definition.
31 The HasThreadIdentification is defaulted to the FW_DEFAULT_HAS_THREAD_IDENTIFICATION definition.
32 The HasProgramCounter is defaulted to the FW_DEFAULT_HAS_PC definition.
34 @param aClassification @see TClassification
37 TTraceContext::TTraceContext(const TClassification aClassification)
38 :iModuleUid(FW_DEFAULT_MODULEUID), iClassification(aClassification), iHasThreadIdentification(FW_DEFAULT_HAS_THREAD_IDENTIFICATION), iHasProgramCounter(FW_DEFAULT_HAS_PC), iReserved1(0), iReserved2(0)
43 * Define the context of a trace packet by setting its attributes.
45 * The HasThreadIdentification is defaulted to the FW_DEFAULT_HAS_THREAD_IDENTIFICATION definition.
46 * The HasProgramCounter is defaulted to the FW_DEFAULT_HAS_PC definition.
48 * @param aModuleUid @see TModuleUid
49 * @param aClassification @see TClassification
51 TTraceContext::TTraceContext(const TModuleUid aModuleUid, const TClassification aClassification)
52 :iModuleUid(aModuleUid), iClassification(aClassification), iHasThreadIdentification(FW_DEFAULT_HAS_THREAD_IDENTIFICATION), iHasProgramCounter(FW_DEFAULT_HAS_PC), iReserved1(0), iReserved2(0)
57 * Define the context of a trace packet by setting its attributes.
59 * The module UID is defaulted according to the FW_DEFAULT_MODULEUID definition.
61 * @param aClassification @see TClassification
62 * @param aHasThreadIdentification Set whether to add thread identification automatically in the trace packet.
63 * @param aHasProgramCounter Set whether to add PC (program counter) automatically in the trace packet.
65 TTraceContext::TTraceContext(const TClassification aClassification, const THasThreadIdentification aHasThreadIdentification, const THasProgramCounter aHasProgramCounter)
66 :iModuleUid(FW_DEFAULT_MODULEUID), iClassification(aClassification), iHasThreadIdentification(aHasThreadIdentification), iHasProgramCounter(aHasProgramCounter), iReserved1(0), iReserved2(0)
72 * Define the context of a trace packet by setting its attributes.
74 * @param aModuleUid @see TModuleUid
75 * @param aClassification @see TClassification
76 * @param aHasThreadIdentification Set whether to add thread identification automatically in the trace packet.
77 * @param aHasProgramCounter Set whether to add PC (program counter) automatically in the trace packet.
79 TTraceContext::TTraceContext(const TModuleUid aModuleUid, const TClassification aClassification, const THasThreadIdentification aHasThreadIdentification, const THasProgramCounter aHasProgramCounter)
80 :iModuleUid(aModuleUid), iClassification(aClassification), iHasThreadIdentification(aHasThreadIdentification), iHasProgramCounter(aHasProgramCounter), iReserved1(0), iReserved2(0)
84 //------------------ Trace -----------------------
86 Outputs a trace packet containing variable length data.
88 If the specified data is too big to fit into a single
89 trace record a multipart trace is generated.
91 @param aContext Attributes of the trace point.
92 @param aFormatId A format identifier as specified by @see TFormatId
93 @param aData Additional data to add to trace packet.
94 Must be word aligned, i.e. a multiple of 4.
96 @return The trace packet was/was not logged.
98 @See BTrace::TMultipart
101 TBool Trace(const TTraceContext& aContext, TFormatId aFormatId, const T& aData)
103 return Trace(aContext, aFormatId, &aData, sizeof(aData));