symport/e32/include/e32btrace.h
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 2005-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 "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\include\e32btrace.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef E32BTRACE_H
       
    19 #define E32BTRACE_H
       
    20 
       
    21 #ifdef __KERNEL_MODE__
       
    22 class TSpinLock;
       
    23 #endif
       
    24 
       
    25 /**
       
    26 Class for handling fast tracing.
       
    27 
       
    28 A trace record consists of three parts: a header, header extensions,
       
    29 and the trace data itself.
       
    30 
       
    31 The header consists of four bytes containing:
       
    32 
       
    33 -#	Size of the record in bytes. (Maximum value is KMaxBTraceRecordSize.)
       
    34 -#	Flags. See enum TFlags.
       
    35 -#	Category. Category value from enum BTrace::TCategory.
       
    36 -#	Sub-category. The meaning of this is dependent on the value of Category.
       
    37 
       
    38 When trace records are stored in memory they are stored word (32 bit) aligned.
       
    39 Therefore the size must be rounded up to a multiple of four when calculating
       
    40 the address of the next record. E.g.
       
    41 @code
       
    42 	TUint8* record; // pointer to trace record
       
    43 	TInt size = record[BTrace::ESizeIndex];
       
    44 	record += (size+3)&~3; // move record pointer on to next record.
       
    45 @endcode
       
    46 The NextRecord() method is provided to do this operation.
       
    47 
       
    48 Following the header are optionally a number of 32 bit 'header extension' values.
       
    49 These are present in the order shown below but only exist if the appropriate flag bit
       
    50 is set in the Header.
       
    51 
       
    52 -#	Header2.		Contains flag values from enum Flags2.
       
    53 					This value is only present if the EHeader2Present flag is set.
       
    54 -#	Timestamp.		A timestamp value indicating when the trace was generated.
       
    55 					The format and resolution of this value are platform-dependent, but
       
    56 					typically will contain the same values as would be returned by
       
    57 					User::FastCounter() or NKern::FastCounter().
       
    58 					This value is only present if the ETimestampPresent flag is set.
       
    59 -#	Timestamp2.		Additional timestamp information. E.g. the most significant
       
    60 					half of a 64bit timestamp value. Note, it is valid for a Timestamp2 value
       
    61 					to be present even if the previous Timestamp is absent.
       
    62 					This value is only present if the ETimestamp2Present flag is set.
       
    63 -#	Context ID.		This value indicates the context in which the trace was generated.
       
    64 					The meaning of the id is dependent on the contents of the two
       
    65 					least significant bits:
       
    66 					-	00	indicates the value is the address of the NThread object for
       
    67 							the currently executing thread.
       
    68 					-	01	indicates Fast Interrupt (FIQ) context.
       
    69 							Other bits of the value are currently reserved for future use.
       
    70 					-	10	indicates Interrupt (IRQ) context. Other bits of the value
       
    71 							are currently reserved for future use.
       
    72 					-	11	indicates Immediate Delayed Function Call (IDFC) context.
       
    73 							Other bits of the value are currently reserved for future use.
       
    74 					.
       
    75 					This value is only present if the EContextIdPresent flag is set.
       
    76 -#	Program Counter. This is the memory address of the instruction after the location
       
    77 					the trace was output.
       
    78 					This value is only present if the EPcPresent flag is set.
       
    79 -#	Extra.			An extra value used for different purposes depending on the trace type.
       
    80 					This value is only present if the EExtraPresent flag is set.
       
    81 
       
    82 Following the header extensions are 0 or more bytes of trace data specified when the trace
       
    83 was output.
       
    84 
       
    85 To output a trace, the following macros can be used:
       
    86 - BTrace0
       
    87 - BTrace4
       
    88 - BTrace8
       
    89 - BTrace12
       
    90 - BTraceN
       
    91 - BTraceBig
       
    92 - BTracePc0
       
    93 - BTracePc4
       
    94 - BTracePc8
       
    95 - BTracePc12
       
    96 - BTracePcN
       
    97 - BTracePcBig
       
    98 - BTraceContext0
       
    99 - BTraceContext4
       
   100 - BTraceContext8
       
   101 - BTraceContext12
       
   102 - BTraceContextN
       
   103 - BTraceContextBig
       
   104 - BTraceContextPc0
       
   105 - BTraceContextPc4
       
   106 - BTraceContextPc8
       
   107 - BTraceContextPc12
       
   108 - BTraceContextPcN
       
   109 - BTraceContextPcBig
       
   110 
       
   111 Whenever a trace is output, the trace handler is called with the arguments specified.
       
   112 See typedef THandler and SetHandler().
       
   113 
       
   114 Each tracing category has a filter bit, which if set to zero means that traces in that category
       
   115 are discarded, see SetFilter(). This filtering is performed before the trace handler is
       
   116 called. This filter may also be initialised from boot time by using the 'btrace' keyword in
       
   117 an OBY file used to build a ROM image.
       
   118 
       
   119 Traces may also be additionally sent through a second level of filtering. This examines the
       
   120 first 32 bits of data in the trace and if this value isn't present in the list maintained
       
   121 in the secondary filter, the trace is discarded. The contents of the secondary filter are
       
   122 set using the SetFilter2 methods.
       
   123 
       
   124 Values used for secondary filtering must be Symbian Unique Identifiers (UIDs) allocated
       
   125 using the normal UID allocation process. Note, the following non-valid UID value ranges
       
   126 are reserved.
       
   127 - 0x00000000..0x007fffff	Reserved for platform specific use.
       
   128 - 0x00800000..0x00ffffff	Reserved for use by Symbian.
       
   129 
       
   130 To generate traces which are to be processed by the secondary filter, the following
       
   131 macros can be used:
       
   132 
       
   133 - BTraceFiltered4
       
   134 - BTraceFiltered8
       
   135 - BTraceFiltered12
       
   136 - BTraceFilteredN
       
   137 - BTraceFilteredBig
       
   138 - BTraceFilteredPc4
       
   139 - BTraceFilteredPc8
       
   140 - BTraceFilteredPc12
       
   141 - BTraceFilteredPcN
       
   142 - BTraceFilteredPcBig
       
   143 - BTraceFilteredContext4
       
   144 - BTraceFilteredContext8
       
   145 - BTraceFilteredContext12
       
   146 - BTraceFilteredContextN
       
   147 - BTraceFilteredContextBig
       
   148 - BTraceFilteredContextPc4
       
   149 - BTraceFilteredContextPc8
       
   150 - BTraceFilteredContextPc12
       
   151 - BTraceFilteredContextPcN
       
   152 - BTraceFilteredContextPcBig
       
   153 
       
   154 Traces generated using the above methods will be filtered twice; once using the primary
       
   155 filter which checks the trace's category, and once using the secondary filter which checks
       
   156 the 32 bit UID value at the start of the trace data. Therefore the trace must pass both filter
       
   157 checks for it to be sent to the trace handler for output.
       
   158 
       
   159 @publishedPartner
       
   160 @released
       
   161 */
       
   162 class BTrace
       
   163 	{
       
   164 public:
       
   165 	/**
       
   166 	Byte indices into the trace header for specific fields.
       
   167 	*/
       
   168 	enum THeaderStructure
       
   169 		{
       
   170 		/**
       
   171 		Size of record in bytes.
       
   172 		*/
       
   173 		ESizeIndex = 0,
       
   174 
       
   175 		/**
       
   176 		Bitfield of flags from enum TFlags. E.g. to detect if a timestamp is present in
       
   177 		the record, code like this could be used.
       
   178 		@code
       
   179 			TUint8* record; // pointer to trace record
       
   180 			if(record[BTrace::EFlagsIndex]&BTrace::ETimestampPresent)
       
   181 				TimestampPresent();
       
   182 			else
       
   183 				TimestampNotPresent();
       
   184 		@endcode
       
   185 		*/
       
   186 		EFlagsIndex = 1,
       
   187 
       
   188 		/**
       
   189 		Category value from enum BTrace::TCategory.
       
   190 		*/
       
   191 		ECategoryIndex = 2,
       
   192 
       
   193 		/**
       
   194 		Sub-category value. The meaning of this is dependent on the Category.
       
   195 		*/
       
   196 		ESubCategoryIndex = 3,
       
   197 		};
       
   198 
       
   199 	/**
       
   200 	Bit flags which indicate state of a trace record.
       
   201 	*/
       
   202 	enum TFlags
       
   203 		{
       
   204 		/**
       
   205 		Header2 is present in the trace record.
       
   206 		*/
       
   207 		EHeader2Present		= 1<<0,
       
   208 
       
   209 		/**
       
   210 		A timestamp value is present in the trace record.
       
   211 		*/
       
   212 		ETimestampPresent	= 1<<1,
       
   213 
       
   214 		/**
       
   215 		A second timestamp value is present in the trace record.
       
   216 		*/
       
   217 		ETimestamp2Present	= 1<<2,
       
   218 
       
   219 		/**
       
   220 		A context ID is present in the trace record.
       
   221 		*/
       
   222 		EContextIdPresent	= 1<<3,
       
   223 
       
   224 		/**
       
   225 		A CPU program counter (PC) value is present in the trace record.
       
   226 		*/
       
   227 		EPcPresent			= 1<<4,
       
   228 
       
   229 		/**
       
   230 		An 'extra' value is present in the trace record.
       
   231 		*/
       
   232 		EExtraPresent		= 1<<5,
       
   233 
       
   234 		/**
       
   235 		Indicates that the data in this trace record was truncated to keep the size
       
   236 		within the maximum permissible.
       
   237 		*/
       
   238 		ERecordTruncated	= 1<<6,
       
   239 
       
   240 		/**
       
   241 		Indicates that trace record(s) before this one are missing.
       
   242 		This can happen if the trace buffer was full when a trace output was attempted.
       
   243 		*/
       
   244 		EMissingRecord		= 1<<7
       
   245 		};
       
   246 
       
   247 	/**
       
   248 	Bit flags present in the Flags2 value of the header extension.
       
   249 	*/
       
   250 	enum TFlags2
       
   251 		{
       
   252 		/**
       
   253 		Masks out the bits for the multipart trace type. (See enum TMultiPart.)
       
   254 		*/
       
   255 		EMultipartFlagMask		= 3<<0,
       
   256 
       
   257 		/**
       
   258 		Masks out the bits for the CPU ID for SMP systems (zero if present on non SMP systems)
       
   259 		*/
       
   260 		ECpuIdMask			= 0xfff<<20,
       
   261 		};
       
   262 
       
   263 	/**
       
   264 	Values for multipart trace indicator. These values are stored in Flags2 an
       
   265 	are obtained by ANDing with the value EMultipartFlagMask.
       
   266 
       
   267 	If a 'Big' trace is generated which doesn't fit into a single trace record
       
   268 	then its data is split into several separate trace records; a multipart trace.
       
   269 
       
   270 	In multipart traces the 'extra' trace value is present in the header extension.
       
   271 	(EExtraPresent is set.) This extra value contains a unique trace identifier
       
   272 	which is the same is all parts of the trace.
       
   273 
       
   274 	The structure of the data part of each trace record in a multipart trace is described
       
   275 	below. In this description, the following labels are used.
       
   276 	-	A is the initial 4 bytes of data; the a1 argument of BTraceBig.
       
   277 	-	D is the array of bytes of additional data; the aData argument of BTraceBig.
       
   278 	-	N is the size of D; the aDataSize argument of BTraceBig
       
   279 	-	X is the maximum number of additional bytes which will fit into a trace record. 
       
   280 		This is usually KMaxBTraceDataArray but this should not be assumed, instead
       
   281 		the size and other information present in each trace record should be examined.
       
   282 
       
   283 	For the first part of a multipart trace, the data in a trace record has the following
       
   284 	structure:
       
   285 
       
   286 	-	4 bytes containing N.
       
   287 	-	4 bytes containing A.
       
   288 	-	X bytes containing D[0..X-1]
       
   289 
       
   290 	If the parts are numbered 0 through to 'j', then a middle part of a multipart trace
       
   291 	is numbered 'i' where 0<i<j. The data in these parts has the structure:
       
   292 
       
   293 	-	4 bytes containing N.
       
   294 	-	4 bytes containing X*i. I.e. the offset within D for the data in this trace record.
       
   295 	-	X bytes containing D[X*i..X*i+X-1]
       
   296 	
       
   297 	For the last part of a multipart trace, the data has the structure:
       
   298 
       
   299 	-	4 bytes containing N.
       
   300 	-	4 bytes containing X*j. I.e. the offset within D for the data in this trace record.
       
   301 	-	N modulo X bytes containing D[X*j..N-1]. I.e. the final bytes of the trace data.
       
   302 	*/
       
   303 	enum TMultiPart
       
   304 		{
       
   305 		/**
       
   306 		Indicates that this trace is the first part of a multipart trace.
       
   307 		*/
       
   308 		EMultipartFirst			= 1,
       
   309 
       
   310 		/**
       
   311 		Indicates that this trace is a middle part of a multipart trace.
       
   312 		I.e. it is not the first or last part.
       
   313 		*/
       
   314 		EMultipartMiddle		= 2,
       
   315 
       
   316 		/**
       
   317 		Indicates that this trace is the last part of a multipart trace.
       
   318 		*/
       
   319 		EMultipartLast			= 3,
       
   320 		};
       
   321 
       
   322 	/**
       
   323 	Enumeration of trace categories.
       
   324 	*/
       
   325 	enum TCategory
       
   326 		{
       
   327 		/**
       
   328 		Trace generated by all calls to RDebug::Printf.
       
   329 
       
   330 		The first 4 bytes of trace data contain the thread ID, RThread::Id(), for the
       
   331 		thread which caused this trace to be emitted. If the trace wasn't generated in
       
   332 		thread context, this id has the value KNullThreadId.
       
   333 		
       
   334 		Subsequent bytes of data contain the ASCII text for the formatted string
       
   335 		generated by Kern::Printf.
       
   336 
       
   337 		These traces also contain a context ID, i.e. the EContextIdPresent flag is
       
   338 		set and a context ID value is present in the extended header.
       
   339 
       
   340 		If the trace text doesn't fit completely into one trace record, then
       
   341 		a multipart trace is generated. See enum TMultiPart.
       
   342 		*/
       
   343 		ERDebugPrintf = 0,
       
   344 
       
   345 		/**
       
   346 		Trace generated by all calls to Kern::Printf.
       
   347 		Trace records in this category have the same structure as ERDebugPrintf.
       
   348 		*/
       
   349 		EKernPrintf = 1,
       
   350 
       
   351 		/**
       
   352 		Trace generated by platform security diagnostic messages.
       
   353 		Trace records in this category have the same structure as ERDebugPrintf.
       
   354 		*/
       
   355 		EPlatsecPrintf = 2,
       
   356 
       
   357 		/**
       
   358 		Trace generated for the purpose of associating thread context ids with
       
   359 		the textual names of threads. These traces are usually generated when a
       
   360 		thread is created, renamed or destroyed.
       
   361 
       
   362 		If #Prime is called with this category, traces will be generated for all
       
   363 		threads currently extant.
       
   364 
       
   365 		@see enum TThreadIdentification
       
   366 		*/
       
   367 		EThreadIdentification = 3,
       
   368 
       
   369 		/**
       
   370 		Trace generated when the CPU usage changes state, e.g. at thread context switch
       
   371 		or during interrupt and DFC processing.
       
   372 
       
   373 		The purpose of this trace category is to profile CPU usage.
       
   374 
       
   375 		@see enum TCpuUsage
       
   376 		*/
       
   377 		ECpuUsage = 4,
       
   378 
       
   379         /**
       
   380         Category used for profiling device drivers, kernel extensions etc.
       
   381         Used by PERF_LOG macro.
       
   382         @prototype 9.3
       
   383         */
       
   384         EKernPerfLog = 5,
       
   385 
       
   386         /**
       
   387 		@internalTechnology
       
   388         @prototype 9.3
       
   389         */
       
   390         EClientServer = 6,
       
   391 
       
   392         /**
       
   393 		@internalTechnology
       
   394         @prototype 9.3
       
   395         */
       
   396         ERequests = 7,
       
   397 
       
   398         /**
       
   399 		Trace generated when chunks are created and destroyed, and when memory
       
   400 		is committed and decommitted to and from chunks.
       
   401 		
       
   402 		If #Prime is called with this category, traces will be generated for all
       
   403 		chunks currently extant.
       
   404 
       
   405 		@see TChunks
       
   406         */
       
   407         EChunks = 8,
       
   408 
       
   409 
       
   410         /**
       
   411 		Trace generated when code segments are created and destroyed, mapped
       
   412 		into out of processes, and when memory is committed and decommitted to
       
   413 		and from them.
       
   414 		
       
   415 		If #Prime is called with this category, traces will be generated for all
       
   416 		code segments currently extant.
       
   417 
       
   418 		@see TCodeSegs
       
   419         */
       
   420         ECodeSegs = 9,
       
   421 
       
   422 		/**
       
   423 		Trace generated by Demand Paging.
       
   424 		@prototype 9.3
       
   425 		*/
       
   426 		EPaging = 10,
       
   427 
       
   428 		/**
       
   429 		Trace generated when thread and process priorities are modified, whether
       
   430 		directly or through priority inheritance, aging or other mechanisms used
       
   431 		by the kernel.
       
   432 
       
   433 		The purpose of this category is to enable system-wide study of thread
       
   434 		priority usage.
       
   435 
       
   436 		If #Prime is called with this category, traces will be generated for all
       
   437 		threads currently extant.
       
   438 
       
   439 		@see enum TThreadPriority
       
   440 		@internalTechnology
       
   441         @prototype 9.3
       
   442 		*/
       
   443 		EThreadPriority = 11,
       
   444 
       
   445 		/**
       
   446 		Trace generated by processing Paging requests in the Media subsystem and Media drivers.
       
   447 		@prototype 9.3
       
   448 		*/
       
   449 		EPagingMedia = 12,
       
   450 
       
   451 		/**
       
   452 		Trace generated by the kernel for memory regions which don't belong to any chunk.
       
   453 		@see enum TKernelMemory
       
   454 		@prototype 9.4
       
   455 		*/
       
   456 		EKernelMemory = 13,
       
   457 
       
   458 		/**
       
   459 		Trace generated by user-mode heap usage.
       
   460 
       
   461 		Unlike other trace categories, capturing heap trace involves an additional step 
       
   462 		depending on how much trace is required. To enable heap trace for a single process 
       
   463 		from the moment it starts, add the following line to the .exe's project (.mmp) file:
       
   464 
       
   465 			firstlib eexe_instrumented_heap.lib
       
   466 
       
   467 		This overrides the build tools default implicit link (for .exe projects) against eexe.lib.
       
   468 
       
   469 		Alternatively, to enable heap trace for all processes at once you can enable the 
       
   470 		KUSERHEAPTRACE bit (#96) of the kernel trace flags. You can set this flag either at 
       
   471 		ROM-building time (look for the 'kerneltrace' line generally in \epoc32\rom\<platform>\header.iby)
       
   472 		or at runtime by running the following at the Eshell command prompt:
       
   473 
       
   474 			trace 0 0 1
       
   475 
       
   476 		Note that changing this flag at runtime only affects processes created after the flag 
       
   477 		is set or unset. It will not affect running processes.
       
   478 		
       
   479 		@see enum THeap
       
   480 		@prototype 9.4
       
   481 		*/
       
   482 		EHeap = 14,
       
   483 
       
   484 		/**
       
   485 		Meta trace. Trace that is only useful to programs which use or display BTrace-based data.
       
   486 		@see enum TMetaTrace
       
   487 		@prototype 9.4
       
   488 		*/
       
   489 		EMetaTrace = 15,
       
   490 
       
   491 		/**
       
   492 		Trace generated by the ram allocator to allow the physical layout of RAM
       
   493 		to be tracked.
       
   494 		@internalTechnology
       
   495 		*/
       
   496 		ERamAllocator = 16,
       
   497 
       
   498 		/**
       
   499 		Trace generated by the Fast Mutex in the Nkern.
       
   500 		*/
       
   501 		EFastMutex = 17,
       
   502 		
       
   503 
       
   504 		/**
       
   505 		Trace generated by any sampling profiler. 
       
   506 		@see enum TProfiling
       
   507 		*/
       
   508 		EProfiling = 18,       
       
   509 		
       
   510 		/** 
       
   511         Trace generated by Power Resource Manager.
       
   512         @prototype 9.5
       
   513         */
       
   514         EResourceManager = 19,
       
   515 
       
   516 
       
   517         /** 
       
   518         Trace generated by Power Resource Manager User-Side API.
       
   519         @prototype 9.5
       
   520         */
       
   521         EResourceManagerUs = 20,
       
   522 		
       
   523 		/**
       
   524 		Trace generated by Raw Event subsystem APIs 
       
   525 		@see enum TRawEventTrace
       
   526 		@prototype 9.5
       
   527 		*/
       
   528 		ERawEvent  =21,
       
   529 		
       
   530 		/**
       
   531 		Trace generated by USB communications (Client, Host and OTG) where use
       
   532 		of standard logging (conditional Kern::Printf() calls) is sufficiently
       
   533 		time-consuming that the required device timings mandated by the core
       
   534 		USB standards cannot be achieved
       
   535         @prototype 9.5
       
   536 		*/
       
   537 		EUsb = 22,
       
   538 
       
   539 		/**
       
   540 		Trace generated by Symbian OS kernel synchronization objects.
       
   541         @prototype 9.5
       
   542 		*/
       
   543 		ESymbianKernelSync = 23,
       
   544 
       
   545 		/**
       
   546 		First category value in the range reserved for platform specific use;
       
   547 		the end of this range is #EPlatformSpecificLast.
       
   548 		Symbian's code will not generate any traces with categories in this range.
       
   549 
       
   550 		It is strongly recommended that platforms reserve the first half of this range
       
   551 		(128..143) for definition and use by base-port (kernel-side) code. Any general
       
   552 		trace framework built on top of BTrace APIs should use the second half of the range.
       
   553 		This allows fast (primary filtered only) BTrace categories to be used in device drivers
       
   554 		and other base-port code, without clashing with more general trace frameworks implemented
       
   555 		for application layer code. 
       
   556 		*/
       
   557 		EPlatformSpecificFirst = 128,
       
   558 
       
   559 		/**
       
   560 		Last category value in the range reserved for platform specific use.
       
   561 		@see EPlatformSpecificFirst
       
   562 		*/
       
   563 		EPlatformSpecificLast = 191,
       
   564 
       
   565 		/**
       
   566 		First category value in the range reserved for Symbian tools and future trace framework
       
   567 		implementations; the end of this range is #ESymbianExtentionsLast.
       
   568 		*/
       
   569 		ESymbianExtentionsFirst = 192,
       
   570 
       
   571 		/**
       
   572 		Last category value in the range reserved for Symbian tools and future trace framework
       
   573 		implementations.
       
   574 		@see ESymbianExtentionsFirst
       
   575 		*/
       
   576 		ESymbianExtentionsLast = 253,
       
   577 
       
   578 		/**
       
   579 		Used for testing purposes.
       
   580 
       
   581 		This may be used for ad-hoc testing purposes, e.g. special builds of components
       
   582 		with tracing enabled for diagnostic purposes.
       
   583 
       
   584 		This category is also used by the E32 BTrace unit tests.
       
   585 		@test
       
   586 		*/
       
   587 		ETest1 = 254,
       
   588 
       
   589 		/**
       
   590 		Used for testing purposes.
       
   591 
       
   592 		This may be used for ad-hoc testing purposes, e.g. special builds of components
       
   593 		with tracing enabled for diagnostic purposes.
       
   594 
       
   595 		This category is also used by the E32 BTrace unit tests.
       
   596 		@test
       
   597 		*/
       
   598 		ETest2 = 255
       
   599 		};
       
   600 
       
   601 	/**
       
   602 	Enumeration of sub-category values for trace category EThreadIdentification.
       
   603 	@see EThreadIdentification
       
   604 	*/
       
   605 	enum TThreadIdentification
       
   606 		{
       
   607 		/**
       
   608 		A nano-kernel thread (NThread) has been created.
       
   609 
       
   610 		Trace data format:
       
   611 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   612 		*/
       
   613 		ENanoThreadCreate,
       
   614 
       
   615 		/**
       
   616 		A nano-kernel thread (NThread) has been destroyed.
       
   617 
       
   618 		Trace data format:
       
   619 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   620 		*/
       
   621 		ENanoThreadDestroy,
       
   622 
       
   623 		/**
       
   624 		A thread (DThread) has been created.
       
   625 
       
   626 		Trace data format:
       
   627 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   628 		- 4 bytes containing trace id (a DProcess*) for the process to which this thread belongs.
       
   629 		- Remaining data is the ASCII name of the thread.
       
   630 		*/
       
   631 		EThreadCreate,
       
   632 
       
   633 		/**
       
   634 		A thread (DThread) has been destroyed.
       
   635 
       
   636 		Trace data format:
       
   637 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   638 		- 4 bytes containing trace id for the process to which this thread belongs.
       
   639 		- 4 bytes containing thread ID, as returned by RThread::Id().
       
   640 		*/
       
   641 		EThreadDestroy,
       
   642 
       
   643 		/**
       
   644 		A thread (DThread) has been renamed.
       
   645 		This trace may also be output by the tracing system at initialisation
       
   646 		in order to identify threads already in existence.
       
   647 
       
   648 		Trace data format:
       
   649 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   650 		- 4 bytes containing trace id (a DProcess*) for the process to which this thread belongs.
       
   651 		- Remaining data is the ASCII name of the thread.
       
   652 		*/
       
   653 		EThreadName,
       
   654 
       
   655 		/**
       
   656 		A process has been renamed.
       
   657 		This trace may also be output together with EThreadCreate or EThreadName traces
       
   658 		to help identify the name of the process to which the thread belongs.
       
   659 
       
   660 		Trace data format:
       
   661 		- 4 bytes containing zero, or if this trace is generated together with EThreadName
       
   662 		  or EThreadCreate, this contains the context id (an NThread*) for the thread.
       
   663 		- 4 bytes containing trace id (a DProcess*) for process.
       
   664 		- Remaining data is the ASCII name of the process.
       
   665 		*/
       
   666 		EProcessName,
       
   667 
       
   668 		/**
       
   669 		Informational trace giving a threads ID, as returned by RThread::Id().
       
   670 		Trace data format:
       
   671 		- 4 bytes containing the context id (an NThread*) for this thread.
       
   672 		- 4 bytes containing trace id (a DProcess*) for the process to which this thread belongs.
       
   673 		- 4 bytes containing thread ID, as returned by RThread::Id().
       
   674 		*/
       
   675 		EThreadId,
       
   676 
       
   677 		/**
       
   678 		A process has been created.
       
   679 
       
   680 		Trace data format:
       
   681 		- 4 bytes containing trace id (a DProcess*) for the process.
       
   682 		*/
       
   683 		EProcessCreate,
       
   684 
       
   685 		/**
       
   686 		A process has been destroyed.
       
   687 
       
   688 		Trace data format:
       
   689 		- 4 bytes containing trace id (a DProcess*) for the process.
       
   690 		*/
       
   691 		EProcessDestroy
       
   692 
       
   693 		};
       
   694 
       
   695 	/**
       
   696 	Enumeration of sub-category values for trace category ECpuUsage.
       
   697 	@see ECpuUsage
       
   698 	*/
       
   699 	enum TCpuUsage
       
   700 		{
       
   701 		/**
       
   702 		Trace output at start of Interrupt (IRQ) dispatch.
       
   703 
       
   704 		On platforms which support nested interrupts, traces for these will also
       
   705 		be nested.
       
   706 		*/
       
   707 		EIrqStart,
       
   708 
       
   709 		/**
       
   710 		Trace output at end of Interrupt (IRQ) dispatch.
       
   711 
       
   712 		Note, this trace isn't generated if an Interrupt Service Routine queues
       
   713 		a DFC or causes a thread to be scheduled. In these cases, the traces for
       
   714 		these events (EIDFCStart or ENewThreadContext) should be taken to indicate
       
   715 		that interrupt servicing has ended.
       
   716 		*/
       
   717 		EIrqEnd,
       
   718 
       
   719 		/**
       
   720 		Trace output at start of Fast Interrupt (FIQ) dispatch.
       
   721 
       
   722 		On platforms which support nested interrupts, traces for these will also
       
   723 		be nested.
       
   724 		*/
       
   725 		EFiqStart,
       
   726 
       
   727 		/**
       
   728 		Trace output at end of Fast Interrupt (FIQ) dispatch.
       
   729 
       
   730 		Note, this trace isn't generated if an Interrupt Service Routine queues
       
   731 		a DFC or causes a thread to be scheduled. In these cases, the traces for
       
   732 		these events (EIDFCStart or ENewThreadContext) should be taken to indicate
       
   733 		that interrupt servicing has ended.
       
   734 		*/
       
   735 		EFiqEnd,
       
   736 
       
   737 		/**
       
   738 		Trace output at start of Immediate Delayed Function Call (IDFC) processing.
       
   739 		This processing also includes moving DFCs to their final queue, so the trace
       
   740 		does not necessarily indicate that any IDFCs have been executed.
       
   741 		*/
       
   742 		EIDFCStart,
       
   743 
       
   744 		/**
       
   745 		Trace output at end of Immediate Delayed Function Call (IDFC) processing.
       
   746 		*/
       
   747 		EIDFCEnd,
       
   748 
       
   749 		/**
       
   750 		Trace output when a thread is scheduled to run.
       
   751 		The context id (NThread*) in this trace is that of the thread being scheduled.
       
   752 		*/
       
   753 		ENewThreadContext
       
   754 		};
       
   755 
       
   756     /**
       
   757 	@internalTechnology
       
   758     @prototype 9.3
       
   759     */
       
   760 	enum TClientServer
       
   761 		{
       
   762 		/**
       
   763 		Trace generated whenever a server is created.
       
   764 
       
   765 		Trace data format:
       
   766 		- 4 bytes containing the server id (a DServer*).
       
   767 		- 4 bytes containing undefined data
       
   768 		- Remaining data is the ASCII name of the server.
       
   769 
       
   770 		The context id (NThread*) in this trace is that of the thread creating the server.
       
   771 		*/
       
   772 		EServerCreate,
       
   773 
       
   774 		/**
       
   775 		Trace generated whenever a server is destroyed.
       
   776 
       
   777 		Trace data format:
       
   778 		- 4 bytes containing the server id (a DServer*).
       
   779 
       
   780 		*/
       
   781 		EServerDestroy,
       
   782 
       
   783 		/**
       
   784 		Trace generated whenever a new session is attached to a server.
       
   785 		I.e. a new session has been created.
       
   786 
       
   787 		Trace data format:
       
   788 		- 4 bytes containing the session id (a DSession*).
       
   789 		- 4 bytes containing the server id (a DServer*).
       
   790 
       
   791 		The context id (NThread*) in this trace is that of the thread creating the session.
       
   792 		*/
       
   793 		ESessionAttach,
       
   794 
       
   795 		/**
       
   796 		Trace generated whenever a server session is detached from a server.
       
   797 		I.e. a session has been closed.
       
   798 
       
   799 		Trace data format:
       
   800 		- 4 bytes containing the session id (a DSession*).
       
   801 		- 4 bytes containing the reasons (error code) for the session being closed.
       
   802 
       
   803 		*/
       
   804 		ESessionDetach,
       
   805 
       
   806 		/**
       
   807 		Trace generated whenever a new message is sent to a server.
       
   808 	
       
   809 		Trace data format:
       
   810 		- 4 bytes containing the message handle.
       
   811 		- 4 bytes containing the iFunction value for the message.
       
   812 		- 4 bytes containing the server id (a DServer*).
       
   813 
       
   814 		The context id (NThread*) in this trace is that of the thread which sent the message.
       
   815 		*/
       
   816 		EMessageSend,
       
   817 
       
   818 		/**
       
   819 		Trace generated when a server receives a new message.
       
   820 
       
   821 		Trace data format:
       
   822 		- 4 bytes containing the message handle.
       
   823 		*/
       
   824 		EMessageReceive,
       
   825 
       
   826 		/**
       
   827 		Trace generated whenever a message is completed using RMessagePtr2::Complete.
       
   828 
       
   829 		Trace data format:
       
   830 		- 4 bytes containing the message handle.
       
   831 		- 4 bytes containing the completion reason, or object handle, value.
       
   832 		    (The object handle value is that which is delivered to the sender of the
       
   833 			message, not that supplied by the server actually completing the request.)
       
   834 
       
   835 		The context id (NThread*) in this trace is that of the thread which completed the message.
       
   836 		*/
       
   837 		EMessageComplete
       
   838 		};
       
   839 
       
   840 
       
   841     /**
       
   842 	@internalTechnology
       
   843     @prototype 9.3
       
   844     */
       
   845 	enum TRequests
       
   846 		{
       
   847 		/**
       
   848 		Trace generated whenever a request status is completed.
       
   849 
       
   850 		Trace data format:
       
   851 		- 4 bytes containing the thread id (NThread*) of the thread being signalled.
       
   852 		- 4 bytes containing the address of the TRequestStatus object.
       
   853 		- 4 bytes containing the completion reason.
       
   854 
       
   855 		The context id (NThread*) in this trace is that of the thread which completed the request.
       
   856 		*/
       
   857 		ERequestComplete
       
   858 		};
       
   859 
       
   860 
       
   861 	/**
       
   862 	Enumeration of sub-category values for trace category EChunks.
       
   863 	@see EChunks
       
   864 	*/
       
   865 	enum TChunks
       
   866 		{
       
   867 		/**
       
   868 		Trace output when a chunk is created.
       
   869 		
       
   870 		Trace data format:
       
   871 		- 4 bytes containing the chunk id (a DChunk*).
       
   872 		- 4 bytes containing the maximum size of the chunk.
       
   873 		- The ASCII name of the chunk.
       
   874 		*/
       
   875 		EChunkCreated,
       
   876 
       
   877 		/**
       
   878 		@internalTechnology
       
   879 		
       
   880 		Trace output when a chunk is created containing extra chunk information.
       
   881 
       
   882 		Note that the meaning of the data in this trace is different between
       
   883 		memory models, and may change without warning.
       
   884 		
       
   885 		Trace data format:
       
   886 		- 4 bytes containing the chunk id (a DChunk*).
       
   887 		- 4 bytes containing the chunk type.
       
   888 		- 4 bytes containing the chunk's attributes.
       
   889 		*/
       
   890 		EChunkInfo,
       
   891 
       
   892 		/**
       
   893 		Trace output when a chunk is destroyed.
       
   894 		
       
   895 		Trace data format:
       
   896 		- 4 bytes containing the chunk id (a DChunk*)
       
   897 		*/
       
   898 		EChunkDestroyed,
       
   899 
       
   900 		/**
       
   901 		Trace output when memory is allocated and committed to a chunk.
       
   902 		
       
   903 		Trace data format:
       
   904 		- 4 bytes containing the chunk id (a DChunk*).
       
   905 		- 4 bytes containing the offset into the chunk.
       
   906 		- 4 bytes containing the size of the memory committed.
       
   907 		*/
       
   908 		EChunkMemoryAllocated,
       
   909 
       
   910 		/**
       
   911 		Trace output when memory is decommitted from a chunk and deallocated.
       
   912 		
       
   913 		Trace data format:
       
   914 		- 4 bytes containing the chunk id (a DChunk*).
       
   915 		- 4 bytes containing the offset into the chunk.
       
   916 		- 4 bytes containing the size of the memory decommitted.
       
   917 		*/
       
   918 		EChunkMemoryDeallocated,
       
   919 
       
   920 		/**
       
   921 		Trace output when un-owned memory is committed to a chunk.
       
   922 		
       
   923 		Trace data format:
       
   924 		- 4 bytes containing the chunk id (a DChunk*).
       
   925 		- 4 bytes containing the offset into the chunk.
       
   926 		- 4 bytes containing the size of the memory committed.
       
   927 		*/
       
   928 		EChunkMemoryAdded,
       
   929 
       
   930 		/**
       
   931 		Trace output when un-owned memory is decommitted to a chunk.
       
   932 		
       
   933 		Trace data format:
       
   934 		- 4 bytes containing the chunk id (a DChunk*).
       
   935 		- 4 bytes containing the offset into the chunk.
       
   936 		- 4 bytes containing the size of the memory decommitted.
       
   937 		*/
       
   938 		EChunkMemoryRemoved,
       
   939 
       
   940 		/**
       
   941 		Trace to indicate the owning process of a chunk - only for local (private) chunks.
       
   942 		
       
   943 		Trace data format:
       
   944 		- 4 bytes containing the chunk id (a DChunk*).
       
   945 		- 4 bytes containing the process id of the owner (a DProcess*).
       
   946 		*/
       
   947 		EChunkOwner
       
   948 		};
       
   949 
       
   950 	/**
       
   951 	Enumeration of sub-category values for trace category ECodeSegs.
       
   952 	@see ECodeSegs
       
   953 	*/
       
   954 	enum TCodeSegs
       
   955 		{
       
   956 		/**
       
   957 		Trace output when a code segment is created to associate a code segment
       
   958 		id with a filename.
       
   959 		
       
   960 		Trace data format:
       
   961 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
   962 		- The ASCII filename.
       
   963 		*/
       
   964 		ECodeSegCreated,
       
   965 
       
   966 		/**
       
   967 		Trace output when a code segment is created.
       
   968 		
       
   969 		Trace data format:
       
   970 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
   971 		- 4 bytes containing the attributes.
       
   972 		- 4 bytes containing the code base address (.text).
       
   973 		- 4 bytes containing the size of the code section (.text).
       
   974 		- 4 bytes containing the base address of the constant data section (.rodata).
       
   975 		- 4 bytes containing the size of the constant data section (.rodata).
       
   976 		- 4 bytes containing the base address of the initialised data section (.data).
       
   977 		- 4 bytes containing the size of the initialised data section (.data).
       
   978 		- 4 bytes containing the base address of the uninitialised data section (.bss).
       
   979 		- 4 bytes containing the size of the uninitialised data section (.bss).
       
   980 		*/
       
   981 		ECodeSegInfo,
       
   982 		
       
   983 		/**
       
   984 		Trace output when a code segment is destroyed.
       
   985 		
       
   986 		Trace data format:
       
   987 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
   988 		*/
       
   989 		ECodeSegDestroyed,
       
   990 
       
   991 		/**
       
   992 		Trace output when a code segment is mapped into a process.
       
   993 		
       
   994 		Trace data format:
       
   995 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
   996 		- 4 bytes containing the process id (a DProcess*).
       
   997 		*/
       
   998 		ECodeSegMapped,
       
   999 
       
  1000 		/**
       
  1001 		Trace output when a code segment is unmapped from a process.
       
  1002 		
       
  1003 		Trace data format:
       
  1004 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
  1005 		- 4 bytes containing the process id (a DProcess*).
       
  1006 		*/
       
  1007 		ECodeSegUnmapped,
       
  1008 		
       
  1009 		/**
       
  1010 		Trace output when memory is allocated to a code segment.
       
  1011 
       
  1012 		Under the multiple memory model, code segments for RAM-loaded user code
       
  1013 		own the RAM pages the code occupies.  The pages are not owned by any
       
  1014 		chunk, but are mapped into the code chunk of each process that uses the
       
  1015 		code segment.
       
  1016 		
       
  1017 		Trace data format:
       
  1018 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
  1019 		- 4 bytes containing the size of the memory allocated.
       
  1020 		*/
       
  1021 		ECodeSegMemoryAllocated,
       
  1022 		
       
  1023 		/**
       
  1024 		Trace output when memory is deallocated from a code segment.
       
  1025 
       
  1026 		Under the multiple memory model, code segments for RAM-loaded user code
       
  1027 		own the RAM pages the code occupies.  The pages are not owned by any
       
  1028 		chunk, but are mapped into the code chunk of each process that uses the
       
  1029 		code segment.
       
  1030 		
       
  1031 		Trace data format:
       
  1032 		- 4 bytes containing the code segment id (a DCodeSeg*).
       
  1033 		- 4 bytes containing the size of the memory deallocated.
       
  1034 		*/
       
  1035 		ECodeSegMemoryDeallocated
       
  1036 		};
       
  1037 
       
  1038 	
       
  1039 	/**
       
  1040 	Enumeration of sub-category values for trace category EPaging.
       
  1041 	@see EPaging
       
  1042 	*/
       
  1043 	enum TPaging
       
  1044 		{
       
  1045 		/**
       
  1046 		This event indicates the beginning of the 'page in' activity.
       
  1047 		The end of this activity is indicated by one of the following events:
       
  1048 		- EPagingPageInUnneeded
       
  1049 		- EPagingPageInROM
       
  1050 		- EPagingPageInCode
       
  1051 		
       
  1052 		Trace data format:
       
  1053 		- 4 bytes containing the virtual address which was accessed, causing this paging event.
       
  1054 		- 4 bytes containing the virtual address of the instruction which caused this paging event.
       
  1055 		  (The PC value.)
       
  1056 
       
  1057 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1058 		*/
       
  1059 		EPagingPageInBegin,
       
  1060 
       
  1061 		/**
       
  1062 		Event which terminates the 'page in' activity when the required page was found to
       
  1063 		already be paged in. (See EPagingPageInBegin.)
       
  1064 
       
  1065 		Trace data format:
       
  1066 		- 0 bytes. (No extra data.)
       
  1067 
       
  1068 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1069 		*/
       
  1070 		EPagingPageInUnneeded,
       
  1071 
       
  1072 		/**
       
  1073 		A ROM page has been paged in.
       
  1074 		This event indicates the end of the 'page in' activity. (See EPagingPageInBegin.)
       
  1075 
       
  1076 		Trace data format:
       
  1077 		- 4 bytes containing the physical address of the page 'paged in'.
       
  1078 		- 4 bytes containing the virtual address of the page 'paged in'.
       
  1079 
       
  1080 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1081 		*/
       
  1082 		EPagingPageInROM,
       
  1083 
       
  1084 		/**
       
  1085 		A ROM page has been 'paged out'. I.e. removed from the live list to be either
       
  1086 		reused or returned to free pool.
       
  1087 
       
  1088 		Trace data format:
       
  1089 		- 4 bytes containing the physical address of the page being 'paged out'.
       
  1090 		- 4 bytes containing the virtual address of the page being 'paged out'.
       
  1091 
       
  1092 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1093 		*/
       
  1094 		EPagingPageOutROM,
       
  1095 
       
  1096 		/**
       
  1097 		A Free page has been 'paged in'. I.e. added to the live list.
       
  1098 
       
  1099 		Trace data format:
       
  1100 		- 4 bytes containing the physical address of the page being 'paged in'.
       
  1101 
       
  1102 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1103 		*/
       
  1104 		EPagingPageInFree,
       
  1105 
       
  1106 		/**
       
  1107 		A Free page has been 'paged out'. I.e. removed from the live list to be either
       
  1108 		reused or returned to free pool.
       
  1109 
       
  1110 		Trace data format:
       
  1111 		- 4 bytes containing the physical address of the page being 'paged out'.
       
  1112 
       
  1113 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1114 		*/
       
  1115 		EPagingPageOutFree,
       
  1116 
       
  1117 		/**
       
  1118 		A page has been made 'young' again because it was accessed.
       
  1119 
       
  1120 		Trace data format:
       
  1121 		- 4 bytes containing the physical address of the page being rejuvenated, (made young).
       
  1122 		- 4 bytes containing the virtual address which was accessed, causing this paging event.
       
  1123 		- 4 bytes containing the virtual address of the instruction which caused this paging event.
       
  1124 		  (The PC value.)
       
  1125 
       
  1126 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1127 		*/
       
  1128 		EPagingRejuvenate,
       
  1129 
       
  1130 		/**
       
  1131 		A page fault was found to have already been previously serviced.
       
  1132 
       
  1133 		Trace data format:
       
  1134 		- 4 bytes containing the physical address of the page accessed.
       
  1135 		- 4 bytes containing the virtual address which was accessed, causing this paging event.
       
  1136 		- 4 bytes containing the virtual address of the instruction which caused this paging event.
       
  1137 		  (The PC value.)
       
  1138 
       
  1139 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1140 		*/
       
  1141 		EPagingPageNop,
       
  1142 
       
  1143 		/**
       
  1144 		A page has been locked.
       
  1145 
       
  1146 		Trace data format:
       
  1147 		- 4 bytes containing the physical address of the page being locked.
       
  1148 		- 4 bytes containing the value of the lock count after the paged was locked.
       
  1149 
       
  1150 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1151 		*/
       
  1152 		EPagingPageLock,
       
  1153 
       
  1154 		/**
       
  1155 		A page has been unlocked.
       
  1156 
       
  1157 		Trace data format:
       
  1158 		- 4 bytes containing the physical address of the page being unlocked.
       
  1159 		- 4 bytes containing the value of the lock count before the paged was unlocked.
       
  1160 
       
  1161 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1162 		*/
       
  1163 		EPagingPageUnlock,
       
  1164 		
       
  1165 		/**
       
  1166 		A page containing RAM cache has been 'paged out'. I.e. removed from the live list to be
       
  1167 		either reused or returned to free pool.
       
  1168 
       
  1169 		Trace data format:
       
  1170 		- 4 bytes containing the physical address of the page being 'paged out'.
       
  1171 		- 4 bytes containing the virtual address of the page being 'paged out'.
       
  1172 
       
  1173 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1174 		*/
       
  1175 		EPagingPageOutCache,
       
  1176 		
       
  1177 		/**
       
  1178 		A page containing RAM-loaded code has been paged in.
       
  1179 		This event indicates the end of the 'page in' activity. (See EPagingPageInBegin.)
       
  1180 
       
  1181 		Trace data format:
       
  1182 		- 4 bytes containing the physical address of the page 'paged in'.
       
  1183 		- 4 bytes containing the virtual address of the page 'paged in'.
       
  1184 
       
  1185 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1186 		*/
       
  1187 		EPagingPageInCode,
       
  1188 
       
  1189 		/**
       
  1190 		A page containing RAM-loaded code has been 'paged out'. I.e. removed from the live list to be
       
  1191 		either reused or returned to free pool.
       
  1192 
       
  1193 		Trace data format:
       
  1194 		- 4 bytes containing the physical address of the page being 'paged out'.
       
  1195 		- 4 bytes containing the virtual address of the page being 'paged out'.
       
  1196 
       
  1197 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1198 		*/
       
  1199 		EPagingPageOutCode,
       
  1200 		
       
  1201 		/**
       
  1202 		A page of RAM-loaded code was found to already be 'paged in' but not mapped in
       
  1203 		the faulting process.
       
  1204 		This event is only emitted on the multiple memory model.
       
  1205 
       
  1206 		Trace data format:
       
  1207 		- 4 bytes containing the physical address of the page 'paged in'.
       
  1208 		- 4 bytes containing the virtual address which was accessed, causing this paging event.
       
  1209 
       
  1210 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1211 		*/
       
  1212 		EPagingMapCode,
       
  1213 
       
  1214 		/**
       
  1215 		A page has been made 'old' because it was the last young page to be accessed.
       
  1216 
       
  1217 		This trace is only produced when the kernel is compiled with the #BTRACE_PAGING_VERBOSE
       
  1218 		macro defined.
       
  1219 
       
  1220 		Trace data format:
       
  1221 		- 4 bytes containing the physical address of the page being aged, (made old).
       
  1222 
       
  1223 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1224 		*/
       
  1225 		EPagingAged,
       
  1226 
       
  1227 		/**
       
  1228 		Trace emitted at the start of decompression of demand paged data.
       
  1229 
       
  1230 		This trace is only produced when the kernel is compiled with the #BTRACE_PAGING_VERBOSE
       
  1231 		macro defined.
       
  1232 
       
  1233 		Trace data format:
       
  1234 		- 4 bytes containing an integer which indicates the compression type being used:
       
  1235 			  0, no compression;
       
  1236 			  1, bytepair compression.
       
  1237 
       
  1238 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1239 		*/
       
  1240 		EPagingDecompressStart,
       
  1241 
       
  1242 		/**
       
  1243 		Trace emitted at the end of decompression of demand paged data.
       
  1244 
       
  1245 		This trace is only produced when the kernel is compiled with the #BTRACE_PAGING_VERBOSE
       
  1246 		macro defined.
       
  1247 
       
  1248 		The context id (NThread*) in this trace is that of the thread caused this paging event.
       
  1249 		*/
       
  1250 		EPagingDecompressEnd,
       
  1251 		};
       
  1252     
       
  1253     /**
       
  1254 	Enumeration of sub-category values for trace category EResourceManager.
       
  1255 	@see EResourceManager
       
  1256     @prototype 9.5
       
  1257 	*/
       
  1258 	enum TResourceManager
       
  1259 		{
       
  1260 		/**
       
  1261 		Trace output for resource registration.
       
  1262 		
       
  1263 		Trace data format:
       
  1264 		- 4 bytes containing the Resource Id.
       
  1265 		- 4 bytes containing the Resource address.
       
  1266 		- N bytes containing the Resource name, where 0 < N < 32
       
  1267 		- 4 bytes containing the Resource Minimum Level
       
  1268 		- 4 bytes containing the Resource Maximum Level
       
  1269 		- 4 bytes containing the Resource Default Level
       
  1270 		*/
       
  1271 		ERegisterResource = 0,
       
  1272 
       
  1273 		/**
       
  1274 		Trace output for client registration
       
  1275 
       
  1276 		Trace data format:
       
  1277 		- 4 bytes containing clientId
       
  1278 		- 4 bytes containing client address
       
  1279 		- N bytes containing client name, where 0 < N < 32
       
  1280 		*/
       
  1281 		ERegisterClient,
       
  1282 
       
  1283 		/**
       
  1284 		Trace output for client deregistration
       
  1285 
       
  1286 		Trace data format:
       
  1287 		- 4 bytes containing clientId
       
  1288 		- 4 bytes containing client address
       
  1289 		- N bytes containing client name, where 0 < N < 32
       
  1290 		*/
       
  1291 		EDeRegisterClient,
       
  1292 
       
  1293 		/**
       
  1294 		Trace output for resource state change start operation
       
  1295 
       
  1296 		Trace data format:
       
  1297 		- 4 bytes containing clientId
       
  1298 		- 4 bytes containing the Resource Id.
       
  1299 		- N bytes containing client name, where 0 < N < 32
       
  1300 		- N bytes containing the Resource name, where 0 < N < 32
       
  1301 		- 4 bytes containing the Resource state
       
  1302 		*/
       
  1303 		ESetResourceStateStart,
       
  1304 
       
  1305 		/**
       
  1306 		Trace output for resource state change end operation
       
  1307 
       
  1308 		Trace data format:
       
  1309 		- 4 bytes containing clientId
       
  1310 		- 4 bytes containing the Resource Id.
       
  1311 		- N bytes containing client name, where 0 < N < 32
       
  1312 		- N bytes containing the Resource name, where 0 < N < 32
       
  1313 		- 4 bytes containing return value.
       
  1314 		- 4 bytes containing the Resource state.
       
  1315 		*/
       
  1316 		ESetResourceStateEnd,
       
  1317 
       
  1318 		/**
       
  1319 		Trace output for registration for post notification
       
  1320 
       
  1321 		Trace data format:
       
  1322 		- 4 bytes containing clientId
       
  1323 		- 4 bytes containing the Resource Id.
       
  1324 		- 4 bytest containing the callback address
       
  1325 		- 4 bytes containing return value.
       
  1326 		*/
       
  1327 		EPostNotificationRegister,
       
  1328 
       
  1329 		/**
       
  1330 		Trace output for deregistration for post notification
       
  1331 
       
  1332 		Trace data format:
       
  1333 		- 4 bytes containing clientId
       
  1334 		- 4 bytes containing the Resource Id.
       
  1335 		- 4 bytes containing the callback address
       
  1336 		- 4 bytes containing the return value.
       
  1337 		*/
       
  1338 		EPostNotificationDeRegister,
       
  1339 
       
  1340 		/**
       
  1341 		Trace output for post notification sent.
       
  1342 
       
  1343 		Trace data format:
       
  1344 		- 4 bytes containing clientId
       
  1345 		- 4 bytes containing the Resource Id.
       
  1346 		*/
       
  1347 		EPostNotificationSent,
       
  1348 
       
  1349 		/**
       
  1350 		Trace output for Callback complete
       
  1351 
       
  1352 		Trace data format:
       
  1353 		- 4 bytes containing clientId
       
  1354 		- 4 bytes containing the Resource Id.
       
  1355 		*/
       
  1356 		ECallbackComplete,
       
  1357 
       
  1358 		/**
       
  1359 		Trace output for resource manager memory usage
       
  1360 
       
  1361 		Trace data format:
       
  1362 		- 4 bytes containing memory allocated in bytes.
       
  1363 		*/
       
  1364 		EMemoryUsage,
       
  1365 
       
  1366 		/**
       
  1367 		Trace output for get resource state start operation
       
  1368 
       
  1369 		Trace data format:
       
  1370 		- 4 bytes containing clientId
       
  1371 		- 4 bytes containing the Resource Id.
       
  1372 		- N bytes containing client name, where 0 < N < 32
       
  1373 		- N bytes containing the Resource name, where 0 < N < 32
       
  1374 		*/
       
  1375 		EGetResourceStateStart,
       
  1376 
       
  1377 		/**
       
  1378 		Trace output for get resource state end operation
       
  1379 
       
  1380 		Trace data format:
       
  1381 		- 4 bytes containing clientId
       
  1382 		- 4 bytes containing the Resource Id.
       
  1383 		- N bytes containing client name, where 0 < N < 32
       
  1384 		- N bytes containing the Resource name, where 0 < N < 32
       
  1385 		- 4 bytes containing the Resource state
       
  1386 		- 4 bytes containing return value.
       
  1387 		*/
       
  1388 		EGetResourceStateEnd,
       
  1389 
       
  1390 		/**
       
  1391 		Trace output for cancellation of long latency operation
       
  1392 
       
  1393 		Trace data format:
       
  1394 		- 4 bytes containing clientId
       
  1395 		- 4 bytes containing the Resource Id.
       
  1396 		- N bytes containing client name, where 0 < N < 32
       
  1397 		- N bytes containing the Resource name, where 0 < N < 32
       
  1398 		- 4 bytes containing return value
       
  1399 		*/
       
  1400 		ECancelLongLatencyOperation,
       
  1401 
       
  1402 		/**
       
  1403 		Trace output for booting of resource manager
       
  1404 
       
  1405 		Trace data format:
       
  1406 		- 4 bytes containing entry point
       
  1407 		*/
       
  1408 		EBooting,
       
  1409 
       
  1410 		/**
       
  1411 		Trace output for PSL resource state change operation
       
  1412 
       
  1413 		Trace data format:
       
  1414 		- 4 bytes containing clientId
       
  1415 		- 4 bytes containing the Resource Id.
       
  1416 		- N bytes containing the Resource name, where 0 < N < 32
       
  1417 		- 4 bytes containing the Resource current state
       
  1418 		- 4 bytes containing the resource requested state
       
  1419 		*/
       
  1420 		EPslChangeResourceStateStart,
       
  1421 
       
  1422 		/**
       
  1423 		Trace output for PSL resource state change operation
       
  1424 
       
  1425 		Trace data format:
       
  1426 		- 4 bytes containing clientId
       
  1427 		- 4 bytes containing the Resource Id.
       
  1428 		- N bytes containing the Resource name, where 0 < N < 32
       
  1429 		- 4 bytes containing the Resource current state
       
  1430 		- 4 bytes containing the resource requested state
       
  1431 		- 4 bytes containing return value
       
  1432 		*/
       
  1433 		EPslChangeResourceStateEnd,
       
  1434 
       
  1435 		/**
       
  1436 		Trace output for get resource state start operation in PSL
       
  1437 
       
  1438 		Trace data format:
       
  1439 		- 4 bytes containing clientId
       
  1440 		- 4 bytes containing the Resource Id.
       
  1441 		- N bytes containing the Resource name, where 0 < N < 32
       
  1442 		*/
       
  1443 		EPslGetResourceStateStart,
       
  1444 
       
  1445 		/**
       
  1446 		Trace output for get resource state end operation in PSL
       
  1447 
       
  1448 		Trace data format:
       
  1449 		- 4 bytes containing clientId
       
  1450 		- 4 bytes containing the Resource Id.
       
  1451 		- N bytes containing the Resource name, where 0 < N < 32
       
  1452 		- 4 bytes containing the Resource state
       
  1453 		- 4 bytes containing return value.
       
  1454 		*/
       
  1455 		EPslGetResourceStateEnd,
       
  1456 
       
  1457 		/**		
       
  1458 		Trace output for resource creation
       
  1459 		
       
  1460 		Trace data format:
       
  1461 		- 4 bytes containing minimum value of resource
       
  1462 		- 4 bytes containing maximum value of resource
       
  1463 		- 4 bytes containing the default value of resource
       
  1464 		- 4 bytes containing the properties of the resource
       
  1465 		- N bytes containing the Resource name, where 0 < N < 32
       
  1466 		*/
       
  1467 		EPslResourceCreate,
       
  1468 		
       
  1469 		/** 
       
  1470 		Trace output for static resource with dependency registration
       
  1471 
       
  1472 		Trace data format:
       
  1473 		- 4 bytes containing the Resource Id
       
  1474 		- 4 bytes containing the Resource address
       
  1475 		- N bytes containing the Resource name, where 0 < N < 32
       
  1476 		- 4 bytes containing the minimum value of resource
       
  1477 		- 4 bytes containing the maximum value of resource
       
  1478 		- 4 bytes containing the default value of resource
       
  1479 		*/
       
  1480 		ERegisterStaticResourceWithDependency,
       
  1481 
       
  1482 		/** 
       
  1483 		Trace output for dynamic resource registration
       
  1484 
       
  1485 		Trace data format:
       
  1486 		- 4 bytes containing clientId
       
  1487 		- 4 bytes containing the Resource Id
       
  1488 		- N bytes containing the client name, where 0 < N < 32
       
  1489 		- N bytes containing the resource name, where 0 < N < 32
       
  1490 		- 4 bytes containing the resouce address
       
  1491 		*/
       
  1492 		ERegisterDynamicResource,
       
  1493 
       
  1494 		/** 
       
  1495 		Trace output for dynamic resource deregistration
       
  1496 
       
  1497 		Trace data format:
       
  1498 		- 4 bytes containing clientId
       
  1499 		- 4 bytes containing the Resource Id
       
  1500 		- N bytes containing the client name, where 0 < N < 32
       
  1501 		- N bytes containing the resource name, where 0 < N < 32
       
  1502 		- 4 bytes containing the resource address
       
  1503 		- 4 bytes containing the resource level.
       
  1504 		*/
       
  1505 		EDeRegisterDynamicResource,
       
  1506 
       
  1507 		/**
       
  1508 		Trace output for resource dependency registration
       
  1509 	
       
  1510 		Trace data format:
       
  1511 		- 4 bytes containing clientId
       
  1512 		- 4 bytes containing the Resource Id of first dependent resource
       
  1513 		- N bytes containing the client name, where 0 < N < 32
       
  1514 		- N bytes containing the resource name of first dependent resource, where 0 < N < 32
       
  1515 		- 4 bytes containing the Resource Id of second dependent resource
       
  1516 		- N bytes containing the resource name of second dependent resource, where 0 < N < 32
       
  1517 		- 4 bytes containing the address of first dependent resource
       
  1518 		- 4 bytes containing the address of second dependent resource
       
  1519 		*/
       
  1520 		ERegisterResourceDependency,
       
  1521 		
       
  1522 		/**
       
  1523 		Trace output for resource dependency deregistration
       
  1524 
       
  1525 		Trace data format:
       
  1526 		- 4 bytes containing clientId
       
  1527 		- 4 bytes containing the Resource Id of first dependent resource
       
  1528 		- N bytes containing the client name, where 0 < N < 32
       
  1529 		- N bytes containing the resource name of first dependent resource, where 0 < N < 32
       
  1530 		- 4 bytes containing the resource id of second dependent resource
       
  1531 		- N bytes containing the resource name of second dependent resource, where 0 < N < 32
       
  1532 		- 4 bytes containing the address of first dependent resource
       
  1533 		- 4 bytes containing the address of second dependent resource
       
  1534 		*/
       
  1535 		EDeRegisterResourceDependency
       
  1536 		};
       
  1537     /**
       
  1538 	Enumeration of sub-category values for trace category EResourceManagerUs.
       
  1539 	@see EResourceManagerUs
       
  1540     @prototype 9.5
       
  1541 	*/
       
  1542 	enum TResourceManagerUs
       
  1543 		{
       
  1544 		/**
       
  1545 		Trace output for the start of opening a channel to the Resource Controller.
       
  1546 		
       
  1547 		Trace data format:
       
  1548 		- 4 bytes unused (displays 0)
       
  1549 		- 4 bytes containing the client thread identifier.
       
  1550 		- N bytes containing the client name, where 0 < N < 32
       
  1551 		*/
       
  1552 		EOpenChannelUsStart = 0,
       
  1553 		/**
       
  1554 		Trace output for the end of opening a channel to the Resource Controller.
       
  1555 		
       
  1556 		Trace data format:
       
  1557 		- 4 bytes unused (displays 0)
       
  1558 		- 4 bytes containing the client identifier provided by the Resource Controller
       
  1559 		- N bytes containing the client name, where 0 < N < 32
       
  1560 		*/
       
  1561 		EOpenChannelUsEnd,
       
  1562 		/**
       
  1563 		Trace output for the start of registering a client with the Resource Controller.
       
  1564 		
       
  1565 		Trace data format:
       
  1566 		- 4 bytes the number of concurrent change resource state operations to be supported
       
  1567 		- 4 bytes the number of concurrent notification requests to be supported
       
  1568 		- N bytes containing the client name, where 0 < N < 32
       
  1569 		- 4 bytes the number of concurrent get resource state operations to be supported
       
  1570 		*/
       
  1571 		ERegisterClientUsStart,
       
  1572 		/**
       
  1573 		Trace output for the end of registering a client with the Resource Controller.
       
  1574 		
       
  1575 		Trace data format:
       
  1576 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1577 		- 4 bytes specifying the value returned from the call to Resource Controller's AllocReserve method
       
  1578 		*/
       
  1579 		ERegisterClientUsEnd,
       
  1580 		/**
       
  1581 		Trace output for the start of de-registering a client with the Resource Controller.
       
  1582 		
       
  1583 		Trace data format:
       
  1584 		- 4 bytes unused (displays 0)
       
  1585 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1586 		- N bytes containing the client name, where 0 < N < 32
       
  1587 		*/
       
  1588 		EDeRegisterClientUsStart,
       
  1589 		/**
       
  1590 		Trace output for the end of registering a client with the Resource Controller.
       
  1591 		
       
  1592 		Trace data format:
       
  1593 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1594 		*/
       
  1595 		EDeRegisterClientUsEnd,
       
  1596 		/**
       
  1597 		Trace output for the start of a GetResourceState request to the Resource Controller.
       
  1598 		
       
  1599 		Trace data format:
       
  1600 		- 4 bytes specifying the resource ID
       
  1601 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1602 		- N bytes containing the client name, where 0 < N < 32
       
  1603 		*/
       
  1604 		EGetResourceStateUsStart,
       
  1605 		/**
       
  1606 		Trace output for the end of a GetResourceState request to the Resource Controller.
       
  1607 		
       
  1608 		Trace data format:
       
  1609 		- 4 bytes specifying the resource ID
       
  1610 		- 4 bytes specifying the resource level
       
  1611 		- 4 bytes containing the client identifier
       
  1612 		- 4 bytes specifying the success code returned by the Resource Controller.
       
  1613 		*/
       
  1614 		EGetResourceStateUsEnd,
       
  1615 		/**
       
  1616 		Trace output for the start of a ChangeResourceState request to the Resource Controller.
       
  1617 		
       
  1618 		Trace data format:
       
  1619 		- 4 bytes specifying the resource ID
       
  1620 		- 4 bytes specifying the required state
       
  1621 		- N bytes containing the client name, where 0 < N < 32
       
  1622 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1623 		*/
       
  1624 		ESetResourceStateUsStart,
       
  1625 		/**
       
  1626 		Trace output for the end of a ChangeResourceState request to the Resource Controller.
       
  1627 		
       
  1628 		Trace data format:
       
  1629 		- 4 bytes specifying the resource ID
       
  1630 		- 4 bytes specifying the requested state
       
  1631 		- 4 bytes containing the client identifier
       
  1632 		- 4 bytes specifying the success code returned by the Resource Controller.
       
  1633 		*/
       
  1634 		ESetResourceStateUsEnd,
       
  1635 		/**
       
  1636 		Trace output for the start of a cancel GetResourceState request to the Resource Controller.
       
  1637 		
       
  1638 		Trace data format:
       
  1639 		- 4 bytes specifying the resource ID
       
  1640 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1641 		- N bytes containing the client name, where 0 < N < 32
       
  1642 		*/
       
  1643 		ECancelGetResourceStateUsStart,
       
  1644 		/**
       
  1645 		Trace output for the end of a cancel GetResourceState request to the Resource Controller.
       
  1646 		
       
  1647 		Trace data format:
       
  1648 		- 4 bytes specifying the resource ID
       
  1649 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1650 		- N bytes containing the client name, where 0 < N < 32
       
  1651 		*/
       
  1652 		ECancelGetResourceStateUsEnd,
       
  1653 		/**
       
  1654 		Trace output for the start of a cancel ChangeResourceState request to the Resource Controller.
       
  1655 		
       
  1656 		Trace data format:
       
  1657 		- 4 bytes specifying the resource ID
       
  1658 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1659 		- N bytes containing the client name, where 0 < N < 32
       
  1660 		*/
       
  1661 		ECancelSetResourceStateUsStart,
       
  1662 		/**
       
  1663 		Trace output for the end of a cancel ChangeResourceState request to the Resource Controller.
       
  1664 		
       
  1665 		Trace data format:
       
  1666 		- 4 bytes specifying the resource ID
       
  1667 		- 4 bytes containing the client identifier provided by the Resource Controller.
       
  1668 		- N bytes containing the client name, where 0 < N < 32
       
  1669 		*/
       
  1670 		ECancelSetResourceStateUsEnd
       
  1671 		};
       
  1672 
       
  1673 	/**
       
  1674 	Enumeration of sub-category values for trace category EThreadPriority.
       
  1675 	@see EThreadPriority
       
  1676 	@internalTechnology
       
  1677     @prototype 9.3
       
  1678 	*/
       
  1679 	enum TThreadPriority
       
  1680 		{
       
  1681 		/**
       
  1682 		Trace output when a nanothread priority is changed.
       
  1683 		
       
  1684 		Trace data format:
       
  1685 		- 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
       
  1686 		- 4 bytes containing the new absolute priority.
       
  1687 		*/
       
  1688 		ENThreadPriority=0,
       
  1689 
       
  1690 		/**
       
  1691 		Trace output when a DThread's default priority is set.
       
  1692 
       
  1693 		Trace data format:
       
  1694 		- 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
       
  1695 		- 4 bytes containing the iThreadPriority member - a value from enum ::TThrdPriority.
       
  1696 		- 4 bytes containing the new default absolute priority.
       
  1697 		*/
       
  1698 		EDThreadPriority=1,
       
  1699 
       
  1700 		/**
       
  1701 		Trace output when a DProcess priority is changed.
       
  1702 		
       
  1703 		Trace data format:
       
  1704 		- 4 bytes containing trace id (a DProcess*) for process.
       
  1705 		- 4 bytes containing the new process priority, a value from enum ::TProcPriority
       
  1706 		*/
       
  1707 		EProcessPriority=2
       
  1708 		};
       
  1709 
       
  1710 	/**
       
  1711 	Enumeration of sub-category values for trace category EPagingMedia.
       
  1712 	@see EPagingMedia
       
  1713 	*/
       
  1714 	enum TPagingMedia
       
  1715 		{
       
  1716 		/**
       
  1717 		Event generated when a request to 'page in' data is received by the Local Media Subsystem.
       
  1718 
       
  1719 		Trace data format:
       
  1720 		- 4 bytes containing the linear address of the buffer to where the data is to be written.
       
  1721 		- 4 bytes containing the offset from start of the partition to where the data to be paged in resides.
       
  1722 		- 4 bytes containing the number of bytes to be read off the media.
       
  1723 		- 4 bytes containing local drive number for the drive where the data to be paged in resides (-1 if ROM paging). 
       
  1724 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1725 
       
  1726 		The context id (NThread*) in this trace is that of the thread that took the page fault that caused this event.
       
  1727 		*/
       
  1728 		EPagingMediaLocMedPageInBegin,
       
  1729 
       
  1730 		/**
       
  1731 		Event generated by the Local Media Subsystem when a request to 'page in' data is completed.
       
  1732 
       
  1733 		Trace data format:
       
  1734 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1735 		- 4 bytes containing the completion code to be returned.
       
  1736 		- 4 bytes containing a code qualifying this request as either a ROM or Code 'page in' (see TPagingRequestId).
       
  1737 
       
  1738 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1739 		*/
       
  1740 		EPagingMediaLocMedPageInPagedIn,
       
  1741 		
       
  1742 		/**
       
  1743 		Event generated by the Local Media Subsystem when a request to 'page in' data is deferred.
       
  1744 
       
  1745 		Trace data format:
       
  1746 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1747 		- 4 bytes containing a code qualifying this request as either a ROM or Code 'page in' (see TPagingRequestId).
       
  1748 
       
  1749 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1750 		*/
       
  1751 		EPagingMediaLocMedPageInDeferred,
       
  1752 		
       
  1753 		/**
       
  1754 		Event generated by the Local Media Subsystem when a request to 'page in' data that has been deferred is re-posted.
       
  1755 
       
  1756 		Trace data format:
       
  1757 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1758 		- 4 bytes containing a code qualifying this request as either a ROM or Code 'page in' (see TPagingRequestId).
       
  1759 
       
  1760 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1761 		*/
       
  1762 		EPagingMediaLocMedPageInDeferredReposted,
       
  1763 		
       
  1764 		/**
       
  1765 		Event generated by the Local Media Subsystem when a request to 'page in' data is re-deferred.
       
  1766 
       
  1767 		Trace data format:
       
  1768 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1769 		- 4 bytes containing a code qualifying this request as either a ROM or Code 'page in' (see TPagingRequestId).
       
  1770 
       
  1771 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1772 		*/
       
  1773 		EPagingMediaLocMedPageInReDeferred,
       
  1774 
       
  1775 		/**
       
  1776 		Event generated by the Local Media Subsystem when a request to 'page in' data is issued when the media is not yet open.
       
  1777 
       
  1778 		Trace data format:
       
  1779 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1780 		- 4 bytes containing the state of the media (one of TMediaState).
       
  1781 		- 4 bytes containing a code qualifying this request as either a ROM or Code 'page in' (see TPagingRequestId).
       
  1782 
       
  1783 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1784 		*/
       
  1785 		EPagingMediaLocMedPageInQuietlyDeferred,
       
  1786 		
       
  1787 		/**
       
  1788 		Event generated by the Local Media Subsystem when a fragment of a Write request is created and is ready to be sent to the Media 
       
  1789 		Driver thread .
       
  1790 
       
  1791 		Trace data format:
       
  1792 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1793 		- 4 bytes containing the ID of this fragment (middle or last).
       
  1794 		- 4 bytes containing the length of data in this request fragment.
       
  1795 		- 4 bytes containing the offset within the original request to the start of data in this fragment.
       
  1796 		- 4 bytes containing the offset from start of the partition to where the data in this fragment is to be written.
       
  1797 		- 4 bytes containing the address of the DThread object representing the thread that issued the original Write request.
       
  1798 
       
  1799 		The context id (NThread*) in this trace is that of the File Server drive thread that issued the original Write request.
       
  1800 		*/
       
  1801 		EPagingMediaLocMedFragmentBegin,
       
  1802 		
       
  1803 		/**
       
  1804 		Event generated by the Local Media Subsystem when a Write fragment is completed .
       
  1805 
       
  1806 		Trace data format:
       
  1807 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1808 		- 4 bytes containing the completion code to be returned.
       
  1809 
       
  1810 		The context id (NThread*) in this trace is that of the File Server drive thread that issued the original Write request.
       
  1811 		*/
       
  1812 		EPagingMediaLocMedFragmentEnd,
       
  1813 		
       
  1814 		/**
       
  1815 		Event generated when the Media Driver starts processing a request to 'page in' data in its specific Request(..) function.
       
  1816 
       
  1817 		Trace data format:
       
  1818 		- 4 bytes containing a code describing the type of the media (one of TMediaDevice).
       
  1819 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1820 
       
  1821 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1822 		*/
       
  1823 		EPagingMediaPagingMedDrvBegin,
       
  1824 
       
  1825 		/**
       
  1826 		Event generated by the Media Driver when the data read by a 'page in' request is written to the paging buffer.
       
  1827 
       
  1828 		Trace data format:
       
  1829 		- 4 bytes containing a code describing the type of the media (one of TMediaDevice).
       
  1830 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1831 		- 4 bytes containing the linear address of the buffer to where the data is to be written.
       
  1832 		- 4 bytes containing the offset within the buffer to where the data will be written.
       
  1833 		- 4 bytes containing the length of data to be written.
       
  1834 
       
  1835 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1836 		*/
       
  1837 		EPagingMediaMedDrvWriteBack,
       
  1838 		
       
  1839 		/**
       
  1840 		Event generated when a request to 'page in' data is put on hold because the Media Driver is performing some background
       
  1841 		operation (not another request) and cannot service the request.
       
  1842 
       
  1843 		Trace data format:
       
  1844 		- 4 bytes containing a code describing the type of the media (one of TMediaDevice).
       
  1845 		- 4 bytes containing the linear address in memory where this request object resides.
       
  1846 
       
  1847 		The context id (NThread*) in this trace is that of the media driver thread that services this 'page in' request.
       
  1848 		*/
       
  1849 		EPagingMediaMedDrvOnHold,
       
  1850 		};
       
  1851 
       
  1852 	/**
       
  1853 	Enumeration of sub-category values for trace category EKernelMemory.
       
  1854 	@see EKernelMemory
       
  1855 	*/
       
  1856 	enum TKernelMemory 
       
  1857 		{
       
  1858 		/**
       
  1859 		Event recorded during startup and prime which details the initial amount of free RAM.
       
  1860 
       
  1861 		Trace data format:
       
  1862 		- 4 bytes containing the number of bytes of RAM the system started with.
       
  1863 		*/
       
  1864 		EKernelMemoryInitialFree,
       
  1865 
       
  1866 		/**
       
  1867 		Event recorded during prime which records the then-current amount of free RAM.
       
  1868 
       
  1869 		Trace data format:
       
  1870 		- 4 bytes containing the number of bytes of free RAM.
       
  1871 		*/
       
  1872 		EKernelMemoryCurrentFree,
       
  1873 
       
  1874 		/**
       
  1875 		Event recorded when a miscellaneous kernel allocation is made. These include:
       
  1876 		- Memory for MMU page table contents
       
  1877 		- Memory for MMU SPageTableInfos
       
  1878 		- Memory for shadow pages
       
  1879 
       
  1880 		Trace data format:
       
  1881 		- 4 bytes containing the size, in bytes, of the allocation.
       
  1882 		*/
       
  1883 		EKernelMemoryMiscAlloc,
       
  1884 
       
  1885 		/**
       
  1886 		Event recorded when a miscellaneous kernel allocation (see EKernelMemoryMiscAlloc
       
  1887 		above) is freed. 
       
  1888 
       
  1889 		Trace data format:
       
  1890 		- 4 bytes containing the size, in bytes, of the freed allocation.
       
  1891 		*/
       
  1892 		EKernelMemoryMiscFree,
       
  1893 
       
  1894 		/**
       
  1895 		The amount of memory reserved for the minimum demand paging cache. The *actual* DP cache
       
  1896 		also uses free memory, only this minimum amount is permanently reserved for that purpose.
       
  1897 		This event is recorded during prime and when the amount changes.
       
  1898 
       
  1899 		Trace data format:
       
  1900 		- 4 bytes containing the minimum size, in bytes, of the demand paging cache.
       
  1901 		*/
       
  1902 		EKernelMemoryDemandPagingCache,
       
  1903 
       
  1904 		/**
       
  1905 		Physically contiguous memory allocated by device drivers via one of:
       
  1906 			Epoc::AllocPhysicalRam()
       
  1907 			Epoc::ZoneAllocPhysicalRam()
       
  1908 			Epoc::ClaimPhysicalRam()
       
  1909 			TRamDefragRequest::ClaimRamZone()
       
  1910 
       
  1911 		Trace data format:
       
  1912 		- 4 bytes containing the size of the allocated memory.
       
  1913 		- 4 bytes containing the physical base address of allocated memory.
       
  1914 
       
  1915 		NB: The prime function logs a EKernelMemoryDrvPhysAlloc record where the physical 
       
  1916 		address is -1 and should be ignored.
       
  1917 		*/
       
  1918 		EKernelMemoryDrvPhysAlloc,
       
  1919 
       
  1920 		/**
       
  1921 		Memory freed by device drivers via calls to all versions of 
       
  1922 		Epoc::FreePhysicalRam(). 
       
  1923 
       
  1924 		Trace data format:
       
  1925 		- 4 bytes containing the size of the freed memory.
       
  1926 		- 4 bytes containing the physical base address of freed memory.
       
  1927 		*/
       
  1928 		EKernelMemoryDrvPhysFree,
       
  1929 		};
       
  1930 
       
  1931 	/**
       
  1932 	Enumeration of sub-category values for trace category EHeap.
       
  1933 	@see EHeap
       
  1934 	*/
       
  1935 	enum THeap
       
  1936 		{
       
  1937 		/**
       
  1938 		Event recorded during process startup which logs the point of heap creation.
       
  1939 
       
  1940 		Trace data format:
       
  1941 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1942 		- 2 bytes containing the size of header overhead, per allocation (0xFFFF indicates a variable size)
       
  1943 		- 2 bytes containing the size of footer overhead, per allocation (0xFFFF indicates a variable size)
       
  1944 		*/
       
  1945 		EHeapCreate,
       
  1946 
       
  1947 		/**
       
  1948 		Event recorded during process startup which details the chunk being used as a heap.
       
  1949 
       
  1950 		Trace data format:
       
  1951 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1952 		- 4 bytes containing the chunk ID (The RHandleBase* of the chunk)
       
  1953 		*/
       
  1954 		EHeapChunkCreate,
       
  1955 		
       
  1956 		/**
       
  1957 		Event recorded when RHeap::Alloc() is called.
       
  1958 
       
  1959 		Trace data format:
       
  1960 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1961 		- 4 bytes containing the address of the allocation
       
  1962 		- 4 bytes containing the size of the allocation
       
  1963 		- 4 bytes containing the requested size of allocation
       
  1964 		*/
       
  1965 		EHeapAlloc,
       
  1966 
       
  1967 		/**
       
  1968 		Event recorded when RHeap::ReAlloc() is called.
       
  1969 
       
  1970 		Trace data format:
       
  1971 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1972 		- 4 bytes containing the address of the new allocation
       
  1973 		- 4 bytes containing the size of the allocation
       
  1974 		- 4 bytes containing the requested size of allocation
       
  1975 		- 4 bytes containing the address of the old allocation
       
  1976 		*/
       
  1977 		EHeapReAlloc,
       
  1978 
       
  1979 		/**
       
  1980 		Event recorded when RHeap::Free() is called.
       
  1981 
       
  1982 		Trace data format:
       
  1983 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1984 		- 4 bytes containing the address of the free'd allocation
       
  1985 		*/
       
  1986 		EHeapFree,	
       
  1987 		
       
  1988 		/**
       
  1989 		Event recorded when RHeap::Alloc() fails.
       
  1990 		
       
  1991 		Trace data format:
       
  1992 		- 4 bytes containing the heap ID (The RAllocator*)
       
  1993 		- 4 bytes containing the requested size of allocation
       
  1994 		*/
       
  1995 		EHeapAllocFail,
       
  1996 		
       
  1997 		/**
       
  1998 		Event recorded when RHeap::ReAlloc() fails.
       
  1999 				
       
  2000 		Trace data format:
       
  2001 		- 4 bytes containing the heap ID (The RAllocator*)
       
  2002 		- 4 bytes containing the address of the old allocation
       
  2003 		- 4 bytes containing the requested size of allocation
       
  2004 		 */
       
  2005 		EHeapReAllocFail,
       
  2006 		
       
  2007 		/**
       
  2008 		Event recorded when heap memory corruption occurs.
       
  2009 		
       
  2010 		Trace data format:
       
  2011 		- 4 bytes containing the heap ID (The RAllocator*)
       
  2012 		- 4 bytes containing address of the corrupted memory block
       
  2013 		- 4 bytes containing length of the corrupted memory block
       
  2014 		*/
       
  2015 		EHeapCorruption,
       
  2016 		};
       
  2017 
       
  2018 	/**
       
  2019 	Enumeration of sub-category values for trace category EMetaTrace.
       
  2020 	@see EMetaTrace
       
  2021 	*/
       
  2022 	enum TMetaTrace
       
  2023 		{
       
  2024 		/**
       
  2025 		Information about timestamps used for tracing.
       
  2026 
       
  2027 		Trace data format:
       
  2028 		- 4 bytes containing the period of the Timestamp value.
       
  2029 		- 4 bytes containing the period of the Timestamp2 value.
       
  2030 		- 4 bytes containing a set of bit flags with the following meaning:
       
  2031 			- Bit 0, if true, indicates that Timestamp and Timestamp2 are two halves
       
  2032 			  of a single 64bit timestamp value; Timestamp2 is the most significant part.
       
  2033 			- All other bits are presently undefined.
       
  2034 
       
  2035 		The format of the timestamp period data is a period in seconds given using an exponent and mantissa 
       
  2036 		format, where the most significant 8 bits are the signed power-of-two value for the exponent, and 
       
  2037 		the least significant 24 bits are the integer value of the mantissa. The binary point is to the right 
       
  2038 		of the least significant mantissa bit, and the mantissa may not be in normalised form.
       
  2039 
       
  2040 		Example code for decoding the period:
       
  2041 		@code
       
  2042 			TInt32 period; // value from trace record
       
  2043 			int exponent = (signed char)(period>>24);
       
  2044 			int mantissa = period&0xffffff;
       
  2045 			double periodInSeconds = (double)mantissa*pow(2,exponent);
       
  2046 		@endcode
       
  2047 		*/
       
  2048 		EMetaTraceTimestampsInfo,
       
  2049 
       
  2050 		/**
       
  2051 		Trace indicating the start of a test case being measured.
       
  2052 
       
  2053 		Trace data format:
       
  2054 		- 4 bytes containing measurement specific value.
       
  2055 		- 4 bytes containing a further measurement specific value.
       
  2056 		- Remaining data is ASCII text providing human readable information.
       
  2057 		*/
       
  2058 		EMetaTraceMeasurementStart,
       
  2059 
       
  2060 		/**
       
  2061 		Trace indicating the end of a test case being measured.
       
  2062 
       
  2063 		Trace data format:
       
  2064 		- 4 bytes containing measurement specific identifying value.
       
  2065 		- 4 bytes containing a further measurement specific identifying value.
       
  2066 
       
  2067 		The values contained in this trace must be identical to those in the corresponding
       
  2068 		ETraceInfoMeasurementStart trace.
       
  2069 		*/
       
  2070 		EMetaTraceMeasurementEnd,
       
  2071 
       
  2072 		/**
       
  2073 		Trace indicating a change in state of the primary filter.
       
  2074 
       
  2075 		Trace data format:
       
  2076 		- 1 byte containing a trace category number.
       
  2077 		- 1 byte containing the new filter state for the category. (0=off, 1=on).
       
  2078 		- 2 byte padding. (Should be output as zeros.)
       
  2079 		*/
       
  2080 		EMetaTraceFilterChange
       
  2081 		};
       
  2082 
       
  2083 	/**
       
  2084 	Enumeration of sub-category values for trace category ERamAllocator.
       
  2085 	@see BTrace::ERamAllocator
       
  2086 	*/
       
  2087 	enum TRamAllocator
       
  2088 		{
       
  2089 		/**
       
  2090 		The number of RAM zones.
       
  2091 
       
  2092 		Trace data format:
       
  2093 		- 4 bytes containing the number of RAM zones.
       
  2094 		*/
       
  2095 		ERamAllocZoneCount,
       
  2096 		
       
  2097 		/**
       
  2098 		Information on the layout of a RAM zone.
       
  2099 
       
  2100 		Trace data format:
       
  2101 		- 4 bytes containing the number of pages in the zone
       
  2102 		- 4 bytes containing the physical base address of the zone
       
  2103 		- 4 bytes containing the ID of the zone
       
  2104 		- 1 bytes containing the preference of the zone
       
  2105 		- 1 bytes containing the flags of the zone
       
  2106 		- 2 bytes reserved for future use
       
  2107 		*/
       
  2108 		ERamAllocZoneConfig,
       
  2109 
       
  2110 		/**
       
  2111 		This trace is sent for every contiguous block of RAM that was allocated 
       
  2112 		during the kernel boot process.
       
  2113 
       
  2114 		Trace data format:
       
  2115 		- 4 bytes containing the number of contiguous pages allocated for the block
       
  2116 		- 4 bytes containing the physical base address of the block
       
  2117 		*/
       
  2118 		ERamAllocBootAllocation,
       
  2119 
       
  2120 
       
  2121 		/** 
       
  2122 		This trace marks the end of the boot allocations
       
  2123 
       
  2124 		Trace data format:
       
  2125 		- no extra bytes are sent
       
  2126 		*/
       
  2127 		ERamAllocBootAllocationEnd,
       
  2128 
       
  2129 		/**
       
  2130 		Event generated when a RAM zone's flags have been modified
       
  2131 		This could occur when a RAM zone is blocked/unblocked from further 
       
  2132 		allocations from all/certain page types.
       
  2133 
       
  2134 		Trace data format:
       
  2135 		- 4 bytes containing the ID of the zone
       
  2136 		- 4 bytes containing the flags of the zone
       
  2137 		*/
       
  2138 		ERamAllocZoneFlagsModified,
       
  2139 
       
  2140 		/**
       
  2141 		Event generated when DRamAllocator::ClaimPhysicalRam has successfully
       
  2142 		claimed the specified RAM pages.
       
  2143 
       
  2144 		Trace data format:
       
  2145 		- 4 bytes containing the number of contiguous pages
       
  2146 		- 4 bytes containing the base address of the pages
       
  2147 		*/
       
  2148 		ERamAllocClaimRam,
       
  2149 
       
  2150 		/**
       
  2151 		Event generated when DRamAllocator::MarkPageAllocated has successfully
       
  2152 		marked the specified page as allocated.
       
  2153 
       
  2154 		Trace data format:
       
  2155 		- 4 bytes containing the TZonePageType type of the page
       
  2156 		- 4 bytes containing the address of the page
       
  2157 		*/
       
  2158 		ERamAllocMarkAllocated,
       
  2159 
       
  2160 		/**
       
  2161 		Event generated when DRamAllocator::AllocContiguousRam successfully
       
  2162 		allocates the requested number of pages.
       
  2163 
       
  2164 		Trace data format:
       
  2165 		- 4 bytes containing the TZonePageType type of the pages
       
  2166 		- 4 bytes containing the number of contiguous pages
       
  2167 		- 4 bytes containing the base address of the pages
       
  2168 		*/
       
  2169 		ERamAllocContiguousRam,
       
  2170 
       
  2171 		/**
       
  2172 		Event generated when DRamAllocator::FreePage has successfully freed 
       
  2173 		the specified RAM page.
       
  2174 
       
  2175 		Trace data format:
       
  2176 		- 4 bytes containing the TZonePageType type of the page
       
  2177 		- 4 bytes containing the address of the page
       
  2178 		*/
       
  2179 		ERamAllocFreePage,
       
  2180 
       
  2181 		/**
       
  2182 		Event generated when DRamAllocator::FreePhysical successfully freed 
       
  2183 		the specified RAM page(s).
       
  2184 
       
  2185 		Trace data format:
       
  2186 		- 4 bytes containing the number of contiguous pages
       
  2187 		- 4 bytes containing the base address of the pages
       
  2188 		*/
       
  2189 		ERamAllocFreePhysical,
       
  2190 
       
  2191 		/**
       
  2192 		Event generated for each contiguous block of pages when 
       
  2193 		DRamAllocator::AllocRamPages or DRamAllocator::ZoneAllocRamPages
       
  2194 		are attempting to fulfil a request.
       
  2195 
       
  2196 		Trace data format:
       
  2197 		- 4 bytes containing the TZonePageType type of the pages
       
  2198 		- 4 bytes containing the number of contiguous pages
       
  2199 		- 4 bytes containing the base address of the pages
       
  2200 		*/
       
  2201 		ERamAllocRamPages,
       
  2202 
       
  2203 		/**
       
  2204 		Event generated for contiguous block of pages when 
       
  2205 		DRamAllocator::FreeRamPages is invoked.
       
  2206 
       
  2207 		Trace data format:
       
  2208 		- 4 bytes containing the TZonePageType type of the pages
       
  2209 		- 4 bytes containing the number of contiguous pages
       
  2210 		- 4 bytes containing the base address of the pages
       
  2211 		*/
       
  2212 		ERamAllocFreePages,
       
  2213 
       
  2214 		/**
       
  2215 		Event generated when DRamAllocator::AllocRamPages has successfully 
       
  2216 		allocated all the requested number of RAM pages.  If DRamAllocator::AllocRamPages
       
  2217 		couldn't allocate all the requested pages then this event is not generated.
       
  2218 
       
  2219 		Trace data format:
       
  2220 		- no extra bytes sent
       
  2221 		*/
       
  2222 		ERamAllocRamPagesEnd,
       
  2223 
       
  2224 		/**
       
  2225 		Event generated when all ERamAllocFreePages events for a particular 
       
  2226 		call of DRamAllocator::FreeRamPages have been generated.
       
  2227 
       
  2228 		Trace data format:
       
  2229 		- no extra bytes sent
       
  2230 		*/
       
  2231 		ERamAllocFreePagesEnd,
       
  2232 		
       
  2233 		/**
       
  2234 		Event generated when DRamAllocator::ChangePageType is has successfully 
       
  2235 		updated the type of the specified page.
       
  2236 	
       
  2237 		Trace data format:
       
  2238 		- 4 bytes containing the new TZonePageType type of the page
       
  2239 		- 4 bytes containing the physical address of the page
       
  2240 		*/
       
  2241 		ERamAllocChangePageType,
       
  2242 
       
  2243 		/**
       
  2244 		Event generated when DRamAllocator::ZoneAllocContiguousRam has
       
  2245 		successfully allocated the required number of pages.
       
  2246 
       
  2247 		Trace data format:
       
  2248 		- 4 bytes containing the TZonePageType type of the pages
       
  2249 		- 4 bytes containing the number of contiguous pages
       
  2250 		- 4 bytes containing the base address of the pages
       
  2251 		*/
       
  2252 		ERamAllocZoneContiguousRam,
       
  2253 
       
  2254 		/**
       
  2255 		Event generated when DRamAllocator::ZoneAllocRamPages has successfully
       
  2256 		allocated all the requested RAM pages.  If DRamAllocator::ZoneAllocRamPages
       
  2257 		couldn't allocate all the requested pages then this event is not generated.
       
  2258 
       
  2259 		Trace data format:
       
  2260 		- no extra bytes sent
       
  2261 		*/
       
  2262 		ERamAllocZoneRamPagesEnd,
       
  2263 		
       
  2264 		/**
       
  2265 		Event generated when Epoc::ClaimRamZone has successfully claimed 
       
  2266 		the requested zone.
       
  2267 		
       
  2268 		Trace data format:
       
  2269 		- 4 bytes containing the ID of the zone that has been claimed.
       
  2270 		*/
       
  2271 		ERamAllocClaimZone,
       
  2272 		};
       
  2273 
       
  2274 	enum TFastMutex
       
  2275 		{
       
  2276 		/**
       
  2277 		Event generated when a thread acquires a fast mutex, (waits on it).
       
  2278 
       
  2279 		Trace data format:
       
  2280 		- 4 bytes containing the fast mutex id, (an NFastMutex*).
       
  2281 		*/
       
  2282 		EFastMutexWait,
       
  2283 		
       
  2284 		/**
       
  2285 		Event generated when a thread releases a fast mutex, (signals it).
       
  2286 
       
  2287 		Trace data format:
       
  2288 		- 4 bytes containing the fast mutex id, (an NFastMutex*).
       
  2289 		*/
       
  2290 		EFastMutexSignal,
       
  2291 
       
  2292 		/**
       
  2293 		Event generated when a fast mutex is 'flashed' (signalled then immediately
       
  2294 		waited on again). E.g the operation performed by NKern::FlashSystem.
       
  2295 
       
  2296 		Trace data format:
       
  2297 		- 4 bytes containing the fast mutex id, (an NFastMutex*).
       
  2298 		*/
       
  2299 		EFastMutexFlash,
       
  2300 		
       
  2301 		/**
       
  2302 		Trace to associate a fast mutex with a textual name.
       
  2303 
       
  2304 		Trace data format:
       
  2305 		- 4 bytes containing the fast mutex id, (an NFastMutex*).
       
  2306 		- 4 bytes containing unspecified data (should be output as zero).
       
  2307 		- Remaining data is the ASCII name for the fast mutex.
       
  2308 		*/
       
  2309 		EFastMutexName,
       
  2310 
       
  2311 		/**
       
  2312 		Event generated when a thread blocks on a fast mutex.
       
  2313 
       
  2314 		Trace data format:
       
  2315 		- 4 bytes containing the fast mutex id, (an NFastMutex*).
       
  2316 		*/
       
  2317 		EFastMutexBlock,
       
  2318 		};
       
  2319 
       
  2320 	/**
       
  2321 	Enumeration of sub-category values for trace category EProfiling.
       
  2322 	@see BTrace::EProfiling
       
  2323 	*/
       
  2324 	enum TProfiling
       
  2325 		{
       
  2326 		/**
       
  2327 		CPU sample including program counter and thread context.
       
  2328 
       
  2329 		Trace data format:
       
  2330 		- 4 bytes containing the program counter.
       
  2331 		- 4 bytes containing thread context (an NThread*).
       
  2332 		*/
       
  2333 		ECpuFullSample = 0, 
       
  2334 
       
  2335 		/**
       
  2336 		Optimised CPU sample including program counter. 
       
  2337 		Doesn't include a thread context id as it hasn't changed since 
       
  2338 		the last sample.
       
  2339 
       
  2340 		Trace data format:
       
  2341 		- 4 bytes containing the program counter.
       
  2342 		*/
       
  2343 		ECpuOptimisedSample,
       
  2344 
       
  2345 		/**
       
  2346 		CPU sample from iDFC including program counter.
       
  2347 
       
  2348 		Trace data format:
       
  2349 		- 4 bytes containing the program counter.
       
  2350 		*/
       
  2351 		ECpuIdfcSample,
       
  2352 
       
  2353 		/**
       
  2354 		CPU sample from non-Symbian thread.
       
  2355 
       
  2356   		Trace data format:
       
  2357 		- no extra bytes are sent
       
  2358 		*/
       
  2359 		ECpuNonSymbianThreadSample
       
  2360 
       
  2361 		};
       
  2362 
       
  2363 	/**
       
  2364 	Enumeration of sub-category values for trace category ERawEvent.
       
  2365 	@see BTrace::ERawEvent  
       
  2366 	*/
       
  2367 	enum TRawEventTrace
       
  2368 		{
       
  2369 
       
  2370 		/**
       
  2371 		For all the set Functions in the TRawEvent class.
       
  2372 		Trace Data Format Varies depends which of the Overloaded Set Method from where its set .
       
  2373 		Trace data format:
       
  2374 		if there are only one 4 byte data
       
  2375 
       
  2376 		--The Following oder is folloed for data.
       
  2377 		- 4 bytes containing the event type
       
  2378 
       
  2379 		if there are 2*4 byte data
       
  2380 		- 4 bytes containing the event type
       
  2381 		- 4 bytes containing the scan code
       
  2382 		
       
  2383 		if there are  3*4 byte data
       
  2384 		- 4 bytes containing the event type
       
  2385 		--4 bytes containining the X co-ordinate 
       
  2386 		--4 bytes containining the Y co-ordinate 
       
  2387 
       
  2388 		if there are  4*4 byte data
       
  2389 		- 4 bytes containing the event type
       
  2390 		--4 bytes containining the X co-ordinate 
       
  2391 		--4 bytes containining the Y co-ordinate 
       
  2392 		--4 bytes containining the Z co-ordinate 
       
  2393 
       
  2394 		if there are  5*4 byte data
       
  2395 		- 4 bytes containing the event type
       
  2396 		--4 bytes containining the X co-ordinate 
       
  2397 		--4 bytes containining the Y co-ordinate 
       
  2398 		--4 bytes containining the Z co-ordinate 
       
  2399 		--4 bytes containining the PointerNumber 
       
  2400 
       
  2401   		if there are  7*4 byte data
       
  2402 		- 4 bytes containing the event type
       
  2403 		--4 bytes containining the X co-ordinate 
       
  2404 		--4 bytes containining the Y co-ordinate 
       
  2405 		--4 bytes containining the Z co-ordinate 
       
  2406 		--4 bytes containining the Phi polar coordinate. 
       
  2407 		--4 bytes containining the Theta polar coordinate. 
       
  2408 		--4 bytes containining the rotation angle(alpha)
       
  2409 		*/
       
  2410 
       
  2411 		ESetEvent = 1, 
       
  2412 		
       
  2413 		/**
       
  2414 		For  user side SetTip Events
       
  2415 		Trace data format:
       
  2416 		- 4 bytes to state containing Tip Info.
       
  2417 		*/	
       
  2418 		ESetTipEvent,
       
  2419 
       
  2420 		/**
       
  2421 		For  SetTilt Events
       
  2422 		Trace data format:
       
  2423 		- 4 bytes containing the event type
       
  2424 		--4 bytes containining the Phi polar coordinate. 
       
  2425 		--4 bytes containining the Theta polar coordinate.	
       
  2426 		*/	
       
  2427 		ESetTiltEvent,
       
  2428 
       
  2429 		/**
       
  2430 		For  SetRotation Events
       
  2431 		Trace data format:
       
  2432 		- 4 bytes containing the event type
       
  2433 		--4 bytes containining the rotation angle (alpha)			
       
  2434 		*/	
       
  2435 		ESetRotationtEvent,
       
  2436         
       
  2437 		/**
       
  2438 		For  SetPointerNumber Events
       
  2439 		Trace data format:
       
  2440 		- 4 bytes containing the Pointer Number
       
  2441 		*/	
       
  2442 		ESetPointerNumberEvent,
       
  2443 
       
  2444 		/**
       
  2445 		For  user side addevents (User::AddEvent)
       
  2446 		Trace data format:
       
  2447 		- 4 bytes containing the event type
       
  2448 		*/	
       
  2449 		EUserAddEvent,
       
  2450         
       
  2451 		/**
       
  2452 		For  kernal side addevents (Kern::AddEvent)
       
  2453 		Trace data format:
       
  2454 		- 4 bytes containing the event type
       
  2455 		*/
       
  2456 		EKernelAddEvent
       
  2457 		};
       
  2458 
       
  2459 	enum TSymbianKernelSync
       
  2460 		{
       
  2461 		/**
       
  2462 		A semaphore (DSemaphore) has been created.
       
  2463 
       
  2464 		Trace data format:
       
  2465 		- 4 bytes containing trace id (a DSemaphore*) for this semaphore.
       
  2466 		- 4 bytes containing the owning DThread* or DProcess*
       
  2467 		- Remaining data is the ASCII name of the semaphore.
       
  2468 		*/
       
  2469 		ESemaphoreCreate=0x00,
       
  2470 		
       
  2471 		/**
       
  2472 		A semaphore (DSemaphore) has been destroyed.
       
  2473 
       
  2474 		Trace data format:
       
  2475 		- 4 bytes containing trace id (a DSemaphore*) for this semaphore.
       
  2476 		*/
       
  2477 		ESemaphoreDestroy=0x01,
       
  2478 
       
  2479 		/**
       
  2480 		A semaphore (DSemaphore) has been acquired.
       
  2481 
       
  2482 		Trace data format:
       
  2483 		- 4 bytes containing trace id (a DSemaphore*) for this semaphore.
       
  2484 		*/
       
  2485 		ESemaphoreAcquire=0x02,
       
  2486 
       
  2487 		/**
       
  2488 		A semaphore (DSemaphore) has been released.
       
  2489 
       
  2490 		Trace data format:
       
  2491 		- 4 bytes containing trace id (a DSemaphore*) for this semaphore.
       
  2492 		*/
       
  2493 		ESemaphoreRelease=0x03,
       
  2494 
       
  2495 		/**
       
  2496 		A thread has blocked on a semaphore (DSemaphore)
       
  2497 
       
  2498 		Trace data format:
       
  2499 		- 4 bytes containing trace id (a DSemaphore*) for this semaphore.
       
  2500 		*/
       
  2501 		ESemaphoreBlock=0x04,
       
  2502 
       
  2503 
       
  2504 		/**
       
  2505 		A mutex (DMutex) has been created.
       
  2506 
       
  2507 		Trace data format:
       
  2508 		- 4 bytes containing trace id (a DMutex*) for this mutex.
       
  2509 		- 4 bytes containing the owning DThread* or DProcess*
       
  2510 		- Remaining data is the ASCII name of the mutex.
       
  2511 		*/
       
  2512 		EMutexCreate=0x10,
       
  2513 		
       
  2514 		/**
       
  2515 		A mutex (DMutex) has been destroyed.
       
  2516 
       
  2517 		Trace data format:
       
  2518 		- 4 bytes containing trace id (a DMutex*) for this mutex.
       
  2519 		*/
       
  2520 		EMutexDestroy=0x11,
       
  2521 
       
  2522 		/**
       
  2523 		A mutex (DMutex) has been acquired.
       
  2524 
       
  2525 		Trace data format:
       
  2526 		- 4 bytes containing trace id (a DMutex*) for this mutex.
       
  2527 		*/
       
  2528 		EMutexAcquire=0x12,
       
  2529 
       
  2530 		/**
       
  2531 		A mutex (DMutex) has been released.
       
  2532 
       
  2533 		Trace data format:
       
  2534 		- 4 bytes containing trace id (a DMutex*) for this mutex.
       
  2535 		*/
       
  2536 		EMutexRelease=0x13,
       
  2537 
       
  2538 		/**
       
  2539 		A thread has blocked on a mutex (DMutex)
       
  2540 
       
  2541 		Trace data format:
       
  2542 		- 4 bytes containing trace id (a DMutex*) for this mutex.
       
  2543 		*/
       
  2544 		EMutexBlock=0x14,
       
  2545 
       
  2546 
       
  2547 		/**
       
  2548 		A condition variable (DCondVar) has been created.
       
  2549 
       
  2550 		Trace data format:
       
  2551 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2552 		- 4 bytes containing the owning DThread* or DProcess*
       
  2553 		- Remaining data is the ASCII name of the condition variable.
       
  2554 		*/
       
  2555 		ECondVarCreate=0x20,
       
  2556 		
       
  2557 		/**
       
  2558 		A condition variable (DCondVar) has been destroyed.
       
  2559 
       
  2560 		Trace data format:
       
  2561 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2562 		*/
       
  2563 		ECondVarDestroy=0x21,
       
  2564 
       
  2565 		/**
       
  2566 		A thread has blocked on a condition variable (DCondVar)
       
  2567 
       
  2568 		Trace data format:
       
  2569 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2570 		- 4 bytes containing trace id (DMutex*) for the associated mutex.
       
  2571 		*/
       
  2572 		ECondVarBlock=0x22,
       
  2573 
       
  2574 		/**
       
  2575 		A thread has been released from a condition variable (DCondVar) wait
       
  2576 
       
  2577 		Trace data format:
       
  2578 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2579 		- 4 bytes containing trace id (DMutex*) for the associated mutex.
       
  2580 		*/
       
  2581 		ECondVarWakeUp=0x23,
       
  2582 
       
  2583 		/**
       
  2584 		A condition variable (DCondVar) has been signalled
       
  2585 
       
  2586 		Trace data format:
       
  2587 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2588 		- 4 bytes containing trace id (DMutex*) for the associated mutex.
       
  2589 		*/
       
  2590 		ECondVarSignal=0x24,
       
  2591 
       
  2592 		/**
       
  2593 		A condition variable (DCondVar) has been signalled in broadcast mode.
       
  2594 
       
  2595 		Trace data format:
       
  2596 		- 4 bytes containing trace id (a DCondVar*) for this condition variable.
       
  2597 		- 4 bytes containing trace id (DMutex*) for the associated mutex.
       
  2598 		*/
       
  2599 		ECondVarBroadcast=0x25,
       
  2600 
       
  2601 		};
       
  2602 
       
  2603 	/**
       
  2604 	Calculate the address of the next trace record.
       
  2605 	@param aCurrentRecord A pointer to a trace record.
       
  2606 	@return The address of the trace record which follows aCurrentRecord.
       
  2607 	*/
       
  2608 	inline static TUint8* NextRecord(TAny* aCurrentRecord);
       
  2609 
       
  2610 #ifdef __KERNEL_MODE__
       
  2611 
       
  2612 	/**
       
  2613 	Create initial trace output required for the specified trace category.
       
  2614 	E.g. For the EThreadIdentification category, this will cause traces which identify
       
  2615 	all threads already in existence at this point.
       
  2616 
       
  2617 	@aCategory The trace category, or -1 to indicate all trace categories.
       
  2618 
       
  2619 	@publishedPartner
       
  2620 	@released
       
  2621 	*/
       
  2622 	IMPORT_C static void Prime(TInt aCategory=-1);
       
  2623 
       
  2624 	/**
       
  2625 	Prototype for function which is called to output trace records.
       
  2626 	I.e. as set by SetHandler().
       
  2627 
       
  2628 	The handler function should output all values which are appropriate for the
       
  2629 	trace as specified in aHeader.
       
  2630 
       
  2631 	@param aHeader	The 4 bytes for the trace header.
       
  2632 	@param aHeader2	The second header word.
       
  2633 					(If EHeader2Present is set in the header flags.)
       
  2634 	@param aContext	The context id.
       
  2635 					(If EContextIdPresent is set in the header flags.)
       
  2636 	@param a1		The first four bytes of trace data.
       
  2637 					(Only if the header size indicates that this is present.)
       
  2638 	@param a2		The second four bytes of trace data.
       
  2639 					(Only if the header size indicates that this is present.)
       
  2640 	@param a3		This is either the third four bytes of trace data, if
       
  2641 					the header size indicates there is between 9 and 12 bytes
       
  2642 					of trace data. If more than 12 of trace data are indicated, then
       
  2643 					a3 contains a pointer to the remaining trace data, bytes 8 trough to N.
       
  2644 					This trace data is word aligned.
       
  2645 	@param aExtra	The 'extra' value.
       
  2646 					(If EExtraPresent is set in the header flags.)
       
  2647 	@param aPc		The Program Counter value.
       
  2648 					(If EPcPresent is set in the header flags.)
       
  2649 
       
  2650 	@return			True, if the trace handler is enabled and outputting trace.
       
  2651 					False otherwise.
       
  2652 
       
  2653 	Here is an example implementation of a trace handler:
       
  2654 
       
  2655 	@code
       
  2656 	TInt size = (aHeader>>BTrace::ESizeIndex*8)&0xff;
       
  2657 	TInt flags = (aHeader>>BTrace::EFlagsIndex*8)&0xff;
       
  2658 	Output(aHeader), size -= 4;
       
  2659 	if(flags&BTrace::EHeader2Present)
       
  2660 		Output(aHeader2), size -= 4;
       
  2661 	if(flags&BTrace::EContextIdPresent)
       
  2662 		Output(aContext), size -= 4;
       
  2663 	if(flags&BTrace::EPcPresent)
       
  2664 		Output(aPc), size -= 4;
       
  2665 	if(flags&BTrace::EExtraPresent)
       
  2666 		Output(aExtra), size -= 4;
       
  2667 	if(size<=0)
       
  2668 		return ETrue;
       
  2669 	Output(a1), size -= 4;
       
  2670 	if(size<=0)
       
  2671 		return ETrue;
       
  2672 	Output(a2), size -= 4;
       
  2673 	if(size<=0)
       
  2674 		return ETrue;
       
  2675 	if(size<=4)
       
  2676 		Output(a3);
       
  2677 	else
       
  2678 		{
       
  2679 		TUint32* data = (TUint32*)a3;
       
  2680 		TUint32* end = (TUint32*)(a3+size);
       
  2681 		do Output(*data++); while(data<end);
       
  2682 		}
       
  2683 	return ETrue;
       
  2684 	@endcode
       
  2685 
       
  2686 	The trace handler may add timestamp values to the trace it outputs, in which case
       
  2687 	it should modify the flags and size in aHeader accordingly, before outputting this value.
       
  2688 	The Timestamp and/or Timestamp2 should be output, in that order, between the Header2 and
       
  2689 	Context ID values.
       
  2690 
       
  2691 	IMPORTANT NOTES.
       
  2692 	-	The handler must not make use of any kernel APIs, apart from TDfc::RawAdd(). (This is
       
  2693 		because kernel APIs may contain tracing and this would result in deadlock of the system.)
       
  2694 	-	The trace handler must not access or modify arguments which are not indicated as
       
  2695 		being present by their flag in aHeader or aHeader2.
       
  2696 		In particular, on ARM CPUs, the values a2, a3, aExtra and aPc are stored on the stack
       
  2697 		and the caller of this function may not have created these arguments before calling the
       
  2698 		trace handler.
       
  2699 	-	The handler may be called in any context and in a re-entrant manner. Implementations must
       
  2700 		be designed to cope with this.
       
  2701 	-	The interrupt disable status must not be reduced by the trace handler during its operation.
       
  2702 		E.g. if IRQs are disabled on entry, the handler must not cause them to become enabled
       
  2703 		at any point.
       
  2704 
       
  2705 	@pre Call in any context.
       
  2706 	@post Interrupt enable status unchanged.
       
  2707 
       
  2708 	@publishedPartner
       
  2709 	@released
       
  2710 	*/
       
  2711 	typedef TBool(*THandler)(TUint32 aHeader,TUint32 aHeader2,const TUint32 aContext,const TUint32 a1,const TUint32 a2,const TUint32 a3,const TUint32 aExtra,const TUint32 aPc);
       
  2712 
       
  2713 
       
  2714 	/**
       
  2715 	Set the function which will receive all trace records.
       
  2716 	@return The handler function which existed before this function was called.
       
  2717 	@publishedPartner
       
  2718 	@released
       
  2719 	*/
       
  2720 	IMPORT_C static BTrace::THandler SetHandler(BTrace::THandler aHandler);
       
  2721 
       
  2722 
       
  2723 	/**
       
  2724 	Set the trace filter bit for the specified category.
       
  2725 
       
  2726 	@param aCategory A category value from enum BTrace::TCategory.
       
  2727 	@param aValue The new filter value for the category.
       
  2728 				  1 means traces of this category are output, 0 means they are suppressed.
       
  2729 				  Other values must not be used.
       
  2730 
       
  2731 	@return The previous value of the filter for the category, 0 or 1.
       
  2732 			Or KErrNotSupported if this category is not supported by this build of the kernel.
       
  2733 	@publishedPartner
       
  2734 	@released
       
  2735 	*/
       
  2736 	IMPORT_C static TInt SetFilter(TUint aCategory, TBool aValue);
       
  2737 
       
  2738 
       
  2739 	/**
       
  2740 	Modify the secondary trace filter to add or remove the specified UID.
       
  2741 
       
  2742 	This method can not be used to disable a UID key if SetFilter2(TInt aGlobalFilter)
       
  2743 	has been used to set the filter to pass all traces. Such attempts result in a return
       
  2744 	code of KErrNotSupported.
       
  2745 
       
  2746 	@param aUid   The UID to filter.
       
  2747 	@param aValue The new filter value for the UID.
       
  2748 				  1 means traces with this UID are output, 0 means they are suppressed.
       
  2749 				  Other values must not be used.
       
  2750 
       
  2751 	@return The previous value of the filter for the UID, 0 or 1, if operation is successful.
       
  2752 			Otherwise, a negative number representing a system wide error code.
       
  2753 			(E.g. KErrNoMemory.)
       
  2754 
       
  2755 	@pre Call in a thread context.
       
  2756 
       
  2757 	@publishedPartner
       
  2758 	@released
       
  2759 	*/
       
  2760 	IMPORT_C static TInt SetFilter2(TUint32 aUid, TBool aValue);
       
  2761 
       
  2762 
       
  2763 	/**
       
  2764 	Set the secondary trace filter to include only the specified UIDs.
       
  2765 	
       
  2766 	@param aUids    Pointer to array of UIDs.
       
  2767 	@param aNumUids Number of UID values pointer to by \a aUid.
       
  2768 
       
  2769 	@return KErrNone on success.
       
  2770 			Otherwise, a negative number representing a system wide error code.
       
  2771 			(E.g. KErrNoMemory.)
       
  2772 
       
  2773 	@pre Call in a thread context.
       
  2774 
       
  2775 	@publishedPartner
       
  2776 	@released
       
  2777 	*/
       
  2778 	IMPORT_C static TInt SetFilter2(const TUint32* aUids, TInt aNumUids);
       
  2779 
       
  2780 
       
  2781 	/**
       
  2782 	Set the secondary trace filter to pass or reject every trace.
       
  2783 	
       
  2784 	@param aGlobalFilter If 0, the secondary filter will reject
       
  2785 						 all traces; if 1, all traces are passed
       
  2786 						 by the filter.
       
  2787 						 Other values have no effect.
       
  2788 
       
  2789 	@return The previous value of the global filter, or -1 if the global filter
       
  2790 			was not previously set.
       
  2791 
       
  2792 	@pre Call in a thread context.
       
  2793 
       
  2794 	@publishedPartner
       
  2795 	@released
       
  2796 	*/
       
  2797 	IMPORT_C static TInt SetFilter2(TInt aGlobalFilter);
       
  2798 
       
  2799 
       
  2800 	/**
       
  2801 	Get the contents of the secondary trace filter.
       
  2802 	
       
  2803 	@param[out] aUids   Pointer to array of UIDs contained in the secondary filter.
       
  2804 						Ownership of this array is passed to the caller of this
       
  2805 						function, which is then responsible for deleting it.
       
  2806 						If filter is empty, \a aUid equals zero.
       
  2807 	@param[out] aGlobalFilter	Set to 1 if the secondary filter passes all traces.
       
  2808 								Set to 0 if the secondary filter rejects all traces.
       
  2809 								Set to -1 if the secondary filter operates by UIDs contained in traces.
       
  2810 
       
  2811 	@return Number of UIDs in returned array, if operation is successful.
       
  2812 			Otherwise, a negative number representing a system wide error code.
       
  2813 
       
  2814 
       
  2815 	@pre Call in a thread context.
       
  2816     @pre Calling thread must be in a critical section.
       
  2817 
       
  2818 	@publishedPartner
       
  2819 	@released
       
  2820 	*/
       
  2821 	IMPORT_C static TInt Filter2(TUint32*& aUids, TInt& aGlobalFilter);
       
  2822 
       
  2823 
       
  2824 	/**
       
  2825 	Get the trace filter bit for the specified category.
       
  2826 
       
  2827 	@param aCategory A category value from enum BTrace::TCategory,
       
  2828 	@return The value of the filter for the category, 0 or 1.
       
  2829 			Or KErrNotSupported if this category is not supported by this build of the kernel.
       
  2830 
       
  2831 	@publishedPartner
       
  2832 	@released
       
  2833 	*/
       
  2834 	inline static TInt Filter(TUint aCategory);
       
  2835 
       
  2836 	/**
       
  2837 	Get a pointer to the spinlock used to serialise BTrace output on SMP systems.
       
  2838 
       
  2839 	@internalComponent
       
  2840 	*/
       
  2841 	IMPORT_C static TSpinLock* LockPtr();
       
  2842 
       
  2843 
       
  2844 	/**
       
  2845 	Enumeration of control functions which can be implemented by the BTrace handler.
       
  2846 
       
  2847 	These values are passed to #Control to indicate the requested operation and are
       
  2848 	passed unaltered to the BTrace implementation's control function as specified by
       
  2849 	SetHandlers().
       
  2850 
       
  2851 	@see #Control
       
  2852 	@see #TControlFunction
       
  2853 	*/
       
  2854 	enum TControl
       
  2855 		{
       
  2856 		/**
       
  2857 		Called to indicate that the system has crashed. Typical response to this call
       
  2858 		is to disable tracing so that debug monitor activity doesn't generate any additional
       
  2859 		trace.
       
  2860 
       
  2861 		As this function is called after the system is crashed its implementation must not
       
  2862 		make use of any APIs which require a running system, it must also not re-enable
       
  2863 		interrupts.
       
  2864 		
       
  2865 		ControlFunction argument meaning: None, ignore.
       
  2866 		
       
  2867 		ControlFunction returns nothing, ignore.
       
  2868 		*/
       
  2869 		ECtrlSystemCrashed,
       
  2870 
       
  2871 		/**
       
  2872 		Called by crash monitor to request first block of data from any memory resident
       
  2873 		trace buffer. A size of zero should be returned if the buffer is empty.
       
  2874 
       
  2875 		This should be a non-destructive operation if possible. I.e. the contents of the
       
  2876 		buffer should be capable of being read multiple times by issuing repeated
       
  2877 		ECtrlCrashReadFirst/ECtrlCrashReadNext sequences.
       
  2878 		
       
  2879 		As this function is called after the system is crashed its implementation must not
       
  2880 		make use of any APIs which require a running system, it must also not re-enable
       
  2881 		interrupts.
       
  2882 
       
  2883 		ControlFunction argument meaning:
       
  2884 		- aArg1 should be treated as a TUint8*& and set to the start address of the trace data.
       
  2885 		- aArg2 should be treated as a TUint& and set to the length of the trace data.
       
  2886 
       
  2887 		ControlFunction returns KErrNone if successful, otherwise one of the other system wide
       
  2888 		error codes.
       
  2889 		*/
       
  2890 		ECtrlCrashReadFirst,
       
  2891 		
       
  2892 		/**
       
  2893 		Called by crash monitor after using ECrashReadFirst, to request subsequent
       
  2894 		blocks of data from the trace buffer. A size of zero should be returned if
       
  2895 		the end of the buffer has been reached.
       
  2896 		
       
  2897 		As this function is called after the system is crashed its implementation must not
       
  2898 		make use of any APIs which require a running system, it must also not re-enable
       
  2899 		interrupts.
       
  2900 
       
  2901 		ControlFunction argument meaning:
       
  2902 		aArg1 should be treated as a TUint8** and set to the start address of the trace data.
       
  2903 		aArg2 should be treated as a TUint* and set to the length of the trace data.
       
  2904 		
       
  2905 		ControlFunction returns KErrNone if successful, otherwise one of the other system wide
       
  2906 		error codes.
       
  2907 		*/
       
  2908 		ECtrlCrashReadNext
       
  2909 		};
       
  2910 
       
  2911 	/**
       
  2912 	Prototype for function callback called by #Control.
       
  2913 	I.e. as set by SetHandlers().
       
  2914 	*/
       
  2915 	typedef TInt(*TControlFunction)(TControl aFunction, TAny* aArg1, TAny* aArg2);
       
  2916 
       
  2917 	/**
       
  2918 	Call the BTrace handlers control function to perform the function.
       
  2919 
       
  2920 	@param aFunction	A value from TControl specifying the requested operation.
       
  2921 	@param aArg1		First argument for the operation. See enum TControl.
       
  2922 	@param aArg1		Second argument for the operation. See enum TControl.
       
  2923 
       
  2924 	@return KErrNone if successful,
       
  2925 			KErrNotSupported if the function isn't supported.
       
  2926 			otherwise one of the other system wide error codes.
       
  2927 
       
  2928 	@see TControl.
       
  2929 	*/
       
  2930 	IMPORT_C static TInt Control(TControl aFunction, TAny* aArg1=0, TAny* aArg2=0);
       
  2931 
       
  2932 	/**
       
  2933 	Set both the function which will receive all trace records, and the
       
  2934 	control function which will be called by each use of #Control.
       
  2935 
       
  2936 	@param aNewHandler The new handler to receive trace.
       
  2937 	@param aNewControl The new handler for control functions.
       
  2938 	@param aOldHandler The trace handler which existed prior to this function being called.
       
  2939 	@param aOldControl The control handler which existed prior to this function being called.
       
  2940 	*/
       
  2941 	IMPORT_C static void SetHandlers(BTrace::THandler aNewHandler, BTrace::TControlFunction aNewControl, BTrace::THandler& aOldHandler, BTrace::TControlFunction& aOldControl);
       
  2942 
       
  2943 #endif //  __KERNEL_MODE__
       
  2944 
       
  2945 	/**
       
  2946 	Check the trace filters to see if a trace with a given category
       
  2947 	would be output.
       
  2948 
       
  2949 	@param aCategory  A category value from enum BTrace::TCategory.
       
  2950 					  Only the 8 least significant bits in this value are used;
       
  2951 					  other bits are ignored.
       
  2952 
       
  2953 	@return True if a trace with this specification would be passed by the filters.
       
  2954 			False if a trace with this specification would be dropped by the filters.
       
  2955 
       
  2956 	@publishedPartner
       
  2957 	@released
       
  2958 	*/
       
  2959 	IMPORT_C static TBool CheckFilter(TUint32 aCategory);
       
  2960 
       
  2961 	/**
       
  2962 	Check the trace filters to see if a trace with a given category
       
  2963 	and filter UID would be output.
       
  2964 
       
  2965 	@param aCategory  A category value from enum BTrace::TCategory.
       
  2966 					  Only the 8 least significant bits in this value are used;
       
  2967 					  other bits are ignored.
       
  2968 	@param aUid       A UID to filter on.
       
  2969 
       
  2970 	@return True if a trace with this specification would be passed by the filters.
       
  2971 			False if a trace with this specification would be dropped by the filters.
       
  2972 
       
  2973 	@publishedPartner
       
  2974 	@released
       
  2975 	*/
       
  2976 	IMPORT_C static TBool CheckFilter2(TUint32 aCategory,TUint32 aUid);
       
  2977 
       
  2978 	/**
       
  2979 	Common function for BTrace macros.
       
  2980 	@internalComponent
       
  2981 	*/
       
  2982 	IMPORT_C static TBool Out(TUint32 a0,TUint32 a1,TUint32 a2,TUint32 a3);
       
  2983 
       
  2984 	/**
       
  2985 	Common function for BTrace macros.
       
  2986 	@internalComponent
       
  2987 	*/
       
  2988 	IMPORT_C static TBool OutX(TUint32 a0,TUint32 a1,TUint32 a2,TUint32 a3);
       
  2989 
       
  2990 	/**
       
  2991 	Common function for BTrace macros.
       
  2992 	@internalComponent
       
  2993 	*/
       
  2994 	IMPORT_C static TBool OutN(TUint32 a0, TUint32 a1, TUint32 a2, const TAny* aData, TInt aDataSize);
       
  2995 
       
  2996 	/**
       
  2997 	Common function for BTrace macros.
       
  2998 	@internalComponent
       
  2999 	*/
       
  3000 	IMPORT_C static TBool OutNX(TUint32 a0, TUint32 a1, TUint32 a2, const TAny* aData, TInt aDataSize);
       
  3001 
       
  3002 	/**
       
  3003 	Common function for BTrace macros.
       
  3004 	@internalComponent
       
  3005 	*/
       
  3006 	IMPORT_C static TBool OutBig(TUint32 a0, TUint32 a1, const TAny* aData, TInt aDataSize);
       
  3007 
       
  3008 	/**
       
  3009 	Common function for BTrace macros.
       
  3010 	@internalComponent
       
  3011 	*/
       
  3012 	IMPORT_C static TBool OutFiltered(TUint32 a0,TUint32 a1,TUint32 a2,TUint32 a3);
       
  3013 
       
  3014 	/**
       
  3015 	Common function for BTrace macros.
       
  3016 	@internalComponent
       
  3017 	*/
       
  3018 	IMPORT_C static TBool OutFilteredX(TUint32 a0,TUint32 a1,TUint32 a2,TUint32 a3);
       
  3019 
       
  3020 	/**
       
  3021 	Common function for BTrace macros.
       
  3022 	@internalComponent
       
  3023 	*/
       
  3024 	IMPORT_C static TBool OutFilteredN(TUint32 a0, TUint32 a1, TUint32 a2, const TAny* aData, TInt aDataSize);
       
  3025 
       
  3026 	/**
       
  3027 	Common function for BTrace macros.
       
  3028 	@internalComponent
       
  3029 	*/
       
  3030 	IMPORT_C static TBool OutFilteredNX(TUint32 a0, TUint32 a1, TUint32 a2, const TAny* aData, TInt aDataSize);
       
  3031 
       
  3032 	/**
       
  3033 	Common function for BTrace macros.
       
  3034 	@internalComponent
       
  3035 	*/
       
  3036 	IMPORT_C static TBool OutFilteredBig(TUint32 a0, TUint32 a1, const TAny* aData, TInt aDataSize);
       
  3037 
       
  3038 	/**
       
  3039 	@internalComponent
       
  3040 	*/
       
  3041 	static void Init0();
       
  3042 
       
  3043 	/**
       
  3044 	@internalComponent
       
  3045 	*/
       
  3046 	typedef TBool(*TBTrace1)(TUint32);
       
  3047 
       
  3048 	/**
       
  3049 	@internalComponent
       
  3050 	*/
       
  3051 	typedef TBool(*TBTrace2)(TUint32,TUint32);
       
  3052 
       
  3053 	/**
       
  3054 	@internalComponent
       
  3055 	*/
       
  3056 	typedef TBool(*TBTrace3)(TUint32,TUint32,TUint32);
       
  3057 
       
  3058 	/**
       
  3059 	@internalComponent
       
  3060 	*/
       
  3061 	struct SExecExtension
       
  3062 		{
       
  3063 		TUint32	iA2;
       
  3064 		TUint32	iA3;
       
  3065 		TUint32	iPc;
       
  3066 		};
       
  3067 
       
  3068 	/**
       
  3069 	@internalComponent
       
  3070 	*/
       
  3071 	static TBool DoOutBig(TUint32 a0, TUint32 a1, const TAny* aData, TInt aDataSize, TUint32 aContext, TUint32 aPc);
       
  3072 
       
  3073 	/**
       
  3074 	@internalComponent
       
  3075 	*/
       
  3076 	static TUint32 BigTraceId;
       
  3077 
       
  3078 	/**
       
  3079 	@internalComponent
       
  3080 	*/
       
  3081 	static TBool IsSupported(TUint aCategory);
       
  3082 	};
       
  3083 
       
  3084 
       
  3085 /**
       
  3086 @internalComponent
       
  3087 */
       
  3088 class DBTraceFilter2
       
  3089 	{
       
  3090 public:
       
  3091 	TUint iNumUids;
       
  3092 	TInt iAccessCount;
       
  3093 	TUint32 iUids[1];
       
  3094 
       
  3095 	TBool Check(TUint32 aUid);
       
  3096 
       
  3097 	static DBTraceFilter2* New(TInt aNumUids);
       
  3098 	static DBTraceFilter2* Open(DBTraceFilter2*volatile& aFilter2);
       
  3099 	void Close();
       
  3100 
       
  3101 	DBTraceFilter2* iCleanupLink;
       
  3102 	static DBTraceFilter2* iCleanupHead;
       
  3103 	static void Cleanup();
       
  3104 	};
       
  3105 
       
  3106 
       
  3107 
       
  3108 
       
  3109 //
       
  3110 // BTraceX macros
       
  3111 //
       
  3112 
       
  3113 /**
       
  3114 @internalComponent
       
  3115 */
       
  3116 #define BTRACE_HEADER(aSize,aCategory,aSubCategory)			\
       
  3117 	(((aSize)<<BTrace::ESizeIndex*8)							\
       
  3118 	+((aCategory)<<BTrace::ECategoryIndex*8)					\
       
  3119 	+((aSubCategory)<<BTrace::ESubCategoryIndex*8))
       
  3120 
       
  3121 /**
       
  3122 @internalComponent
       
  3123 */
       
  3124 #define BTRACE_HEADER_C(aSize,aCategory,aSubCategory)		\
       
  3125 	((((aSize)+4)<<BTrace::ESizeIndex*8)						\
       
  3126 	+((BTrace::EContextIdPresent)<<BTrace::EFlagsIndex*8)	\
       
  3127 	+((aCategory)<<BTrace::ECategoryIndex*8)					\
       
  3128 	+((aSubCategory)<<BTrace::ESubCategoryIndex*8))
       
  3129 
       
  3130 /**
       
  3131 @internalComponent
       
  3132 */
       
  3133 #define BTRACE_HEADER_P(aSize,aCategory,aSubCategory)		\
       
  3134 	((((aSize)+4)<<BTrace::ESizeIndex*8)						\
       
  3135 	+((BTrace::EPcPresent)<<BTrace::EFlagsIndex*8)		\
       
  3136 	+((aCategory)<<BTrace::ECategoryIndex*8)					\
       
  3137 	+((aSubCategory)<<BTrace::ESubCategoryIndex*8))
       
  3138 
       
  3139 /**
       
  3140 @internalComponent
       
  3141 */
       
  3142 #define BTRACE_HEADER_CP(aSize,aCategory,aSubCategory)								\
       
  3143 	((((aSize)+8)<<BTrace::ESizeIndex*8)												\
       
  3144 	+((BTrace::EContextIdPresent|BTrace::EPcPresent)<<BTrace::EFlagsIndex*8)	\
       
  3145 	+((aCategory)<<BTrace::ECategoryIndex*8)											\
       
  3146 	+((aSubCategory)<<BTrace::ESubCategoryIndex*8))
       
  3147 
       
  3148 
       
  3149 
       
  3150 /**
       
  3151 Output a trace record of the specified category.
       
  3152 
       
  3153 The trace record data is 0 bytes in size.
       
  3154 
       
  3155 @param aCategory	A value from enum BTrace::TCategory,
       
  3156 @param aSubCategory Sub-category value between 0 and 255.
       
  3157 					The meaning of this is dependent on the Category.
       
  3158 
       
  3159 @return True if trace is enabled for aCategory, false otherwise.
       
  3160 @publishedPartner
       
  3161 @released
       
  3162 */
       
  3163 #define BTrace0(aCategory,aSubCategory) \
       
  3164 	((BTrace::TBTrace1)BTrace::Out) \
       
  3165 		(BTRACE_HEADER(4,(aCategory),(aSubCategory)))
       
  3166 
       
  3167 /**
       
  3168 Output a trace record of the specified category.
       
  3169 
       
  3170 The trace record data is 4 bytes in size.
       
  3171 
       
  3172 @param aCategory	A value from enum BTrace::TCategory,
       
  3173 @param aSubCategory Sub-category value between 0 and 255.
       
  3174 					The meaning of this is dependent on the Category.
       
  3175 @param a1			The 32bit quantity which forms the data of this trace record.
       
  3176 
       
  3177 @return True if trace is enabled for aCategory, false otherwise.
       
  3178 @publishedPartner
       
  3179 @released
       
  3180 */
       
  3181 #define BTrace4(aCategory,aSubCategory,a1) \
       
  3182 	((BTrace::TBTrace2)BTrace::Out) \
       
  3183 		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(a1))
       
  3184 
       
  3185 /**
       
  3186 Output a trace record of the specified category.
       
  3187 
       
  3188 The trace record data is 8 bytes in size.
       
  3189 
       
  3190 @param aCategory	A value from enum BTrace::TCategory,
       
  3191 @param aSubCategory Sub-category value between 0 and 255.
       
  3192 					The meaning of this is dependent on the Category.
       
  3193 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3194 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3195 
       
  3196 @return True if trace is enabled for aCategory, false otherwise.
       
  3197 @publishedPartner
       
  3198 @released
       
  3199 */
       
  3200 #define BTrace8(aCategory,aSubCategory,a1,a2) \
       
  3201 	((BTrace::TBTrace3)BTrace::Out) \
       
  3202 		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
       
  3203 
       
  3204 /**
       
  3205 Output a trace record of the specified category.
       
  3206 
       
  3207 The trace record data is 12 bytes in size.
       
  3208 
       
  3209 @param aCategory	A value from enum BTrace::TCategory,
       
  3210 @param aSubCategory Sub-category value between 0 and 255.
       
  3211 					The meaning of this is dependent on the Category.
       
  3212 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3213 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3214 @param a3			The third 32bit quantity which forms the data of this trace record.
       
  3215 
       
  3216 @return True if trace is enabled for aCategory, false otherwise.
       
  3217 @publishedPartner
       
  3218 @released
       
  3219 */
       
  3220 #define BTrace12(aCategory,aSubCategory,a1,a2,a3) \
       
  3221 	BTrace::Out \
       
  3222 		(BTRACE_HEADER(16,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),(TUint32)(a3))
       
  3223 
       
  3224 /**
       
  3225 Output a trace record of the specified category.
       
  3226 
       
  3227 @param aCategory	A value from enum BTrace::TCategory,
       
  3228 @param aSubCategory Sub-category value between 0 and 255.
       
  3229 					The meaning of this is dependent on the Category.
       
  3230 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3231 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3232 @param aData		Address of addition data to add to trace.
       
  3233 					Must be word aligned, i.e. a multiple of 4.
       
  3234 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3235 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3236 					flag ERecordTruncated is set in the record.
       
  3237 
       
  3238 @return True if trace is enabled for aCategory, false otherwise.
       
  3239 @publishedPartner
       
  3240 @released
       
  3241 */
       
  3242 #define BTraceN(aCategory,aSubCategory,a1,a2,aData,aDataSize) \
       
  3243 	BTrace::OutN \
       
  3244 		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),aData,aDataSize)
       
  3245 
       
  3246 /**
       
  3247 Output a trace record of the specified category.
       
  3248 
       
  3249 If the specified data is too big to find into a single trace record, then a
       
  3250 multipart trace is generated. See TMultiPart.
       
  3251 
       
  3252 @param aCategory	A value from enum BTrace::TCategory,
       
  3253 @param aSubCategory Sub-category value between 0 and 255.
       
  3254 					The meaning of this is dependent on the Category.
       
  3255 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3256 @param aData		Address of addition data to add to trace.
       
  3257 					Must be word aligned, i.e. a multiple of 4.
       
  3258 @param aDataSize	Number of bytes of additional data.
       
  3259 
       
  3260 @return True if trace is enabled for aCategory, false otherwise.
       
  3261 @publishedPartner
       
  3262 @released
       
  3263 */
       
  3264 #define BTraceBig(aCategory,aSubCategory,a1,aData,aDataSize) \
       
  3265 	BTrace::OutBig \
       
  3266 		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(a1),aData,(TInt)(aDataSize))
       
  3267 
       
  3268 
       
  3269 
       
  3270 /**
       
  3271 Output a trace record of the specified category.
       
  3272 
       
  3273 The trace record data is 0 bytes in size.
       
  3274 
       
  3275 @param aCategory	A value from enum BTrace::TCategory,
       
  3276 @param aSubCategory Sub-category value between 0 and 255.
       
  3277 					The meaning of this is dependent on the Category.
       
  3278 
       
  3279 @return True if trace is enabled for aCategory, false otherwise.
       
  3280 @publishedPartner
       
  3281 @released
       
  3282 */
       
  3283 #define BTraceContext0(aCategory,aSubCategory) \
       
  3284 	((BTrace::TBTrace1)BTrace::OutX) \
       
  3285 		(BTRACE_HEADER_C(4,(aCategory),(aSubCategory)))
       
  3286 
       
  3287 /**
       
  3288 Output a trace record of the specified category which also includes a Context ID.
       
  3289 
       
  3290 The trace record data is 4 bytes in size.
       
  3291 
       
  3292 @param aCategory	A value from enum BTrace::TCategory,
       
  3293 @param aSubCategory Sub-category value between 0 and 255.
       
  3294 					The meaning of this is dependent on the Category.
       
  3295 @param a1			The 32bit quantity which forms the data of this trace record.
       
  3296 
       
  3297 @return True if trace is enabled for aCategory, false otherwise.
       
  3298 @publishedPartner
       
  3299 @released
       
  3300 */
       
  3301 #define BTraceContext4(aCategory,aSubCategory,a1) \
       
  3302 	((BTrace::TBTrace2)BTrace::OutX) \
       
  3303 		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(a1))
       
  3304 
       
  3305 /**
       
  3306 Output a trace record of the specified category which also includes a Context ID.
       
  3307 
       
  3308 The trace record data is 8 bytes in size.
       
  3309 
       
  3310 @param aCategory	A value from enum BTrace::TCategory,
       
  3311 @param aSubCategory Sub-category value between 0 and 255.
       
  3312 					The meaning of this is dependent on the Category.
       
  3313 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3314 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3315 
       
  3316 @return True if trace is enabled for aCategory, false otherwise.
       
  3317 @publishedPartner
       
  3318 @released
       
  3319 */
       
  3320 #define BTraceContext8(aCategory,aSubCategory,a1,a2) \
       
  3321 	((BTrace::TBTrace3)BTrace::OutX) \
       
  3322 		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
       
  3323 
       
  3324 /**
       
  3325 Output a trace record of the specified category which also includes a Context ID.
       
  3326 
       
  3327 The trace record data is 12 bytes in size.
       
  3328 
       
  3329 @param aCategory	A value from enum BTrace::TCategory,
       
  3330 @param aSubCategory Sub-category value between 0 and 255.
       
  3331 					The meaning of this is dependent on the Category.
       
  3332 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3333 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3334 @param a3			The third 32bit quantity which forms the data of this trace record.
       
  3335 
       
  3336 @return True if trace is enabled for aCategory, false otherwise.
       
  3337 @publishedPartner
       
  3338 @released
       
  3339 */
       
  3340 #define BTraceContext12(aCategory,aSubCategory,a1,a2,a3) \
       
  3341 	BTrace::OutX \
       
  3342 		(BTRACE_HEADER_C(16,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),(TUint32)(a3))
       
  3343 
       
  3344 /**
       
  3345 Output a trace record of the specified category which also includes a Context ID.
       
  3346 
       
  3347 @param aCategory	A value from enum BTrace::TCategory,
       
  3348 @param aSubCategory Sub-category value between 0 and 255.
       
  3349 					The meaning of this is dependent on the Category.
       
  3350 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3351 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3352 @param aData		Address of addition data to add to trace.
       
  3353 					Must be word aligned, i.e. a multiple of 4.
       
  3354 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3355 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3356 					flag ERecordTruncated is set in the record.
       
  3357 
       
  3358 @return True if trace is enabled for aCategory, false otherwise.
       
  3359 @publishedPartner
       
  3360 @released
       
  3361 */
       
  3362 #define BTraceContextN(aCategory,aSubCategory,a1,a2,aData,aDataSize) \
       
  3363 	BTrace::OutNX \
       
  3364 		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),aData,aDataSize)
       
  3365 
       
  3366 /**
       
  3367 Output a trace record of the specified category which also includes a Context ID.
       
  3368 
       
  3369 If the specified data is too big to find into a single trace record, then a
       
  3370 multipart trace is generated. See TMultiPart.
       
  3371 
       
  3372 @param aCategory	A value from enum BTrace::TCategory,
       
  3373 @param aSubCategory Sub-category value between 0 and 255.
       
  3374 					The meaning of this is dependent on the Category.
       
  3375 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3376 @param aData		Address of addition data to add to trace.
       
  3377 					Must be word aligned, i.e. a multiple of 4.
       
  3378 @param aDataSize	Number of bytes of additional data.
       
  3379 
       
  3380 @return True if trace is enabled for aCategory, false otherwise.
       
  3381 @publishedPartner
       
  3382 @released
       
  3383 */
       
  3384 #define BTraceContextBig(aCategory,aSubCategory,a1,aData,aDataSize) \
       
  3385 	BTrace::OutBig \
       
  3386 		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(a1),aData,(TInt)(aDataSize))
       
  3387 
       
  3388 
       
  3389 
       
  3390 /**
       
  3391 Output a trace record of the specified category which also includes a Program Counter value.
       
  3392 
       
  3393 The trace record data is 0 bytes in size.
       
  3394 
       
  3395 @param aCategory	A value from enum BTrace::TCategory,
       
  3396 @param aSubCategory Sub-category value between 0 and 255.
       
  3397 					The meaning of this is dependent on the Category.
       
  3398 
       
  3399 @return True if trace is enabled for aCategory, false otherwise.
       
  3400 @publishedPartner
       
  3401 @released
       
  3402 */
       
  3403 #define BTracePc0(aCategory,aSubCategory) \
       
  3404 	((BTrace::TBTrace1)BTrace::Out) \
       
  3405 		(BTRACE_HEADER_P(4,(aCategory),(aSubCategory)))
       
  3406 
       
  3407 /**
       
  3408 Output a trace record of the specified category which also includes a Program Counter value.
       
  3409 
       
  3410 The trace record data is 4 bytes in size.
       
  3411 
       
  3412 @param aCategory	A value from enum BTrace::TCategory,
       
  3413 @param aSubCategory Sub-category value between 0 and 255.
       
  3414 					The meaning of this is dependent on the Category.
       
  3415 @param a1			The 32bit quantity which forms the data of this trace record.
       
  3416 
       
  3417 @return True if trace is enabled for aCategory, false otherwise.
       
  3418 @publishedPartner
       
  3419 @released
       
  3420 */
       
  3421 #define BTracePc4(aCategory,aSubCategory,a1)	\
       
  3422 	((BTrace::TBTrace2)BTrace::Out) \
       
  3423 		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(a1))
       
  3424 
       
  3425 /**
       
  3426 Output a trace record of the specified category which also includes a Program Counter value.
       
  3427 
       
  3428 The trace record data is 8 bytes in size.
       
  3429 
       
  3430 @param aCategory	A value from enum BTrace::TCategory,
       
  3431 @param aSubCategory Sub-category value between 0 and 255.
       
  3432 					The meaning of this is dependent on the Category.
       
  3433 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3434 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3435 
       
  3436 @return True if trace is enabled for aCategory, false otherwise.
       
  3437 @publishedPartner
       
  3438 @released
       
  3439 */
       
  3440 #define BTracePc8(aCategory,aSubCategory,a1,a2) \
       
  3441 	((BTrace::TBTrace3)BTrace::Out) \
       
  3442 		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
       
  3443 
       
  3444 /**
       
  3445 Output a trace record of the specified category which also includes a Program Counter value.
       
  3446 
       
  3447 The trace record data is 12 bytes in size.
       
  3448 
       
  3449 @param aCategory	A value from enum BTrace::TCategory,
       
  3450 @param aSubCategory Sub-category value between 0 and 255.
       
  3451 					The meaning of this is dependent on the Category.
       
  3452 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3453 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3454 @param a3			The third 32bit quantity which forms the data of this trace record.
       
  3455 
       
  3456 @return True if trace is enabled for aCategory, false otherwise.
       
  3457 @publishedPartner
       
  3458 @released
       
  3459 */
       
  3460 #define BTracePc12(aCategory,aSubCategory,a1,a2,a3) \
       
  3461 	BTrace::Out \
       
  3462 		(BTRACE_HEADER_P(16,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),(TUint32)(a3))
       
  3463 
       
  3464 /**
       
  3465 Output a trace record of the specified category which also includes a Program Counter value.
       
  3466 
       
  3467 @param aCategory	A value from enum BTrace::TCategory,
       
  3468 @param aSubCategory Sub-category value between 0 and 255.
       
  3469 					The meaning of this is dependent on the Category.
       
  3470 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3471 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3472 @param aData		Address of addition data to add to trace.
       
  3473 					Must be word aligned, i.e. a multiple of 4.
       
  3474 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3475 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3476 					flag ERecordTruncated is set in the record.
       
  3477 
       
  3478 @return True if trace is enabled for aCategory, false otherwise.
       
  3479 @publishedPartner
       
  3480 @released
       
  3481 */
       
  3482 #define BTracePcN(aCategory,aSubCategory,a1,a2,aData,aDataSize) \
       
  3483 	BTrace::OutN \
       
  3484 		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),aData,aDataSize)
       
  3485 
       
  3486 /**
       
  3487 Output a trace record of the specified category which also includes a Program Counter value.
       
  3488 
       
  3489 If the specified data is too big to find into a single trace record, then a
       
  3490 multipart trace is generated. See TMultiPart.
       
  3491 
       
  3492 @param aCategory	A value from enum BTrace::TCategory,
       
  3493 @param aSubCategory Sub-category value between 0 and 255.
       
  3494 					The meaning of this is dependent on the Category.
       
  3495 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3496 @param aData		Address of addition data to add to trace.
       
  3497 					Must be word aligned, i.e. a multiple of 4.
       
  3498 @param aDataSize	Number of bytes of additional data.
       
  3499 
       
  3500 @return True if trace is enabled for aCategory, false otherwise.
       
  3501 @publishedPartner
       
  3502 @released
       
  3503 */
       
  3504 #define BTracePcBig(aCategory,aSubCategory,a1,aData,aDataSize) \
       
  3505 	BTrace::OutBig \
       
  3506 		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(a1),aData,(TInt)(aDataSize))
       
  3507 
       
  3508 
       
  3509 
       
  3510 
       
  3511 /**
       
  3512 Output a trace record of the specified category which also includes
       
  3513 Context ID and Program Counter values.
       
  3514 
       
  3515 The trace record data is 0 bytes in size.
       
  3516 
       
  3517 @param aCategory	A value from enum BTrace::TCategory,
       
  3518 @param aSubCategory Sub-category value between 0 and 255.
       
  3519 					The meaning of this is dependent on the Category.
       
  3520 
       
  3521 @return True if trace is enabled for aCategory, false otherwise.
       
  3522 @publishedPartner
       
  3523 @released
       
  3524 */
       
  3525 #define BTraceContextPc0(aCategory,aSubCategory)	\
       
  3526 	((BTrace::TBTrace1)BTrace::OutX) \
       
  3527 		(BTRACE_HEADER_CP(4,(aCategory),(aSubCategory)))
       
  3528 
       
  3529 /**
       
  3530 Output a trace record of the specified category which also includes
       
  3531 Context ID and Program Counter values.
       
  3532 
       
  3533 The trace record data is 4 bytes in size.
       
  3534 
       
  3535 @param aCategory	A value from enum BTrace::TCategory,
       
  3536 @param aSubCategory Sub-category value between 0 and 255.
       
  3537 					The meaning of this is dependent on the Category.
       
  3538 @param a1			The 32bit quantity which forms the data of this trace record.
       
  3539 
       
  3540 @return True if trace is enabled for aCategory, false otherwise.
       
  3541 @publishedPartner
       
  3542 @released
       
  3543 */
       
  3544 #define BTraceContextPc4(aCategory,aSubCategory,a1)	\
       
  3545 	((BTrace::TBTrace2)BTrace::OutX) \
       
  3546 		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(a1))
       
  3547 
       
  3548 /**
       
  3549 Output a trace record of the specified category which also includes
       
  3550 Context ID and Program Counter values.
       
  3551 
       
  3552 The trace record data is 8 bytes in size.
       
  3553 
       
  3554 @param aCategory	A value from enum BTrace::TCategory,
       
  3555 @param aSubCategory Sub-category value between 0 and 255.
       
  3556 					The meaning of this is dependent on the Category.
       
  3557 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3558 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3559 
       
  3560 @return True if trace is enabled for aCategory, false otherwise.
       
  3561 @publishedPartner
       
  3562 @released
       
  3563 */
       
  3564 #define BTraceContextPc8(aCategory,aSubCategory,a1,a2) \
       
  3565 	((BTrace::TBTrace3)BTrace::OutX) \
       
  3566 		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
       
  3567 
       
  3568 /**
       
  3569 Output a trace record of the specified category which also includes
       
  3570 Context ID and Program Counter values.
       
  3571 
       
  3572 The trace record data is 12 bytes in size.
       
  3573 
       
  3574 @param aCategory	A value from enum BTrace::TCategory,
       
  3575 @param aSubCategory Sub-category value between 0 and 255.
       
  3576 					The meaning of this is dependent on the Category.
       
  3577 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3578 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3579 @param a3			The third 32bit quantity which forms the data of this trace record.
       
  3580 
       
  3581 @return True if trace is enabled for aCategory, false otherwise.
       
  3582 @publishedPartner
       
  3583 @released
       
  3584 */
       
  3585 #define BTraceContextPc12(aCategory,aSubCategory,a1,a2,a3) \
       
  3586 	BTrace::OutX \
       
  3587 		(BTRACE_HEADER_CP(16,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),(TUint32)(a3))
       
  3588 
       
  3589 /**
       
  3590 Output a trace record of the specified category which also includes
       
  3591 Context ID and Program Counter values.
       
  3592 
       
  3593 @param aCategory	A value from enum BTrace::TCategory,
       
  3594 @param aSubCategory Sub-category value between 0 and 255.
       
  3595 					The meaning of this is dependent on the Category.
       
  3596 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3597 @param a2			The second 32bit quantity which forms the data of this trace record.
       
  3598 @param aData		Address of addition data to add to trace.
       
  3599 					Must be word aligned, i.e. a multiple of 4.
       
  3600 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3601 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3602 					flag ERecordTruncated is set in the record.
       
  3603 
       
  3604 @return True if trace is enabled for aCategory, false otherwise.
       
  3605 @publishedPartner
       
  3606 @released
       
  3607 */
       
  3608 #define BTraceContextPcN(aCategory,aSubCategory,a1,a2,aData,aDataSize) \
       
  3609 	BTrace::OutNX \
       
  3610 		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),aData,aDataSize)
       
  3611 
       
  3612 /**
       
  3613 Output a trace record of the specified category which also includes
       
  3614 Context ID and Program Counter values.
       
  3615 
       
  3616 If the specified data is too big to find into a single trace record, then a
       
  3617 multipart trace is generated. See TMultiPart.
       
  3618 
       
  3619 @param aCategory	A value from enum BTrace::TCategory,
       
  3620 @param aSubCategory Sub-category value between 0 and 255.
       
  3621 					The meaning of this is dependent on the Category.
       
  3622 @param a1			The first 32bit quantity which forms the data of this trace record.
       
  3623 @param aData		Address of addition data to add to trace.
       
  3624 					Must be word aligned, i.e. a multiple of 4.
       
  3625 @param aDataSize	Number of bytes of additional data.
       
  3626 
       
  3627 @return True if trace is enabled for aCategory, false otherwise.
       
  3628 @publishedPartner
       
  3629 @released
       
  3630 */
       
  3631 #define BTraceContextPcBig(aCategory,aSubCategory,a1,aData,aDataSize) \
       
  3632 	BTrace::OutBig \
       
  3633 		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(a1),aData,(TInt)(aDataSize))
       
  3634 
       
  3635 
       
  3636 
       
  3637 /**
       
  3638 Output a trace record of the specified category.
       
  3639 
       
  3640 The trace record data is 4 bytes in size.
       
  3641 
       
  3642 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3643 
       
  3644 @param aCategory	A value from enum BTrace::TCategory,
       
  3645 @param aSubCategory Sub-category value between 0 and 255.
       
  3646 					The meaning of this is dependent on the Category.
       
  3647 @param aUid			The 32bit quantity which forms the data of this trace record.
       
  3648 
       
  3649 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3650 @publishedPartner
       
  3651 @released
       
  3652 */
       
  3653 #define BTraceFiltered4(aCategory,aSubCategory,aUid) \
       
  3654 	((BTrace::TBTrace2)BTrace::OutFiltered) \
       
  3655 		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
       
  3656 
       
  3657 /**
       
  3658 Output a trace record of the specified category.
       
  3659 
       
  3660 The trace record data is 8 bytes in size.
       
  3661 
       
  3662 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3663 
       
  3664 @param aCategory	A value from enum BTrace::TCategory,
       
  3665 @param aSubCategory Sub-category value between 0 and 255.
       
  3666 					The meaning of this is dependent on the Category.
       
  3667 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3668 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3669 
       
  3670 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3671 @publishedPartner
       
  3672 @released
       
  3673 */
       
  3674 #define BTraceFiltered8(aCategory,aSubCategory,aUid,a1) \
       
  3675 	((BTrace::TBTrace3)BTrace::OutFiltered) \
       
  3676 		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
       
  3677 
       
  3678 /**
       
  3679 Output a trace record of the specified category.
       
  3680 
       
  3681 The trace record data is 12 bytes in size.
       
  3682 
       
  3683 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3684 
       
  3685 @param aCategory	A value from enum BTrace::TCategory,
       
  3686 @param aSubCategory Sub-category value between 0 and 255.
       
  3687 					The meaning of this is dependent on the Category.
       
  3688 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3689 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3690 @param a2			The third 32bit quantity which forms the data of this trace record.
       
  3691 
       
  3692 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3693 @publishedPartner
       
  3694 @released
       
  3695 */
       
  3696 #define BTraceFiltered12(aCategory,aSubCategory,aUid,a1,a2) \
       
  3697 	BTrace::OutFiltered \
       
  3698 		(BTRACE_HEADER(16,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),(TUint32)(a2))
       
  3699 
       
  3700 /**
       
  3701 Output a trace record of the specified category.
       
  3702 
       
  3703 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3704 
       
  3705 @param aCategory	A value from enum BTrace::TCategory,
       
  3706 @param aSubCategory Sub-category value between 0 and 255.
       
  3707 					The meaning of this is dependent on the Category.
       
  3708 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3709 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3710 @param aData		Address of addition data to add to trace.
       
  3711 					Must be word aligned, i.e. a multiple of 4.
       
  3712 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3713 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3714 					flag ERecordTruncated is set in the record.
       
  3715 
       
  3716 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3717 @publishedPartner
       
  3718 @released
       
  3719 */
       
  3720 #define BTraceFilteredN(aCategory,aSubCategory,aUid,a1,aData,aDataSize) \
       
  3721 	BTrace::OutFilteredN \
       
  3722 		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),aData,aDataSize)
       
  3723 
       
  3724 /**
       
  3725 Output a trace record of the specified category.
       
  3726 
       
  3727 If the specified data is too big to find into a single trace record, then a
       
  3728 multipart trace is generated. See TMultiPart.
       
  3729 
       
  3730 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3731 
       
  3732 @param aCategory	A value from enum BTrace::TCategory,
       
  3733 @param aSubCategory Sub-category value between 0 and 255.
       
  3734 					The meaning of this is dependent on the Category.
       
  3735 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3736 @param aData		Address of addition data to add to trace.
       
  3737 					Must be word aligned, i.e. a multiple of 4.
       
  3738 @param aDataSize	Number of bytes of additional data.
       
  3739 
       
  3740 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3741 @publishedPartner
       
  3742 @released
       
  3743 */
       
  3744 #define BTraceFilteredBig(aCategory,aSubCategory,aUid,aData,aDataSize) \
       
  3745 	BTrace::OutFilteredBig \
       
  3746 		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(aUid),aData,(TInt)(aDataSize))
       
  3747 
       
  3748 
       
  3749 
       
  3750 /**
       
  3751 Output a trace record of the specified category which also includes a Context ID.
       
  3752 
       
  3753 The trace record data is 4 bytes in size.
       
  3754 
       
  3755 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3756 
       
  3757 @param aCategory	A value from enum BTrace::TCategory,
       
  3758 @param aSubCategory Sub-category value between 0 and 255.
       
  3759 					The meaning of this is dependent on the Category.
       
  3760 @param aUid			The 32bit quantity which forms the data of this trace record.
       
  3761 
       
  3762 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3763 @publishedPartner
       
  3764 @released
       
  3765 */
       
  3766 #define BTraceFilteredContext4(aCategory,aSubCategory,aUid) \
       
  3767 	((BTrace::TBTrace2)BTrace::OutFilteredX) \
       
  3768 		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
       
  3769 
       
  3770 /**
       
  3771 Output a trace record of the specified category which also includes a Context ID.
       
  3772 
       
  3773 The trace record data is 8 bytes in size.
       
  3774 
       
  3775 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3776 
       
  3777 @param aCategory	A value from enum BTrace::TCategory,
       
  3778 @param aSubCategory Sub-category value between 0 and 255.
       
  3779 					The meaning of this is dependent on the Category.
       
  3780 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3781 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3782 
       
  3783 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3784 @publishedPartner
       
  3785 @released
       
  3786 */
       
  3787 #define BTraceFilteredContext8(aCategory,aSubCategory,aUid,a1) \
       
  3788 	((BTrace::TBTrace3)BTrace::OutFilteredX) \
       
  3789 		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
       
  3790 
       
  3791 /**
       
  3792 Output a trace record of the specified category which also includes a Context ID.
       
  3793 
       
  3794 The trace record data is 12 bytes in size.
       
  3795 
       
  3796 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3797 
       
  3798 @param aCategory	A value from enum BTrace::TCategory,
       
  3799 @param aSubCategory Sub-category value between 0 and 255.
       
  3800 					The meaning of this is dependent on the Category.
       
  3801 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3802 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3803 @param a2			The third 32bit quantity which forms the data of this trace record.
       
  3804 
       
  3805 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3806 @publishedPartner
       
  3807 @released
       
  3808 */
       
  3809 #define BTraceFilteredContext12(aCategory,aSubCategory,aUid,a1,a2) \
       
  3810 	BTrace::OutFilteredX \
       
  3811 		(BTRACE_HEADER_C(16,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),(TUint32)(a2))
       
  3812 
       
  3813 /**
       
  3814 Output a trace record of the specified category which also includes a Context ID.
       
  3815 
       
  3816 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3817 
       
  3818 @param aCategory	A value from enum BTrace::TCategory,
       
  3819 @param aSubCategory Sub-category value between 0 and 255.
       
  3820 					The meaning of this is dependent on the Category.
       
  3821 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3822 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3823 @param aData		Address of addition data to add to trace.
       
  3824 					Must be word aligned, i.e. a multiple of 4.
       
  3825 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3826 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3827 					flag ERecordTruncated is set in the record.
       
  3828 
       
  3829 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3830 @publishedPartner
       
  3831 @released
       
  3832 */
       
  3833 #define BTraceFilteredContextN(aCategory,aSubCategory,aUid,a1,aData,aDataSize) \
       
  3834 	BTrace::OutFilteredNX \
       
  3835 		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),aData,aDataSize)
       
  3836 
       
  3837 /**
       
  3838 Output a trace record of the specified category which also includes a Context ID.
       
  3839 
       
  3840 If the specified data is too big to find into a single trace record, then a
       
  3841 multipart trace is generated. See TMultiPart.
       
  3842 
       
  3843 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3844 
       
  3845 @param aCategory	A value from enum BTrace::TCategory,
       
  3846 @param aSubCategory Sub-category value between 0 and 255.
       
  3847 					The meaning of this is dependent on the Category.
       
  3848 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3849 @param aData		Address of addition data to add to trace.
       
  3850 					Must be word aligned, i.e. a multiple of 4.
       
  3851 @param aDataSize	Number of bytes of additional data.
       
  3852 
       
  3853 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3854 @publishedPartner
       
  3855 @released
       
  3856 */
       
  3857 #define BTraceFilteredContextBig(aCategory,aSubCategory,aUid,aData,aDataSize) \
       
  3858 	BTrace::OutFilteredBig \
       
  3859 		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(aUid),aData,(TInt)(aDataSize))
       
  3860 
       
  3861 
       
  3862 
       
  3863 /**
       
  3864 Output a trace record of the specified category which also includes a Program Counter value.
       
  3865 
       
  3866 The trace record data is 4 bytes in size.
       
  3867 
       
  3868 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3869 
       
  3870 @param aCategory	A value from enum BTrace::TCategory,
       
  3871 @param aSubCategory Sub-category value between 0 and 255.
       
  3872 					The meaning of this is dependent on the Category.
       
  3873 @param aUid			The 32bit quantity which forms the data of this trace record.
       
  3874 
       
  3875 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3876 @publishedPartner
       
  3877 @released
       
  3878 */
       
  3879 #define BTraceFilteredPc4(aCategory,aSubCategory,aUid)	\
       
  3880 	((BTrace::TBTrace2)BTrace::OutFiltered) \
       
  3881 		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
       
  3882 
       
  3883 /**
       
  3884 Output a trace record of the specified category which also includes a Program Counter value.
       
  3885 
       
  3886 The trace record data is 8 bytes in size.
       
  3887 
       
  3888 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3889 
       
  3890 @param aCategory	A value from enum BTrace::TCategory,
       
  3891 @param aSubCategory Sub-category value between 0 and 255.
       
  3892 					The meaning of this is dependent on the Category.
       
  3893 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3894 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3895 
       
  3896 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3897 @publishedPartner
       
  3898 @released
       
  3899 */
       
  3900 #define BTraceFilteredPc8(aCategory,aSubCategory,aUid,a1) \
       
  3901 	((BTrace::TBTrace3)BTrace::OutFiltered) \
       
  3902 		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
       
  3903 
       
  3904 /**
       
  3905 Output a trace record of the specified category which also includes a Program Counter value.
       
  3906 
       
  3907 The trace record data is 12 bytes in size.
       
  3908 
       
  3909 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3910 
       
  3911 @param aCategory	A value from enum BTrace::TCategory,
       
  3912 @param aSubCategory Sub-category value between 0 and 255.
       
  3913 					The meaning of this is dependent on the Category.
       
  3914 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3915 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3916 @param a2			The third 32bit quantity which forms the data of this trace record.
       
  3917 
       
  3918 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3919 @publishedPartner
       
  3920 @released
       
  3921 */
       
  3922 #define BTraceFilteredPc12(aCategory,aSubCategory,aUid,a1,a2) \
       
  3923 	BTrace::OutFiltered \
       
  3924 		(BTRACE_HEADER_P(16,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),(TUint32)(a2))
       
  3925 
       
  3926 /**
       
  3927 Output a trace record of the specified category which also includes a Program Counter value.
       
  3928 
       
  3929 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3930 
       
  3931 @param aCategory	A value from enum BTrace::TCategory,
       
  3932 @param aSubCategory Sub-category value between 0 and 255.
       
  3933 					The meaning of this is dependent on the Category.
       
  3934 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3935 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  3936 @param aData		Address of addition data to add to trace.
       
  3937 					Must be word aligned, i.e. a multiple of 4.
       
  3938 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  3939 					KMaxBTraceDataArray then data is truncated to this size and the
       
  3940 					flag ERecordTruncated is set in the record.
       
  3941 
       
  3942 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3943 @publishedPartner
       
  3944 @released
       
  3945 */
       
  3946 #define BTraceFilteredPcN(aCategory,aSubCategory,aUid,a1,aData,aDataSize) \
       
  3947 	BTrace::OutFilteredN \
       
  3948 		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),aData,aDataSize)
       
  3949 
       
  3950 /**
       
  3951 Output a trace record of the specified category which also includes a Program Counter value.
       
  3952 
       
  3953 If the specified data is too big to find into a single trace record, then a
       
  3954 multipart trace is generated. See TMultiPart.
       
  3955 
       
  3956 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3957 
       
  3958 @param aCategory	A value from enum BTrace::TCategory,
       
  3959 @param aSubCategory Sub-category value between 0 and 255.
       
  3960 					The meaning of this is dependent on the Category.
       
  3961 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  3962 @param aData		Address of addition data to add to trace.
       
  3963 					Must be word aligned, i.e. a multiple of 4.
       
  3964 @param aDataSize	Number of bytes of additional data.
       
  3965 
       
  3966 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3967 @publishedPartner
       
  3968 @released
       
  3969 */
       
  3970 #define BTraceFilteredPcBig(aCategory,aSubCategory,aUid,aData,aDataSize) \
       
  3971 	BTrace::OutFilteredBig \
       
  3972 		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(aUid),aData,(TInt)(aDataSize))
       
  3973 
       
  3974 
       
  3975 
       
  3976 
       
  3977 /**
       
  3978 Output a trace record of the specified category which also includes
       
  3979 Context ID and Program Counter values.
       
  3980 
       
  3981 The trace record data is 4 bytes in size.
       
  3982 
       
  3983 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  3984 
       
  3985 @param aCategory	A value from enum BTrace::TCategory,
       
  3986 @param aSubCategory Sub-category value between 0 and 255.
       
  3987 					The meaning of this is dependent on the Category.
       
  3988 @param aUid			The 32bit quantity which forms the data of this trace record.
       
  3989 
       
  3990 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  3991 @publishedPartner
       
  3992 @released
       
  3993 */
       
  3994 #define BTraceFilteredContextPc4(aCategory,aSubCategory,aUid)	\
       
  3995 	((BTrace::TBTrace2)BTrace::OutFilteredX) \
       
  3996 		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
       
  3997 
       
  3998 /**
       
  3999 Output a trace record of the specified category which also includes
       
  4000 Context ID and Program Counter values.
       
  4001 
       
  4002 The trace record data is 8 bytes in size.
       
  4003 
       
  4004 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  4005 
       
  4006 @param aCategory	A value from enum BTrace::TCategory,
       
  4007 @param aSubCategory Sub-category value between 0 and 255.
       
  4008 					The meaning of this is dependent on the Category.
       
  4009 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  4010 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  4011 
       
  4012 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  4013 @publishedPartner
       
  4014 @released
       
  4015 */
       
  4016 #define BTraceFilteredContextPc8(aCategory,aSubCategory,aUid,a1) \
       
  4017 	((BTrace::TBTrace3)BTrace::OutFilteredX) \
       
  4018 		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
       
  4019 
       
  4020 /**
       
  4021 Output a trace record of the specified category which also includes
       
  4022 Context ID and Program Counter values.
       
  4023 
       
  4024 The trace record data is 12 bytes in size.
       
  4025 
       
  4026 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  4027 
       
  4028 @param aCategory	A value from enum BTrace::TCategory,
       
  4029 @param aSubCategory Sub-category value between 0 and 255.
       
  4030 					The meaning of this is dependent on the Category.
       
  4031 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  4032 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  4033 @param a2			The third 32bit quantity which forms the data of this trace record.
       
  4034 
       
  4035 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  4036 @publishedPartner
       
  4037 @released
       
  4038 */
       
  4039 #define BTraceFilteredContextPc12(aCategory,aSubCategory,aUid,a1,a2) \
       
  4040 	BTrace::OutFilteredX \
       
  4041 		(BTRACE_HEADER_CP(16,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),(TUint32)(a2))
       
  4042 
       
  4043 /**
       
  4044 Output a trace record of the specified category which also includes
       
  4045 Context ID and Program Counter values.
       
  4046 
       
  4047 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  4048 
       
  4049 @param aCategory	A value from enum BTrace::TCategory,
       
  4050 @param aSubCategory Sub-category value between 0 and 255.
       
  4051 					The meaning of this is dependent on the Category.
       
  4052 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  4053 @param a1			The second 32bit quantity which forms the data of this trace record.
       
  4054 @param aData		Address of addition data to add to trace.
       
  4055 					Must be word aligned, i.e. a multiple of 4.
       
  4056 @param aDataSize	Number of bytes of additional data. If this value is greater than
       
  4057 					KMaxBTraceDataArray then data is truncated to this size and the
       
  4058 					flag ERecordTruncated is set in the record.
       
  4059 
       
  4060 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  4061 @publishedPartner
       
  4062 @released
       
  4063 */
       
  4064 #define BTraceFilteredContextPcN(aCategory,aSubCategory,aUid,a1,aData,aDataSize) \
       
  4065 	BTrace::OutFilteredNX \
       
  4066 		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),aData,aDataSize)
       
  4067 
       
  4068 /**
       
  4069 Output a trace record of the specified category which also includes
       
  4070 Context ID and Program Counter values.
       
  4071 
       
  4072 If the specified data is too big to find into a single trace record, then a
       
  4073 multipart trace is generated. See TMultiPart.
       
  4074 
       
  4075 If the value of \a aUid is not contained in the secondary filter then the trace is discarded.
       
  4076 
       
  4077 @param aCategory	A value from enum BTrace::TCategory,
       
  4078 @param aSubCategory Sub-category value between 0 and 255.
       
  4079 					The meaning of this is dependent on the Category.
       
  4080 @param aUid			The first 32bit quantity which forms the data of this trace record.
       
  4081 @param aData		Address of addition data to add to trace.
       
  4082 					Must be word aligned, i.e. a multiple of 4.
       
  4083 @param aDataSize	Number of bytes of additional data.
       
  4084 
       
  4085 @return True if trace is enabled for aCategory and aUid, false otherwise.
       
  4086 @publishedPartner
       
  4087 @released
       
  4088 */
       
  4089 #define BTraceFilteredContextPcBig(aCategory,aSubCategory,aUid,aData,aDataSize) \
       
  4090 	BTrace::OutFilteredBig \
       
  4091 		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(aUid),aData,(TInt)(aDataSize))
       
  4092 
       
  4093 
       
  4094 
       
  4095 //
       
  4096 // Inline methods
       
  4097 //
       
  4098 
       
  4099 inline TUint8* BTrace::NextRecord(TAny* aCurrentRecord)
       
  4100 	{
       
  4101 	TUint size = ((TUint8*)aCurrentRecord)[ESizeIndex];
       
  4102 	*(TUint*)&aCurrentRecord += 3;
       
  4103 	*(TUint*)&aCurrentRecord += size;
       
  4104 	*(TUint*)&aCurrentRecord &= ~3;
       
  4105 	return (TUint8*)aCurrentRecord;
       
  4106 	}
       
  4107 
       
  4108 #ifdef __KERNEL_MODE__
       
  4109 
       
  4110 inline TInt BTrace::Filter(TUint aCategory)
       
  4111 	{
       
  4112 	return SetFilter(aCategory,-1);
       
  4113 	}
       
  4114 
       
  4115 #endif
       
  4116 
       
  4117 /**
       
  4118 The maximum permissible value for aDataSize in trace outputs.
       
  4119 @see BTraceN BTracePcN BTraceContextN BTraceContextPcN
       
  4120 @publishedPartner
       
  4121 @released
       
  4122 */
       
  4123 const TUint KMaxBTraceDataArray = 80;
       
  4124 
       
  4125 
       
  4126 
       
  4127 /**
       
  4128 The maximum total number of bytes in a trace record.
       
  4129 @publishedPartner
       
  4130 @released
       
  4131 */
       
  4132 const TInt KMaxBTraceRecordSize = 7*4+8+KMaxBTraceDataArray;
       
  4133 
       
  4134 
       
  4135 #ifdef __MARM__
       
  4136 #define BTRACE_MACHINE_CODED
       
  4137 #endif
       
  4138 
       
  4139 #endif