diff -r a179b74831c9 -r c1f20ce4abcf kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp --- a/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp Thu Aug 19 11:14:22 2010 +0300 +++ b/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp Tue Aug 31 16:34:26 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -17,6 +17,10 @@ // #include "UsbClientStateWatcher.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "UsbClientStateWatcherTraces.h" +#endif #include #include #include @@ -28,10 +32,12 @@ CUsbClientStateWatcher* CUsbClientStateWatcher::NewL(RDevUsbcClient& aClientDriver,MUsbClientStateObserver& aStateObserver) { + OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_NEWL_ENTRY, 0 ); CUsbClientStateWatcher* self = new (ELeave) CUsbClientStateWatcher(aClientDriver,aStateObserver); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_NEWL_EXIT, ( TUint )( self ) ); return self; } @@ -41,33 +47,41 @@ iClientDriver(aClientDriver), iStateObserver(aStateObserver) { + OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY, this ); CActiveScheduler::Add(this); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT, this ); } CUsbClientStateWatcher::~CUsbClientStateWatcher() { - LOG_FUNC + OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01, this ); Cancel(); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01, this ); } void CUsbClientStateWatcher::ConstructL() { - RDebug::Printf(" Watching state of device"); + OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY, this ); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_CONSTRUCTL, " Watching state of device"); iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT, this ); } void CUsbClientStateWatcher::DoCancel() { + OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY, this ); // Cancel device status notification iClientDriver.AlternateDeviceStatusNotifyCancel(); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT, this ); } void CUsbClientStateWatcher::RunL() { + OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_RUNL_ENTRY, this ); // Retrieve the asynchronous completion code TInt completionCode(iStatus.Int()); @@ -83,42 +97,42 @@ switch(iState) { case EUsbcDeviceStateUndefined: - RDebug::Printf(" Not attached"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL, " Not attached"); break; case EUsbcDeviceStateAttached: - RDebug::Printf(" Attached to host but not powered"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP01, " Attached to host but not powered"); break; case EUsbcDeviceStatePowered: - RDebug::Printf(" Attached and powered but no reset"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP02, " Attached and powered but no reset"); break; case EUsbcDeviceStateDefault: - RDebug::Printf(" Reset but not addressed"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP03, " Reset but not addressed"); break; case EUsbcDeviceStateAddress: - RDebug::Printf(" Addressed but not configured"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP04, " Addressed but not configured"); break; case EUsbcDeviceStateConfigured: - RDebug::Printf(" Fully configured"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP05, " Fully configured"); break; case EUsbcDeviceStateSuspended: - RDebug::Printf(" Suspended"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP06, " Suspended"); break; case EUsbcNoState: //follow through default: - RDebug::Printf(" Not specified"); + OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP07, " Not specified"); break; } } else { - RDebug::Printf(" Notification error %d",completionCode); + OstTrace1(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP08, " Notification error %d",completionCode); } // Device state change @@ -128,12 +142,15 @@ // Keep asking to be informed for status notifications iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); + OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_RUNL_EXIT, this ); } TInt CUsbClientStateWatcher::RunError(TInt aError) { + OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY, this ); aError = KErrNone; + OstTraceFunctionExitExt( CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT, this, aError ); return aError; } @@ -145,10 +162,12 @@ CAlternateInterfaceSelectionWatcher* CAlternateInterfaceSelectionWatcher::NewL( RDevUsbcClient& aClientDriver,MAlternateSettingObserver& aObserver) { + OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY, 0 ); CAlternateInterfaceSelectionWatcher* self = new (ELeave) CAlternateInterfaceSelectionWatcher(aClientDriver,aObserver); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT, ( TUint )( self ) ); return self; } @@ -159,38 +178,43 @@ iClientDriver(aClientDriver), iObserver(aObserver) { + OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY, this ); CActiveScheduler::Add(this); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT, this ); } CAlternateInterfaceSelectionWatcher::~CAlternateInterfaceSelectionWatcher() { - LOG_FUNC + OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01, this ); Cancel(); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01, this ); } void CAlternateInterfaceSelectionWatcher::ConstructL() { - LOG_FUNC + OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY, this ); iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT, this ); } void CAlternateInterfaceSelectionWatcher::DoCancel() { - LOG_FUNC + OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY, this ); iClientDriver.AlternateDeviceStatusNotifyCancel(); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT, this ); } void CAlternateInterfaceSelectionWatcher::RunL() { - LOG_FUNC + OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY, this ); TInt completionCode(iStatus.Int()); @@ -201,13 +225,15 @@ // Keep asking to be informed for status notifications iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); + OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT, this ); } TInt CAlternateInterfaceSelectionWatcher::RunError(TInt aError) { - LOG_FUNC + OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY, this ); + OstTraceFunctionExitExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT, this, KErrNone ); return KErrNone; }