bluetoothengine/btui/inc/traceconfig.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0""
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *   
       
    16  */
       
    17 #ifndef BLUETOOTHTRACECONFIG_H
       
    18 #define BLUETOOTHTRACECONFIG_H
       
    19 
       
    20 /*
       
    21 Sample usage:
       
    22     void testTracing() 
       
    23     {
       
    24         BOstrace0( TRACE_FATAL, TNAME_DEVLIST_1, "BOstrace0" );
       
    25         BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_2, "BOstrace1 %d", 123 );
       
    26         _LIT(String, "\"Symbian Descriptor\"");
       
    27         TPtrC ptr(String);
       
    28         TBuf<20> buf(ptr);
       
    29         BOstraceExt1( TRACE_NORMAL, TNAME_DEVLIST_3, "BOstraceExt1 %S",  &ptr);
       
    30         BOstraceExt2( TRACE_API, TNAME_DEVLIST_4, "BOstraceExt2 %d %S", 456, &ptr );
       
    31         BOstraceExt3( TRACE_FLOW, TNAME_DEVLIST, "BOstraceExt3 0x%x %d %S", 128, 256, &ptr );
       
    32         BOstraceExt4( TRACE_DETAILED, TNAME_DEVL_5IST, "BOstraceExt4 0x%x %d %S %S", 128, 256, &ptr, &buf );
       
    33         BOstraceExt5( TRACE_DEBUG, TNAME_DEVLIST_6, "BOstraceExt5 0x%x %d %S %S, %b", 128, 256, &ptr, &buf, 512 );
       
    34         BOstraceFunctionEntry0( TNAME_DEVLIST_7 );
       
    35         BOstraceFunctionEntry1( TNAME_DEVLIST_8, 0x00abcdef );
       
    36         BOstraceFunctionEntryExt(TNAME_DEVLIST_9, 0xdeadbeef, 123 );
       
    37         BOstraceFunctionExit0( TNAME_DEVLIST_9 );
       
    38         BOstraceFunctionExit1( TNAME_DEVLIST_10, 0x00beebee );
       
    39         BOstraceFunctionExitExt(TNAME_DEVLIST_11, 0x00badbed, -1);
       
    40         BOstraceEventStart0( TNAME_DEVLIST_12, "BOstraceEventStart0" );
       
    41         BOstraceEventStart1( TNAME_DEVLIST_13, "BOstraceEventStart1", 789 );
       
    42         BOstraceEventStop( TNAME_DEVLIST_14, "BOstraceEventStop" );
       
    43         BOstraceState0( TNAME_DEVLIST_15, "connection state", 1 );
       
    44         BOstraceState1( TNAME_DEVLIST_16, "audio state", 2, 0xdeadbeef );
       
    45         BtTraceBlock( 
       
    46                 for (int i = 0; i < 5; ++i) { 
       
    47                     BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_, "BtTraceBlock counter(1-5): %d", i+1 );
       
    48                 });
       
    49         QString str("\"Qt String\"");
       
    50         BtTraceQString0( TRACE_NORMAL, TNAME_DEVLIST_17, str);
       
    51         BtTraceQString1( TRACE_NORMAL, TNAME_DEVLIST_18, "additioanl text;", str);
       
    52         TBTDevAddr addr;
       
    53         addr.SetReadable(_L("0060576ff376"));
       
    54         BtTraceBtAddr0( TRACE_NORMAL, TNAME_DEVLIST_19, addr );
       
    55         BtTraceBtAddr1( TRACE_NORMAL, TNAME_DEVLIST_20, "additional trace;", addr );
       
    56     }
       
    57 
       
    58  */
       
    59 
       
    60 // At early development phase, tracing is activated 
       
    61 //#ifdef _DEBUG
       
    62 #define BLUETOOTHTRACE_ENABLED
       
    63 //#endif //_DEBUG
       
    64 
       
    65 /*
       
    66  * Tracing media configuration
       
    67  */  
       
    68 #ifdef BLUETOOTHTRACE_ENABLED
       
    69     #ifdef __WINS__
       
    70     #define BLUETOOTHTRACE_MEDIA_FILE
       
    71     #else 
       
    72     // RDEBUG is used for tracing output before we migrate to OST tracing.
       
    73     #define BLUETOOTHTRACE_MEDIA_RDEBUG
       
    74     //#define BLUETOOTHTRACE_MEDIA_OST 
       
    75     #endif // __WINS__
       
    76 #endif //BLUETOOTHTRACE_ENABLED
       
    77 
       
    78 /*
       
    79  * Configuration of tracing to file
       
    80  */
       
    81 #ifdef BLUETOOTHTRACE_MEDIA_FILE
       
    82 
       
    83 _LIT( KLogFile, "btuiqt.txt" );
       
    84 _LIT( KLogDir, "bt" );
       
    85 
       
    86 #endif //BLUETOOTHTRACE_MEDIA_FILE
       
    87 
       
    88 /*
       
    89  * Configuration of tracing using RDebug
       
    90  */
       
    91 #ifdef BLUETOOTHTRACE_MEDIA_RDEBUG
       
    92 
       
    93 #endif //BLUETOOTHTRACE_MEDIA_RDEBUG
       
    94 
       
    95 /*
       
    96  * Configuration of tracing using OST
       
    97  */
       
    98 #ifndef BLUETOOTHTRACE_MEDIA_OST
       
    99 
       
   100 /**
       
   101  * Group-mapping aligning with OST groups.
       
   102  * The purpose of using groups is to ease migrating tracing from legacy logging to OST.
       
   103  */
       
   104 #define TRACE_FATAL       "[FATAL]"
       
   105 #define TRACE_IMPORTANT   "[IMPTT]"
       
   106 #define TRACE_NORMAL      "[NORML]"
       
   107 #define TRACE_API         "[ API ]"
       
   108 #define TRACE_FLOW        "[FLOW ]"
       
   109 #define TRACE_STATE       "[STATE]"
       
   110 #define TRACE_DETAILED    "[DETLD]"
       
   111 #define TRACE_DEBUG       "[DEBUG]"
       
   112 #define TRACE_PERFORMANCE "[PFMAN]"
       
   113 
       
   114 /**
       
   115  * Component Identifier to be written into traces:
       
   116  */
       
   117 _LIT(KComponentName, "[BtUi]");
       
   118 
       
   119 #endif //BLUETOOTHTRACE_MEDIA_OST
       
   120 
       
   121 #endif // BLUETOOTHTRACECONFIG_H