sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: sl@0: #ifndef T_PERFLOGGER_DRV_INL__ sl@0: #define T_PERFLOGGER_DRV_INL__ sl@0: sl@0: sl@0: //----------------------------------------------------------------------------------- sl@0: sl@0: TTestLogCtrl::TTestLogCtrl() sl@0: { sl@0: iLogsNum = -1; //-- invalid default value sl@0: iLogPeriodTick = 10; //-- 10 ms by default sl@0: sl@0: iCategory=0x88; sl@0: iSubCategory=0x99; sl@0: sl@0: iUserData = 0xBEEEBEEE; sl@0: iUserData2 = 0xAABBCCDD; sl@0: sl@0: } sl@0: sl@0: //----------------------------------------------------------------------------------- sl@0: sl@0: #ifndef __KERNEL_MODE__ sl@0: sl@0: /** sl@0: Open LDD. sl@0: @param aVer version required sl@0: @return System-wide error code sl@0: */ sl@0: TInt RKPLoggerTestHelper::Open(const TVersion& aVer) sl@0: { sl@0: return DoCreate(KPLoggerHelperTestDrv, aVer, KNullUnit, NULL, NULL, EOwnerProcess); sl@0: } sl@0: sl@0: /** sl@0: Cancel all pending requests and close LDD sl@0: */ sl@0: void RKPLoggerTestHelper::Close() sl@0: { sl@0: CancelLogFromISR(); sl@0: CancelLogFromIDFC(); sl@0: CancelLogFromDFC(); sl@0: RBusLogicalChannel::Close(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: @return Current LDD version sl@0: */ sl@0: TVersion RKPLoggerTestHelper::VersionRequired() const sl@0: { sl@0: return TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber); sl@0: } sl@0: sl@0: sl@0: sl@0: /** sl@0: Synchronous request to make a number of logging from user thread. sl@0: Logging is performen in the context of the user caller thread sl@0: sl@0: @param aLogCtrl control parameters for logging sl@0: @return System wide error code sl@0: */ sl@0: TInt RKPLoggerTestHelper::MakeLogFromUserThread(const TTestLogCtrl& aLogCtrl) sl@0: { sl@0: return DoControl(EDoLogFromUserThread, (TAny*)&aLogCtrl); sl@0: } sl@0: sl@0: sl@0: /** sl@0: test different PERF_LOG macros, logging from the user thread. Just unit test sl@0: @param aLogCtrl control parameters for logging sl@0: @return System wide error code sl@0: */ sl@0: TInt RKPLoggerTestHelper::TestDifferentMacros(const TTestLogCtrl& aLogCtrl) sl@0: { sl@0: return DoControl(EDoTestMacros, (TAny*)&aLogCtrl); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Asynchronous request to make a number of logging from ISR. NTimer is used for this purpose. sl@0: sl@0: @param aRqStat request status, will be completed when all done. sl@0: @param aLogCtrl control parameters for logging sl@0: */ sl@0: void RKPLoggerTestHelper::MakeLogFromISR(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl) sl@0: { sl@0: DoRequest(EDoLogFromISR, aRqStat, (TAny*)&aLogCtrl); sl@0: } sl@0: sl@0: /** cancel ISR logging request */ sl@0: void RKPLoggerTestHelper::CancelLogFromISR() sl@0: { sl@0: DoCancel(EDoLogFromISR); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous request to make a number of logging from IDFC. NTimer is used for this purpose. sl@0: sl@0: @param aRqStat request status, will be completed when all done. sl@0: @param aLogCtrl control parameters for logging sl@0: */ sl@0: void RKPLoggerTestHelper::MakeLogFromIDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl) sl@0: { sl@0: DoRequest(EDoLogFromIDFC, aRqStat, (TAny*)&aLogCtrl); sl@0: } sl@0: sl@0: /** cancel IDFC logging request */ sl@0: void RKPLoggerTestHelper::CancelLogFromIDFC() sl@0: { sl@0: DoCancel(EDoLogFromIDFC); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous request to make a number of logging from DFC. NTimer is used for this purpose. sl@0: sl@0: @param aRqStat request status, will be completed when all done. sl@0: @param aLogCtrl control parameters for logging sl@0: */ sl@0: void RKPLoggerTestHelper::MakeLogFromDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl) sl@0: { sl@0: DoRequest(EDoLogFromDFC, aRqStat, (TAny*)&aLogCtrl); sl@0: } sl@0: sl@0: /** cancel DFC logging request */ sl@0: void RKPLoggerTestHelper::CancelLogFromDFC() sl@0: { sl@0: DoCancel(EDoLogFromDFC); sl@0: } sl@0: sl@0: sl@0: #endif //__KERNEL_MODE__ sl@0: sl@0: sl@0: sl@0: #endif //T_PERFLOGGER_DRV_INL__ sl@0: sl@0: sl@0: sl@0: