1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/debug/t_perflogger_drv.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,159 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 +*/
1.22 +
1.23 +#ifndef T_PERFLOGGER_DRV_INL__
1.24 +#define T_PERFLOGGER_DRV_INL__
1.25 +
1.26 +
1.27 +//-----------------------------------------------------------------------------------
1.28 +
1.29 +TTestLogCtrl::TTestLogCtrl()
1.30 +{
1.31 + iLogsNum = -1; //-- invalid default value
1.32 + iLogPeriodTick = 10; //-- 10 ms by default
1.33 +
1.34 + iCategory=0x88;
1.35 + iSubCategory=0x99;
1.36 +
1.37 + iUserData = 0xBEEEBEEE;
1.38 + iUserData2 = 0xAABBCCDD;
1.39 +
1.40 +}
1.41 +
1.42 +//-----------------------------------------------------------------------------------
1.43 +
1.44 +#ifndef __KERNEL_MODE__
1.45 +
1.46 +/**
1.47 + Open LDD.
1.48 + @param aVer version required
1.49 + @return System-wide error code
1.50 +*/
1.51 +TInt RKPLoggerTestHelper::Open(const TVersion& aVer)
1.52 +{
1.53 + return DoCreate(KPLoggerHelperTestDrv, aVer, KNullUnit, NULL, NULL, EOwnerProcess);
1.54 +}
1.55 +
1.56 +/**
1.57 + Cancel all pending requests and close LDD
1.58 +*/
1.59 +void RKPLoggerTestHelper::Close()
1.60 +{
1.61 + CancelLogFromISR();
1.62 + CancelLogFromIDFC();
1.63 + CancelLogFromDFC();
1.64 + RBusLogicalChannel::Close();
1.65 +}
1.66 +
1.67 +
1.68 +/**
1.69 + @return Current LDD version
1.70 +*/
1.71 +TVersion RKPLoggerTestHelper::VersionRequired() const
1.72 +{
1.73 + return TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber);
1.74 +}
1.75 +
1.76 +
1.77 +
1.78 +/**
1.79 + Synchronous request to make a number of logging from user thread.
1.80 + Logging is performen in the context of the user caller thread
1.81 +
1.82 + @param aLogCtrl control parameters for logging
1.83 + @return System wide error code
1.84 +*/
1.85 +TInt RKPLoggerTestHelper::MakeLogFromUserThread(const TTestLogCtrl& aLogCtrl)
1.86 +{
1.87 + return DoControl(EDoLogFromUserThread, (TAny*)&aLogCtrl);
1.88 +}
1.89 +
1.90 +
1.91 +/**
1.92 + test different PERF_LOG macros, logging from the user thread. Just unit test
1.93 + @param aLogCtrl control parameters for logging
1.94 + @return System wide error code
1.95 +*/
1.96 +TInt RKPLoggerTestHelper::TestDifferentMacros(const TTestLogCtrl& aLogCtrl)
1.97 +{
1.98 + return DoControl(EDoTestMacros, (TAny*)&aLogCtrl);
1.99 +}
1.100 +
1.101 +
1.102 +/**
1.103 + Asynchronous request to make a number of logging from ISR. NTimer is used for this purpose.
1.104 +
1.105 + @param aRqStat request status, will be completed when all done.
1.106 + @param aLogCtrl control parameters for logging
1.107 +*/
1.108 +void RKPLoggerTestHelper::MakeLogFromISR(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl)
1.109 +{
1.110 + DoRequest(EDoLogFromISR, aRqStat, (TAny*)&aLogCtrl);
1.111 +}
1.112 +
1.113 +/** cancel ISR logging request */
1.114 +void RKPLoggerTestHelper::CancelLogFromISR()
1.115 +{
1.116 + DoCancel(EDoLogFromISR);
1.117 +}
1.118 +
1.119 +/**
1.120 + Asynchronous request to make a number of logging from IDFC. NTimer is used for this purpose.
1.121 +
1.122 + @param aRqStat request status, will be completed when all done.
1.123 + @param aLogCtrl control parameters for logging
1.124 +*/
1.125 +void RKPLoggerTestHelper::MakeLogFromIDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl)
1.126 +{
1.127 + DoRequest(EDoLogFromIDFC, aRqStat, (TAny*)&aLogCtrl);
1.128 +}
1.129 +
1.130 +/** cancel IDFC logging request */
1.131 +void RKPLoggerTestHelper::CancelLogFromIDFC()
1.132 +{
1.133 + DoCancel(EDoLogFromIDFC);
1.134 +}
1.135 +
1.136 +/**
1.137 + Asynchronous request to make a number of logging from DFC. NTimer is used for this purpose.
1.138 +
1.139 + @param aRqStat request status, will be completed when all done.
1.140 + @param aLogCtrl control parameters for logging
1.141 +*/
1.142 +void RKPLoggerTestHelper::MakeLogFromDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl)
1.143 +{
1.144 + DoRequest(EDoLogFromDFC, aRqStat, (TAny*)&aLogCtrl);
1.145 +}
1.146 +
1.147 +/** cancel DFC logging request */
1.148 +void RKPLoggerTestHelper::CancelLogFromDFC()
1.149 +{
1.150 + DoCancel(EDoLogFromDFC);
1.151 +}
1.152 +
1.153 +
1.154 +#endif //__KERNEL_MODE__
1.155 +
1.156 +
1.157 +
1.158 +#endif //T_PERFLOGGER_DRV_INL__
1.159 +
1.160 +
1.161 +
1.162 +