tracefw/tracecompiler/test/TracesInHeadersApps/multmmp_separate_source/dll/incDup/HelloTraceFnDup.h
changeset 56 aa2539c91954
parent 54 a151135b0cf9
child 60 e54443a6878c
child 62 1c2bb2fc7c87
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
     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 
       
    18 
       
    19 #ifndef HELLOTRACEFNDUP_H_
       
    20 #define HELLOTRACEFNDUP_H_
       
    21 #include "OstTraceDefinitions.h"
       
    22 #ifdef OST_TRACE_COMPILER_IN_USE
       
    23 #include "HelloTraceFnDupTraces.h"
       
    24 #endif
       
    25 
       
    26 inline void CHelloTraceFn::SimpleDup()
       
    27     {
       
    28     OstTraceFunctionEntry1( CHELLOTRACEFN_SIMPLE_DUP_ENTRY, this );
       
    29     // ...
       
    30     OstTraceFunctionExit1( CHELLOTRACEFN_SIMPLE_DUP_EXIT, this );
       
    31     }
       
    32 
       
    33 inline void CHelloTraceFn::OutputsParamsDup(TInt aParam, TFnEnum aEnumParam)
       
    34     {
       
    35     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSPARAMS_DUP_ENTRY, this );
       
    36     Simple();
       
    37     OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTSPARAMS_DUP_EXIT, this );
       
    38     }
       
    39 
       
    40 inline void CHelloTraceFn::StaticOutputsParamsDupL(TInt aParam)
       
    41     {
       
    42     OstTraceFunctionEntryExt( CHELLOTRACEFN_STATICOUTPUTSPARAMS_DUP_ENTRY, NULL );
       
    43     CHelloTraceFn* example = CHelloTraceFn::NewLC();
       
    44     example->SimpleDup();    
       
    45     CleanupStack::PopAndDestroy(example);
       
    46     OstTraceFunctionExit0( CHELLOTRACEFN_STATICOUTPUTSPARAMS_DUP_EXIT );    
       
    47     }
       
    48 
       
    49 inline void CHelloTraceFn::OutputsSignedIntegersDup(TInt8 aParam8,   TInt16 aParam16, 
       
    50                                           TInt32 aParam32, TInt64 aParam64)
       
    51     {
       
    52     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSSIGNEDINTEGERS_DUP_ENTRY, this );
       
    53     // ...
       
    54     OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTSSIGNEDINTEGERS_DUP_EXIT, this );
       
    55     }
       
    56 
       
    57 void CHelloTraceFn::OutputsUnsignedIntegersDup(TUint8 aParam8,   TUint16 aParam16, 
       
    58                                             TUint32 aParam32, TUint64 aParam64)
       
    59     {
       
    60     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSUNSIGNEDINTEGERS_DUP_ENTRY, this );
       
    61     // ...
       
    62     OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTSUNSIGNEDINTEGERS_DUP_EXIT, this );
       
    63     }
       
    64 
       
    65 
       
    66 inline TInt CHelloTraceFn::OutputsTIntReturnValueDup()
       
    67     {
       
    68     OstTraceFunctionEntry1( CHELLOTRACEFN_OUTPUTSTINTRETURNVALUE_DUP_ENTRY, this );
       
    69     TInt ret = KErrNone;
       
    70     // ...
       
    71     OstTraceFunctionExitExt( CHELLOTRACEFN_OUTPUTSTINTRETURNVALUE_DUP_EXIT, this, ret );
       
    72     return ret;
       
    73     }
       
    74 
       
    75 inline TInt64 CHelloTraceFn::OutputsTInt64ReturnValueDup()
       
    76     {
       
    77     OstTraceFunctionEntry1( CHELLOTRACEFN_OUTPUTSTINT64RETURNVALUE_DUP_ENTRY, this );
       
    78     TInt64 ret = (TInt64) 2 << 40;
       
    79     // ...
       
    80     OstTraceFunctionExitExt( CHELLOTRACEFN_OUTPUTSTINT64RETURNVALUE_DUP_EXIT, this, ret );
       
    81     return ret;
       
    82     }
       
    83 
       
    84 inline CHelloTraceFn::TFnEnum CHelloTraceFn::OutputsTFnEnumReturnValueDup()
       
    85     {
       
    86     OstTraceFunctionEntry1( CHELLOTRACEFN_OUTPUTSTFNENUMRETURNVALUE_DUP_ENTRY, this );
       
    87     TFnEnum ret = EExample1;
       
    88     // ...
       
    89     OstTraceFunctionExitExt( CHELLOTRACEFN_OUTPUTSTFNENUMRETURNVALUE_DUP_EXIT, this, ret );
       
    90     return ret;    
       
    91     }
       
    92 
       
    93 inline CActive* CHelloTraceFn::OutputsUnknownPtrTypeDup(CActive* aActive)
       
    94     {
       
    95     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSUNKNOWNPTRTYPE_DUP_ENTRY, this );    
       
    96     // ...
       
    97     OstTraceFunctionExitExt( CHELLOTRACEFN_OUTPUTSUNKNOWNPTRTYPE_DUP_EXIT, this, (TUint) aActive );
       
    98     return aActive;
       
    99     }
       
   100 
       
   101 inline CActive& CHelloTraceFn::OutputsUnknownRefTypeDup(CActive& aActive)
       
   102     {
       
   103     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSUNKNOWNREFTYPE_DUP_ENTRY, this );
       
   104     // ...
       
   105     OstTraceFunctionExitExt( CHELLOTRACEFN_OUTPUTSUNKNOWNREFTYPE_DUP_EXIT, this, (TUint) &aActive );    
       
   106     return aActive;
       
   107     }
       
   108 
       
   109 // The following doesn't compile as the Trace Compiler doesn't generate
       
   110 // the correct OstTraceGenExt(...) function for it
       
   111 //void CHelloTraceFn::OutputMissingParamsBug(TInt /*aCommentParam*/, TInt)
       
   112 //    {
       
   113 //    OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTMISSINGPARAMSBUG_ENTRY, this );
       
   114 //    // ...
       
   115 //    OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTMISSINGPARAMSBUG_EXIT, this );    
       
   116 //    }
       
   117 
       
   118 // The following compiles and works but outputs the following warning
       
   119 // warning: HelloTraceFn.cpp, line xxx: Parameter did not have a name and was not added to trace
       
   120 // The fact that this cannot be suppressed is a known problem we're working on.
       
   121 inline void CHelloTraceFn::OutputMissingParamsDup(TInt aUsedParam, TInt /*aCommentParam*/, TInt)
       
   122     {
       
   123     OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTMISSINGPARAMS_DUP_ENTRY, this );
       
   124     // ...
       
   125     OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTMISSINGPARAMS_DUP_EXIT, this );
       
   126     }
       
   127 
       
   128 // The following doesn't work as the Trace Compiler outputs:
       
   129 // error: HelloTraceFn.cpp, line xxx: Class / function name for trace could not be determined x3
       
   130 //#ifdef _DEBUG
       
   131 //void CHelloTraceFn::PreProcessedFn(TInt aDbgParam)
       
   132 //    {
       
   133 //    OstTraceFunctionEntryExt( PRE_PROCESSED_ENTRTY_1, this );
       
   134 //#else
       
   135 //void CHelloTraceFn::PreProcessedFn()
       
   136 //    {
       
   137 //    OstTraceFunctionEntry1( PRE_PROCESSED_ENTRTY_2, this );
       
   138 //#endif
       
   139 //    Simple();
       
   140 //    OstTraceFunctionExit1( CHELLOTRACEFN_PREPROCESSEDFN_EXIT, this );
       
   141 //    }
       
   142 
       
   143 // Workaround example code until a proper fix is provided
       
   144 #ifdef _DEBUG
       
   145 inline void CHelloTraceFn::PreProcessedFnDup(TInt aDbgParam)
       
   146     {
       
   147     OstTraceExt2( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_DUP_ENTRY_1, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;aDbgParam=%d;this=%x", (TInt) aDbgParam, (TUint) this);
       
   148 #else
       
   149     inline void CHelloTraceFn::PreProcessedFnDup()
       
   150     {
       
   151     OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_DUP_ENTRY_2, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
       
   152 #endif
       
   153     SimpleDup();
       
   154     OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_DUP_EXIT, "CHelloTraceFn::PreProcessedFn: < CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
       
   155     }
       
   156 
       
   157 #endif /* HELLOTRACEFNDUP_H_ */