tracesrv/tracecore/btrace_handler/inc/TraceCoreConstants.h
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // TraceCore constants
       
    15 //
       
    16 // @internalTechnology
       
    17 // Please do not use this header file as its content may chnage in future.
       
    18 //
       
    19 
       
    20 #ifndef __TRACECORECONSTANTS_H__
       
    21 #define __TRACECORECONSTANTS_H__
       
    22 
       
    23 #include <opensystemtrace_types.h>
       
    24 
       
    25 
       
    26 /**
       
    27  * Enables statistics of media writer
       
    28  */
       
    29 #define MEDIA_WRITER_STATISTICS
       
    30 
       
    31 /**
       
    32  * Disables printf traces from media writer
       
    33  */
       
    34 // #define MEDIA_WRITER_TRACE_DEBUG
       
    35 
       
    36 /**
       
    37  * Trace bitmap default value
       
    38  * 0xff -> All traces enabled at boot
       
    39  * 0x00 -> All traces disabled at boot
       
    40  */
       
    41 const TUint8 KDefaultTraceBitmapByte = 0x00;
       
    42 
       
    43 /**
       
    44  * Byte size
       
    45  */
       
    46 const TInt KByteSize = 8;
       
    47 
       
    48 /**
       
    49  * Byte mask
       
    50  */
       
    51 const TUint KByteMask = 0xFF;
       
    52 
       
    53 /** 
       
    54  * Default DFC queue priority
       
    55  */
       
    56 const TUint8 KDefaultDfcPriority = 3; 
       
    57 
       
    58 /**
       
    59  * BTrace category ID for Autogen traces
       
    60  */
       
    61 const TUint KCategoryNokiaAutogen = 0xA0;
       
    62 
       
    63 /**
       
    64  * BTrace category ID for branch coverage traces
       
    65  */
       
    66 const TUint KCategoryNokiaBranchCoverage = 0xA1;
       
    67 
       
    68 /**
       
    69  * OST component UID for Symbian kernel hooks
       
    70  */
       
    71 const TUint32 KKernelHooksOSTComponentUID = 0x2001022D;
       
    72 
       
    73 /**
       
    74  * OST component UID for Autogen traces
       
    75  */
       
    76 const TUint32 KOldNokiaAutogenOSTComponentUID = 0;
       
    77 
       
    78 /**
       
    79  * Constants for BTrace header
       
    80  */
       
    81 const TUint KHeaderSize = 4;
       
    82 const TUint KHeader2Size = 4;
       
    83 const TUint KTimestampSize = 4;
       
    84 const TUint KContextIdSize = 4;
       
    85 const TUint KExtraSize = 4;
       
    86 const TUint KPcSize = 4;
       
    87 const TUint KA1Size = 4;
       
    88 const TUint KA2Size = 4;
       
    89 const TUint KA3Size = 4;
       
    90 const TUint KComponentIDSize = 4;
       
    91 
       
    92 /**
       
    93  * Number of categories in BTrace
       
    94  */
       
    95 const TInt KBTraceCategoryCount = 256;
       
    96 
       
    97 /**
       
    98  * Represents all groups of a component when registering with notifier
       
    99  */
       
   100 const TUint KAllGroups = 0;
       
   101 
       
   102 
       
   103 #ifdef __WINS__
       
   104 /**
       
   105  * Endian swapper for trace ID's
       
   106  */
       
   107 #define SWAP_DATA( num ) ( num )
       
   108 
       
   109 /**
       
   110  * Endian swapper for trace data
       
   111  */
       
   112 #define SWAP_ID( num ) ( \
       
   113     ( ( ( num ) & 0xff000000 ) >> 24 ) | ( ( ( num ) & 0x00ff0000 ) >> 8  ) | \
       
   114     ( ( ( num ) & 0x0000ff00 ) <<  8 ) | ( ( ( num ) & 0x000000ff ) << 24 ) )
       
   115 
       
   116 #else
       
   117 
       
   118 
       
   119 /**
       
   120  * Endian swapper for trace ID's
       
   121  */
       
   122 #define SWAP_ID( num ) ( num )
       
   123 
       
   124 /**
       
   125  * Endian swapper for trace data
       
   126  */
       
   127 #define SWAP_DATA( num ) ( \
       
   128     ( ( ( num ) & 0xff000000 ) >> 24 ) | ( ( ( num ) & 0x00ff0000 ) >> 8  ) | \
       
   129     ( ( ( num ) & 0x0000ff00 ) <<  8 ) | ( ( ( num ) & 0x000000ff ) << 24 ) )
       
   130 #endif
       
   131 
       
   132 const TUint8 KMinKernelCategory = BTrace::EThreadIdentification;
       
   133 
       
   134 const TUint8 KMaxKernelCategory = BTrace::EPlatformSpecificFirst - 1;
       
   135 
       
   136 const TUint8 KMaxCategory = KMaxGroupId;
       
   137 
       
   138 
       
   139 #endif
       
   140 
       
   141 // End of File