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: // A helper test driver for testing Kernel Performance Logger. User part. sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalAll sl@0: */ sl@0: sl@0: sl@0: #ifndef T_PERFLOGGER_DRV_H__ sl@0: #define T_PERFLOGGER_DRV_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** Test helper LDD name */ sl@0: _LIT(KPLoggerHelperTestDrv, "d_perflogger_test"); sl@0: sl@0: sl@0: /** sl@0: Log control structure. sl@0: Specifies a task arguments to the helper driver sl@0: */ sl@0: struct TTestLogCtrl sl@0: { sl@0: inline TTestLogCtrl(); sl@0: sl@0: TInt iLogsNum; ///< numbers of loggings sl@0: TUint iLogPeriodTick; ///< Period of logging, nanokernel ticks, see NTimer::OneShot() sl@0: sl@0: //-- this part will go to the logging function sl@0: sl@0: TUint8 iCategory; sl@0: TUint8 iSubCategory; sl@0: TUint32 iUserData; ///< user data. sl@0: TUint32 iUserData2; ///< user data. sl@0: sl@0: }; sl@0: sl@0: sl@0: /** sl@0: User - side interface to the perf. logger test helper LDD. sl@0: */ sl@0: class RKPLoggerTestHelper : public RBusLogicalChannel sl@0: { sl@0: sl@0: public: sl@0: #ifndef __KERNEL_MODE__ sl@0: sl@0: //-- user application interface methods sl@0: sl@0: inline TInt Open(const TVersion& aVer); sl@0: inline TVersion VersionRequired() const; sl@0: sl@0: inline TInt MakeLogFromUserThread(const TTestLogCtrl& aLogCtrl); sl@0: inline TInt TestDifferentMacros(const TTestLogCtrl& aLogCtrl); sl@0: sl@0: sl@0: inline void MakeLogFromISR(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl); sl@0: inline void CancelLogFromISR(); sl@0: sl@0: inline void MakeLogFromIDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl); sl@0: inline void CancelLogFromIDFC(); sl@0: sl@0: inline void MakeLogFromDFC(TRequestStatus& aRqStat, const TTestLogCtrl& aLogCtrl); sl@0: inline void CancelLogFromDFC(); sl@0: sl@0: inline void Close(); sl@0: sl@0: #endif //__KERNEL_MODE__ sl@0: sl@0: public: sl@0: sl@0: /** LDD version */ sl@0: enum TVer{EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1}; sl@0: sl@0: /** Synchronous Control functions */ sl@0: enum TControl sl@0: { sl@0: EDoLogFromUserThread, ///< make logging from user thread context. See also TTestLogStruct sl@0: EDoTestMacros ///< test different PERF_LOG macros, logging from the user thread sl@0: }; sl@0: sl@0: /** Asynchronous Request functions */ sl@0: enum TRequest sl@0: { sl@0: EDoLogFromISR, ///< make logging from ISR. See also TTestLogStruct sl@0: EDoLogFromIDFC, ///< make logging from IDFC. See also TTestLogStruct sl@0: EDoLogFromDFC, ///< make logging from DFC. See also TTestLogStruct sl@0: }; sl@0: }; sl@0: sl@0: #include "t_perflogger_drv.inl" sl@0: sl@0: #endif //T_PERFLOGGER_DRV_H__ sl@0: sl@0: sl@0: sl@0: