os/kernelhwsrv/kerneltest/e32test/debug/t_perflogger_drv.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// A helper test driver for testing Kernel Performance Logger. User part.
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalAll
sl@0
    21
*/
sl@0
    22
sl@0
    23
sl@0
    24
#ifndef T_PERFLOGGER_DRV_H__
sl@0
    25
#define T_PERFLOGGER_DRV_H__
sl@0
    26
sl@0
    27
#include <e32cmn.h>
sl@0
    28
#include <e32ver.h>
sl@0
    29
sl@0
    30
/** Test helper LDD name */ 
sl@0
    31
_LIT(KPLoggerHelperTestDrv, "d_perflogger_test");
sl@0
    32
sl@0
    33
sl@0
    34
/** 
sl@0
    35
	Log control structure.
sl@0
    36
	Specifies a task arguments to the helper driver
sl@0
    37
*/
sl@0
    38
struct TTestLogCtrl
sl@0
    39
	{
sl@0
    40
    inline TTestLogCtrl();
sl@0
    41
	
sl@0
    42
    TInt    iLogsNum;        ///< numbers of loggings   
sl@0
    43
    TUint   iLogPeriodTick;  ///< Period of logging, nanokernel ticks, see NTimer::OneShot()
sl@0
    44
	
sl@0
    45
    //-- this part will go to the logging function
sl@0
    46
    
sl@0
    47
    TUint8  iCategory;
sl@0
    48
    TUint8  iSubCategory;
sl@0
    49
    TUint32 iUserData;       ///< user data.
sl@0
    50
    TUint32 iUserData2;      ///< user data.
sl@0
    51
	
sl@0
    52
	};
sl@0
    53
sl@0
    54
sl@0
    55
/**
sl@0
    56
    User - side interface to the perf. logger test helper LDD.
sl@0
    57
*/
sl@0
    58
class RKPLoggerTestHelper : public RBusLogicalChannel
sl@0
    59
	{
sl@0
    60
	
sl@0
    61
	public:
sl@0
    62
#ifndef __KERNEL_MODE__
sl@0
    63
		
sl@0
    64
		//-- user application interface methods
sl@0
    65
		
sl@0
    66
		inline TInt Open(const TVersion& aVer);
sl@0
    67
		inline TVersion VersionRequired() const;
sl@0
    68
		
sl@0
    69
		inline TInt MakeLogFromUserThread(const TTestLogCtrl& aLogCtrl);
sl@0
    70
		inline TInt TestDifferentMacros(const TTestLogCtrl& aLogCtrl);
sl@0
    71
		
sl@0
    72
		
sl@0
    73
		inline void MakeLogFromISR(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
sl@0
    74
		inline void CancelLogFromISR();
sl@0
    75
		
sl@0
    76
		inline void MakeLogFromIDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
sl@0
    77
		inline void CancelLogFromIDFC();
sl@0
    78
		
sl@0
    79
		inline void MakeLogFromDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl);
sl@0
    80
		inline void CancelLogFromDFC();
sl@0
    81
		
sl@0
    82
		inline void Close();
sl@0
    83
		
sl@0
    84
#endif  //__KERNEL_MODE__
sl@0
    85
		
sl@0
    86
	public:
sl@0
    87
		
sl@0
    88
		/** LDD version */
sl@0
    89
		enum TVer{EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1};
sl@0
    90
		
sl@0
    91
		/** Synchronous Control functions */
sl@0
    92
		enum TControl
sl@0
    93
			{
sl@0
    94
			EDoLogFromUserThread,   ///< make logging from user thread context. See also TTestLogStruct
sl@0
    95
			EDoTestMacros           ///< test different PERF_LOG macros, logging from the user thread 
sl@0
    96
			};
sl@0
    97
		
sl@0
    98
		/** Asynchronous Request functions */
sl@0
    99
		enum TRequest
sl@0
   100
			{
sl@0
   101
			EDoLogFromISR,  ///< make logging from ISR. See also TTestLogStruct
sl@0
   102
			EDoLogFromIDFC, ///< make logging from IDFC. See also TTestLogStruct
sl@0
   103
			EDoLogFromDFC,  ///< make logging from DFC. See also TTestLogStruct
sl@0
   104
			};
sl@0
   105
	};
sl@0
   106
sl@0
   107
#include "t_perflogger_drv.inl"
sl@0
   108
sl@0
   109
#endif  //T_PERFLOGGER_DRV_H__
sl@0
   110
sl@0
   111
sl@0
   112
sl@0
   113