diff -r 000000000000 -r a41df078684a userlibandfileserver/fileserver/ftrace/f32trace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userlibandfileserver/fileserver/ftrace/f32trace.h Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,353 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalTechnology + @prototype +*/ + +#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 +*/ + +#if ((defined (_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UDEB)) || \ + (!defined(_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UREL))) + #define SYMBIAN_FTRACE_ENABLE +#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 (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<