os/kernelhwsrv/kerneltest/e32test/debug/d_btrace.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32tset\group\d_btrace.h
    15 // 
    16 //
    17 
    18 #ifndef D_BTRACE_H
    19 #define D_BTRACE_H
    20 
    21 #include <e32cmn.h>
    22 #include <e32ver.h>
    23 #include <e32btrace.h>
    24 
    25 #ifndef __KERNEL_MODE__
    26 #include <e32std.h>
    27 #endif
    28 
    29 
    30 /**
    31 Interface to the fast-trace memory buffer.
    32 */
    33 class RBTraceTest : public RBusLogicalChannel
    34 	{
    35 public:
    36 	enum TTestTraceFlags
    37 		{
    38 		EContextIsr			= 1<<8,
    39 		EContextIDFC		= 1<<9,
    40 		EContextIntsOff		= 1<<10,
    41 		EBigTrace			= 1<<11,
    42 		EUserTrace			= 1<<12,
    43 		EFilter2Trace		= 1<<13
    44 		};
    45 #ifndef __KERNEL_MODE__
    46 	inline TInt Open()
    47 		{
    48 		return DoCreate(Name(),TVersion(0,1,1),KNullUnit,NULL,NULL,EOwnerThread);
    49 		}
    50 
    51 	inline TInt Trace(TUint aType, TAny* aData, TInt aSize, TUint aDelay=0)
    52 		{
    53 		TPtrC8 des((TUint8*)aData,aSize+4);
    54 		if(!aType)
    55 			return DoControl(ETestTrace,(TAny*)aDelay,(TAny*)&des);
    56 		else
    57 			return DoControl(ETestSpecialTrace,(TAny*)aType,(TAny*)&des);
    58 		}
    59 
    60 	inline TUint TestBenchmark(TInt aSize, TUint aDuration)
    61 		{
    62 		return DoControl(ETestBenchmark,(TAny*)aSize,(TAny*)aDuration);
    63 		}
    64 
    65 	inline TUint TestBenchmark2(TInt aSize, TUint aDuration)
    66 		{
    67 		return DoControl(ETestBenchmark2,(TAny*)aSize,(TAny*)aDuration);
    68 		}
    69 
    70 	inline TUint TestBenchmarkCheckFilter(TInt aSize, TUint aDuration)
    71 		{
    72 		return DoControl(ETestBenchmarkCheckFilter,(TAny*)aSize,(TAny*)aDuration);
    73 		}
    74 	inline TInt UTrace(TUint aType, TAny* aData, TInt aSize)
    75 		{
    76 		TPtrC8 des((TUint8*)aData,aSize+4);
    77 		return DoControl(ETestUTrace,(TAny*)aType,(TAny*)&des);
    78 		}
    79 
    80 #endif
    81 
    82 	inline static const TDesC& Name();
    83 
    84 private:
    85 	enum TControl
    86 		{
    87 		ETestTrace,
    88 		ETestSpecialTrace,
    89 		ETestBenchmark,
    90 		ETestBenchmark2,
    91 		ETestBenchmarkCheckFilter,
    92 		ETestUTrace,
    93 		ETestBenchmarkUtrace,
    94 		};
    95 	friend class DBTraceTestChannel;
    96 	friend class DBTraceTestFactory;
    97 	};
    98 
    99 inline const TDesC& RBTraceTest::Name()
   100 	{
   101 	_LIT(KBTraceName,"d_btrace");
   102 	return KBTraceName;
   103 	}
   104 
   105 
   106 // Test UIDs are 0x10282675 To 0x102826D8 Inclusive
   107 const TUint32 KBTraceFilterTestUid = 0x10282675;
   108 const TUint KNumBTraceFilterTestUids = 100;
   109 const TUint32 KBTraceFilterTestUid1 = KBTraceFilterTestUid+KNumBTraceFilterTestUids/2-1;
   110 const TUint32 KBTraceFilterTestUid2 = KBTraceFilterTestUid1+2;
   111 
   112 
   113 #endif