kerneltest/e32test/debug/t_perflogger_drv.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2005-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 // A helper test driver for testing Kernel Performance Logger. User part.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef T_PERFLOGGER_DRV_H__
       
    25 #define T_PERFLOGGER_DRV_H__
       
    26 
       
    27 #include <e32cmn.h>
       
    28 #include <e32ver.h>
       
    29 
       
    30 /** Test helper LDD name */ 
       
    31 _LIT(KPLoggerHelperTestDrv, "d_perflogger_test");
       
    32 
       
    33 
       
    34 /** 
       
    35 	Log control structure.
       
    36 	Specifies a task arguments to the helper driver
       
    37 */
       
    38 struct TTestLogCtrl
       
    39 	{
       
    40     inline TTestLogCtrl();
       
    41 	
       
    42     TInt    iLogsNum;        ///< numbers of loggings   
       
    43     TUint   iLogPeriodTick;  ///< Period of logging, nanokernel ticks, see NTimer::OneShot()
       
    44 	
       
    45     //-- this part will go to the logging function
       
    46     
       
    47     TUint8  iCategory;
       
    48     TUint8  iSubCategory;
       
    49     TUint32 iUserData;       ///< user data.
       
    50     TUint32 iUserData2;      ///< user data.
       
    51 	
       
    52 	};
       
    53 
       
    54 
       
    55 /**
       
    56     User - side interface to the perf. logger test helper LDD.
       
    57 */
       
    58 class RKPLoggerTestHelper : public RBusLogicalChannel
       
    59 	{
       
    60 	
       
    61 	public:
       
    62 #ifndef __KERNEL_MODE__
       
    63 		
       
    64 		//-- user application interface methods
       
    65 		
       
    66 		inline TInt Open(const TVersion& aVer);
       
    67 		inline TVersion VersionRequired() const;
       
    68 		
       
    69 		inline TInt MakeLogFromUserThread(const TTestLogCtrl& aLogCtrl);
       
    70 		inline TInt TestDifferentMacros(const TTestLogCtrl& aLogCtrl);
       
    71 		
       
    72 		
       
    73 		inline void MakeLogFromISR(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
       
    74 		inline void CancelLogFromISR();
       
    75 		
       
    76 		inline void MakeLogFromIDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
       
    77 		inline void CancelLogFromIDFC();
       
    78 		
       
    79 		inline void MakeLogFromDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
       
    80 		inline void CancelLogFromDFC();
       
    81 		
       
    82 		inline void Close();
       
    83 		
       
    84 #endif  //__KERNEL_MODE__
       
    85 		
       
    86 	public:
       
    87 		
       
    88 		/** LDD version */
       
    89 		enum TVer{EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1};
       
    90 		
       
    91 		/** Synchronous Control functions */
       
    92 		enum TControl
       
    93 			{
       
    94 			EDoLogFromUserThread,   ///< make logging from user thread context. See also TTestLogStruct
       
    95 			EDoTestMacros           ///< test different PERF_LOG macros, logging from the user thread 
       
    96 			};
       
    97 		
       
    98 		/** Asynchronous Request functions */
       
    99 		enum TRequest
       
   100 			{
       
   101 			EDoLogFromISR,  ///< make logging from ISR. See also TTestLogStruct
       
   102 			EDoLogFromIDFC, ///< make logging from IDFC. See also TTestLogStruct
       
   103 			EDoLogFromDFC,  ///< make logging from DFC. See also TTestLogStruct
       
   104 			};
       
   105 	};
       
   106 
       
   107 #include "t_perflogger_drv.inl"
       
   108 
       
   109 #endif  //T_PERFLOGGER_DRV_H__
       
   110 
       
   111 
       
   112 
       
   113