diff -r 2a0ada0a1bf8 -r 95847726fe57 userlibandfileserver/fileserver/ftrace/f32trace.h --- a/userlibandfileserver/fileserver/ftrace/f32trace.h Wed May 12 10:34:10 2010 +0100 +++ b/userlibandfileserver/fileserver/ftrace/f32trace.h Mon May 24 18:38:55 2010 +0100 @@ -22,20 +22,6 @@ #if !defined(__FTRACE_H__) #define __FTRACE_H__ -#include -#include - - -#ifndef __KERNEL_MODE__ - #include -#endif - -#include "f32tracedef.h" - -#if defined(__EABI__) -#pragma diag_suppress 1446 // non-POD class type passed through ellipsis -#endif - /** @internalComponent @prototype @@ -43,218 +29,41 @@ #if ((defined (_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UDEB)) || \ (!defined(_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UREL))) - #define SYMBIAN_FTRACE_ENABLE + #include "OstTraceDefinitions.h" // may or may not define OST_TRACE_COMPILER_IN_USE +#else + #undef OST_TRACE_COMPILER_IN_USE + #undef OST_TRACE_CATEGORY + #define OST_TRACE_CATEGORY OST_TRACE_CATEGORY_NONE + + #undef OstTrace0 + #undef OstTrace1 + #undef OstTraceData + #undef OstTraceExt1 + #undef OstTraceExt2 + #undef OstTraceExt3 + #undef OstTraceExt4 + #undef OstTraceExt5 + + #define OstTrace0( aGroupName, aTraceName, aTraceText ) + #define OstTrace1( aGroupName, aTraceName, aTraceText, aParam ) + #define OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) + #define OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam ) + #define OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) + #define OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) + #define OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) + #define OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) #endif - -inline TBool Trace1(TClassification aClassification, TFormatId aFormatId, TModuleUid aUid, TUint a1) - { - return BTraceFilteredContext12( - aClassification, // Category - 0, // Sub-category - aUid, // UID - aFormatId, - a1); - } - -inline TBool TraceN(TClassification aClassification, TFormatId aFormatId, TModuleUid aUid, TInt aArgCount, TUint a1, ...) - { - const TInt KMaxArgs = 8; - if (aArgCount > KMaxArgs) - return EFalse; - TUint args[KMaxArgs]; - TInt argLen = aArgCount << 2; - memcpy(args, &a1, argLen); - - return BTraceFilteredContextN( - aClassification, // Category - 0, // Sub-category - aUid, // UID - aFormatId, - args, - argLen); - } - - -inline TBool TraceStr(TClassification aClassification, TFormatId aFormatId, TModuleUid aUid, const TAny* aData, TInt aDataSize) - { - // NB This will truncate the data (!!!) - - // we can't use BTraceFilteredContextBig for this as it doesn't have room for the format Id - return BTraceFilteredContextN( - aClassification, // Category - 0, // Sub-category - aUid, // UID - aFormatId, - aData, - aDataSize); - } - - - - - - - -class RFTrace : public RBusLogicalChannel - { -public: - enum {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1}; - enum TControl - { - ETraceMultiple, - }; - -#ifndef __KERNEL_MODE__ - -public: - inline TInt Open(TOwnerType aType) - {return DoCreate(_L("FTrace"),TVersion(),0,NULL,NULL,aType);} - - inline TBool TraceMultiple(TClassification aClassification, TFormatId aFormatId, TUint32 aUid, TInt aDescriptorCount, TUint64 aParam1, ...) +#if defined (OST_TRACE_COMPILER_IN_USE) + // This class is used to reconstruct an RMessage2 object from a message handle so that we can + // call RMessagePtr2::Client() and then RThread::Id() to retrieve the client's thread Id. + // This is useful for matching client requests to calls to the proxydrive + class RDummyMessage : public RMessage2 { - if (Handle() == NULL) - return EFalse; - // ARM passes first 4 parameters in registers, so.... - // parcel-up the first four parameters in an array and pass a pointer to the array to the LDD; - // the next parameter(s) should be on the stack, so we can just pass a pointer to the first element - TUint args[4] = {aClassification, aFormatId, aUid, aDescriptorCount}; - TUint64* pArg1 = &aParam1; - TInt r = DoControl(ETraceMultiple, (TAny*) args, pArg1); - if (r |= KErrNone) - User::Panic(_L("FSCLIENT Trace panic"), 0); - return ETrue; - } - - static inline TUint64 PkgData(const TDesC16& aDes) {return MAKE_TUINT64( ((TUint) aDes.Ptr()), (aDes.Length()<<1) | (EPtrC<