connectivitylayer/isce/p2prouter_dll/inc/p2proutertrace.h
changeset 0 63b37f68c1ce
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __P2PROUTERTRACE_H_
       
    21 #define __P2PROUTERTRACE_H_
       
    22 
       
    23 // INCLUDES
       
    24 #include <kernel.h>
       
    25 
       
    26 // CONSTANTS
       
    27 enum TP2PFaultClassCategories
       
    28     {
       
    29     EDP2PReqQueueId = 0x00,
       
    30     EDP2PTraceFileId,
       
    31     EDP2PUserChannelTraceId,
       
    32     EDP2PRouterTraceId,
       
    33     EDP2PLinkTraceId,
       
    34     EDMsgQueueTraceId,
       
    35     EDP2PIfTraceId,
       
    36     EDP2PKernelChannelId,
       
    37     };
       
    38 
       
    39 const TUint8 KClassIdentifierShift( 8 );
       
    40 const TUint8 KProtocolIdShift( 16 );
       
    41 const TUint8 KExtraInfoShift( 24 );
       
    42 
       
    43 // MACROS
       
    44 
       
    45 #define _T( a ) a
       
    46 #define __TRACE_PRINTF(a) Kern::Printf a
       
    47 
       
    48 #ifdef _DEBUG
       
    49     #if defined COMPONENT_TRACE_FLAG
       
    50         #define C_TRACE(a) __TRACE_PRINTF(a)
       
    51     #else
       
    52         #define C_TRACE(a) 
       
    53     #endif // COMPONENT_TRACE_FLAG
       
    54 #else
       
    55     #define C_TRACE(a)
       
    56 #endif // _DEBUG
       
    57 
       
    58 // Resets are made both in UDEB and UREL (traces only in udeb)
       
    59 #define ASSERT_RESET_ALWAYS(a,b) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault( "P2P Router:", b ); }
       
    60 #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) )
       
    61 #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ ))
       
    62 #define TRACE_ASSERT_INFO(a, b) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, extra info 0x%08x, compiled=" __DATE__" "__TIME__, __LINE__, b ));
       
    63 #define TRACE_WARNING(a, b) if (!(a)) __TRACE_PRINTF(("Warning: file=" __FILE__ ", line=%d, extra info 0x%x, compiled=" __DATE__" "__TIME__, __LINE__, b ));
       
    64 #define ASSERT_PANIC_USER_THREAD_ALWAYS( a, b, c ) if(!(a)){__TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__));Kern::ThreadKill( b, EExitPanic, c, _L8("P2P Router:") );}
       
    65 #define ASSERT_THREAD_CONTEXT_ALWAYS( a )ASSERT_RESET_ALWAYS( NKern::CurrentContext() == NKern::EThread, a );
       
    66 
       
    67 // DATA TYPES
       
    68 
       
    69 // FUNCTION PROTOTYPES
       
    70 
       
    71 // FORWARD DECLARATIONS
       
    72 
       
    73 #endif // __P2PROUTERTRACE_H_
       
    74 
       
    75 //  End of File