diff -r d3e8e7d462dd -r f92a4f87e424 usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp --- a/usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp Thu Jul 15 20:42:20 2010 +0300 +++ b/usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp Tue Aug 31 17:01:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,15 +21,16 @@ @file */ +#include #include #include "CUsbScheduler.h" #include "cusbotgwatcher.h" #include "CUsbOtg.h" -#include +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cusbotgwatcherTraces.h" +#endif -#ifdef __FLOG_ACTIVE -_LIT8(KLogComponent, "USBSVR-OTGWATCHER"); -#endif static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); static _LIT_SECURITY_POLICY_S1(KNetworkControlPolicy,KUsbmanSvrSid,ECapabilityNetworkControl); @@ -50,8 +51,9 @@ CUsbOtgBaseWatcher::CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd) : CActive(CActive::EPriorityStandard), iLdd(aLdd) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_CONS_ENTRY ); CActiveScheduler::Add(this); + OstTraceFunctionExit0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_CONS_EXIT ); } /** @@ -63,8 +65,9 @@ */ CUsbOtgBaseWatcher::~CUsbOtgBaseWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_DES_ENTRY ); Cancel(); + OstTraceFunctionExit0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_DES_EXIT ); } /** @@ -72,8 +75,9 @@ */ void CUsbOtgBaseWatcher::Start() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_START_ENTRY ); Post(); + OstTraceFunctionExit0( CUSBOTGBASEWATCHER_START_EXIT ); } //---------------------------- Id-Pin watcher class --------------------------- @@ -89,12 +93,13 @@ */ CUsbOtgIdPinWatcher* CUsbOtgIdPinWatcher::NewL(RUsbOtgDriver& aLdd) { - LOG_STATIC_FUNC_ENTRY + OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_NEWL_ENTRY ); CUsbOtgIdPinWatcher* self = new (ELeave) CUsbOtgIdPinWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_NEWL_EXIT ); return self; } @@ -108,9 +113,10 @@ */ CUsbOtgIdPinWatcher::~CUsbOtgIdPinWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_DES_ENTRY ); Cancel(); RProperty::Delete(KUsbOtgIdPinPresentProperty); + OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_DES_EXIT ); } void CUsbOtgIdPinWatcher::ConstructL() @@ -118,7 +124,7 @@ * Performs 2nd phase construction of the OTG object. */ { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CONSTRUCTL_ENTRY ); TInt err = RProperty::Define(KUsbOtgIdPinPresentProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -130,6 +136,7 @@ { User::LeaveIfError(err); } + OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CONSTRUCTL_EXIT ); } /** @@ -143,7 +150,8 @@ CUsbOtgIdPinWatcher::CUsbOtgIdPinWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_CONS_ENTRY ); + OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_CONS_EXIT ); } /** @@ -151,14 +159,19 @@ */ void CUsbOtgIdPinWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::RunL [iStatus=%d]"), iStatus.Int()); + OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_RUNL, "CUsbOtgIdPinWatcher::RunL;iStatus=%d", iStatus.Int() ); - LEAVEIFERRORL(iStatus.Int()); + TInt err = iStatus.Int(); + if(err < 0) + { + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_RUNL_DUP1, "CUsbOtgIdPinWatcher::RunL;iStatus.Int() with error=%d", err ); + User::Leave(err); + } Post(); - LOGTEXT(_L8("<>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - failed to set the property value"), iOtgIdPin); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP1, + "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - failed to set the property value", iOtgIdPin ); } else { - LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - property is set to 1"), iOtgIdPin); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP2, + "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - property is set to 1", iOtgIdPin ); } break; case RUsbOtgDriver::EIdPinBPlug: case RUsbOtgDriver::EIdPinUnknown: if (RProperty::Set(KUidUsbManCategory,KUsbOtgIdPinPresentProperty,EFalse) != KErrNone) { - LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - failed to set the property value"), iOtgIdPin); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP3, + "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - failed to set the property value", iOtgIdPin ); } else { - LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - property is set to 0"), iOtgIdPin); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP4, + "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - property is set to 0", iOtgIdPin ); } break; default: - LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] is unrecognized, re-request QueueOtgIdPinNotification"), iOtgIdPin); + OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP5, + "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] is unrecognized, re-request QueueOtgIdPinNotification", iOtgIdPin ); break; } SetActive(); + OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_POST_EXIT ); } //----------------------------- VBus watcher class ---------------------------- @@ -223,12 +244,13 @@ */ CUsbOtgVbusWatcher* CUsbOtgVbusWatcher::NewL(RUsbOtgDriver& aLdd) { - LOG_STATIC_FUNC_ENTRY + OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_NEWL_ENTRY ); CUsbOtgVbusWatcher* self = new (ELeave) CUsbOtgVbusWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_NEWL_EXIT ); return self; } @@ -242,10 +264,11 @@ */ CUsbOtgVbusWatcher::~CUsbOtgVbusWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_DES_ENTRY ); Cancel(); RProperty::Delete(KUsbOtgVBusPoweredProperty); + OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_DES_EXIT ); } void CUsbOtgVbusWatcher::ConstructL() @@ -253,7 +276,7 @@ * Performs 2nd phase construction of the OTG object. */ { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CONSTRUCTL_ENTRY ); TInt err = RProperty::Define(KUsbOtgVBusPoweredProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -265,6 +288,7 @@ { User::LeaveIfError(err); } + OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CONSTRUCTL_EXIT ); } /** @@ -277,7 +301,8 @@ CUsbOtgVbusWatcher::CUsbOtgVbusWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_CONS_ENTRY ); + OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_CONS_EXIT ); } /** @@ -285,14 +310,19 @@ */ void CUsbOtgVbusWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::RunL [iStatus=%d]"), iStatus.Int()); + OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_RUNL, "CUsbOtgVbusWatcher::RunL;iStatus=%d", iStatus.Int() ); - LEAVEIFERRORL(iStatus.Int()); + TInt err = iStatus.Int(); + if(err < 0) + { + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_RUNL_DUP1, "CUsbOtgVbusWatcher::RunL;iStatus.Int() with error=%d", err ); + User::Leave(err); + } Post(); - LOGTEXT(_L8("<>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](EVbusHigh) - failed to set the property value"), iOtgVbus); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP1, + "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](EVbusHigh) - failed to set the property value", iOtgVbus ); } else { - LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](EVbusHigh) - property is set to ETrue"), iOtgVbus); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP2, + "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](EVbusHigh) - property is set to ETrue", iOtgVbus ); } break; case RUsbOtgDriver::EVbusLow: case RUsbOtgDriver::EVbusUnknown: if (RProperty::Set(KUidUsbManCategory,KUsbOtgVBusPoweredProperty,EFalse) != KErrNone) { - LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - failed to set the property value"), iOtgVbus); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP3, + "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - failed to set the property value", iOtgVbus ); } else { - LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - property is set to EFalse"), iOtgVbus); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP4, + "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - property is set to EFalse", iOtgVbus ); } break; default: - LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::RunL [iOtgVbus=%d] is unrecognized, re-request QueueOtgVbusNotification"), iOtgVbus); + OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP5, + "CUsbOtgVbusWatcher::Post;iOtgVbus=%d] is unrecognized, re-request QueueOtgVbusNotification", iOtgVbus ); break; } SetActive(); + OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_POST_EXIT ); } @@ -358,12 +396,13 @@ */ CUsbOtgStateWatcher* CUsbOtgStateWatcher::NewL(RUsbOtgDriver& aLdd) { - LOG_STATIC_FUNC_ENTRY + OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_NEWL_ENTRY ); CUsbOtgStateWatcher* self = new (ELeave) CUsbOtgStateWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_NEWL_EXIT ); return self; } @@ -377,9 +416,10 @@ */ CUsbOtgStateWatcher::~CUsbOtgStateWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_DES_ENTRY ); Cancel(); RProperty::Delete(KUsbOtgStateProperty); + OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_DES_EXIT ); } void CUsbOtgStateWatcher::ConstructL() @@ -387,7 +427,7 @@ * Performs 2nd phase construction of the OTG object. */ { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CONSTRUCTL_ENTRY ); TInt err = RProperty::Define(KUsbOtgStateProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -399,6 +439,7 @@ { User::LeaveIfError(err); } + OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CONSTRUCTL_EXIT ); } /** @@ -412,8 +453,9 @@ CUsbOtgStateWatcher::CUsbOtgStateWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_CONS_ENTRY ); iOtgState = RUsbOtgDriver::EStateReset; + OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_CONS_EXIT ); } /** @@ -421,14 +463,19 @@ */ void CUsbOtgStateWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CUsbOtgStateWatcher::RunL [iStatus=%d]"), iStatus.Int()); + OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CUSBOTGSTATEWATCHER_RUNL, "CUsbOtgStateWatcher::RunL;iStatus.Int()=%d", iStatus.Int() ); - LEAVEIFERRORL(iStatus.Int()); + TInt err = iStatus.Int(); + if(err < 0) + { + OstTrace1( TRACE_NORMAL, CUSBOTGSTATEWATCHER_RUNL_DUP1, "CUsbOtgStateWatcher::RunL;iStatus.Int() with error=%d", err ); + User::Leave(err); + } Post(); - LOGTEXT(_L8("<>CUsbOtgStateWatcher::RunL [iStatus=%d], iOtgState = %d"), iStatus.Int(), iOtgState); + OstTraceExt2( TRACE_NORMAL, CUSBOTGSTATEWATCHER_POST_DUP1, + "CUsbOtgStateWatcher::Post;[iStatus=%d], iOtgState = %d", iStatus.Int(), iOtgState ); if (RProperty::Set(KUidUsbManCategory,KUsbOtgStateProperty,(TInt)iOtgState) != KErrNone) { - LOGTEXT3(_L8(">>CUsbOtgStateWatcher::RunL [iStatus=%d], iOtgState = %d - failed to set the property"), iStatus.Int(), iOtgState); + OstTraceExt2( TRACE_NORMAL, CUSBOTGSTATEWATCHER_POST_DUP2, + "CUsbOtgStateWatcher::Post;[iStatus=%d], iOtgState = %d - failed to set the property", iStatus.Int(), iOtgState ); } SetActive(); + OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_POST_EXIT ); } //-------------------------- OTG Events watcher class ------------------------- @@ -475,12 +526,13 @@ CUsbOtgEventWatcher* CUsbOtgEventWatcher::NewL(CUsbOtg& aOwner, RUsbOtgDriver& aLdd, RUsbOtgDriver::TOtgEvent& aOtgEvent) { - LOG_STATIC_FUNC_ENTRY + OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_NEWL_ENTRY ); CUsbOtgEventWatcher* self = new (ELeave) CUsbOtgEventWatcher(aOwner, aLdd, aOtgEvent); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_NEWL_EXIT ); return self; } @@ -494,8 +546,9 @@ */ CUsbOtgEventWatcher::~CUsbOtgEventWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_DES_ENTRY ); Cancel(); + OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_DES_EXIT ); } void CUsbOtgEventWatcher::ConstructL() @@ -503,7 +556,8 @@ * Performs 2nd phase construction of the OTG object. */ { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CONSTRUCTL_ENTRY ); + OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CONSTRUCTL_EXIT ); } /** @@ -519,7 +573,8 @@ RUsbOtgDriver::TOtgEvent& aOtgEvent) : CUsbOtgBaseWatcher(aLdd), iOwner(aOwner), iOtgEvent(aOtgEvent) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_CONS_ENTRY ); + OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_CONS_EXIT ); } /** @@ -527,11 +582,17 @@ */ void CUsbOtgEventWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CUsbOtgEventWatcher::RunL [iStatus=%d]"), iStatus.Int()); - - LEAVEIFERRORL(iStatus.Int()); - LOGTEXT2(_L8("CUsbOtgEventWatcher::RunL() - Otg Event reported: %d"), (TInt)iOtgEvent); + OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL, "CUsbOtgEventWatcher::RunL;iStatus=%d", iStatus.Int() ); + TInt err = iStatus.Int(); + if(err < 0) + { + OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP3, "CUsbOtgEventWatcher::RunL;iStatus.Int() with error=%d", err ); + User::Leave(err); + } + + OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP1, + "CUsbOtgEventWatcher::RunL; - Otg Event reported: %d", (TInt)iOtgEvent ); if ( ( iOtgEvent == RUsbOtgDriver::EEventHnpDisabled ) ||( iOtgEvent == RUsbOtgDriver::EEventHnpEnabled ) ||( iOtgEvent == RUsbOtgDriver::EEventSrpInitiated ) @@ -541,13 +602,14 @@ ) { iOwner.NotifyOtgEvent(); - LOGTEXT2(_L8("CUsbOtgEventWatcher::RunL() - The owner is notified about Otg Event = %d"), (TInt)iOtgEvent); + OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP2, + "CUsbOtgEventWatcher::RunL - The owner is notified about Otg Event = %d", (TInt)iOtgEvent ); } Post(); - LOGTEXT(_L8("<CUsbOtgWatcher::~CUsbOtgWatcher (0x%08x)"), (TUint32) this); + OstTraceFunctionEntry1( CUSBOTGWATCHER_CUSBOTGWATCHER_DES_ENTRY, this ); Cancel(); } @@ -666,8 +741,9 @@ CUsbOtgWatcher::CUsbOtgWatcher(MUsbOtgObserver& aOwner, RUsbOtgDriver& aLdd, TUint& aOtgMessage) : CActive(CActive::EPriorityStandard), iOwner(aOwner), iLdd(aLdd), iOtgMessage(aOtgMessage) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGWATCHER_CUSBOTGWATCHER_CONS_ENTRY ); CActiveScheduler::Add(this); + OstTraceFunctionExit0( CUSBOTGWATCHER_CUSBOTGWATCHER_CONS_EXIT ); } /** @@ -675,17 +751,19 @@ */ void CUsbOtgWatcher::RunL() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGWATCHER_RUNL_ENTRY ); if (iStatus.Int() != KErrNone) { - LOGTEXT2(_L8("CUsbOtgWatcher::RunL() - Error = %d"), iStatus.Int()); + OstTrace1( TRACE_NORMAL, CUSBOTGWATCHER_RUNL, "CUsbOtgWatcher::RunL;Error=%d", iStatus.Int() ); + OstTraceFunctionExit0( CUSBOTGWATCHER_RUNL_EXIT ); return; } - LOGTEXT2(_L8("CUsbOtgWatcher::RunL() - Otg Message reported: %d"), iOtgMessage); + OstTrace1( TRACE_NORMAL, CUSBOTGWATCHER_RUNL_DUP1, "CUsbOtgWatcher::RunL;Otg Message reported: %d", iOtgMessage ); iOwner.NotifyMessage(); Post(); + OstTraceFunctionExit0( CUSBOTGWATCHER_RUNL_EXIT_DUP1 ); } @@ -694,8 +772,9 @@ */ void CUsbOtgWatcher::DoCancel() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGWATCHER_DOCANCEL_ENTRY ); iLdd.CancelOtgMessageRequest(); + OstTraceFunctionExit0( CUSBOTGWATCHER_DOCANCEL_EXIT ); } @@ -704,8 +783,9 @@ */ void CUsbOtgWatcher::Start() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGWATCHER_START_ENTRY ); Post(); + OstTraceFunctionExit0( CUSBOTGWATCHER_START_EXIT ); } /** @@ -713,11 +793,12 @@ */ void CUsbOtgWatcher::Post() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGWATCHER_POST_ENTRY ); - LOGTEXT(_L8("CUsbOtgWatcher::Post() - About to call QueueOtgMessageRequest")); + OstTrace0( TRACE_NORMAL, CUSBOTGWATCHER_POST, "CUsbOtgWatcher::Post - About to call QueueOtgMessageRequest" ); iLdd.QueueOtgMessageRequest((RUsbOtgDriver::TOtgMessage&)iOtgMessage, iStatus); SetActive(); + OstTraceFunctionExit0( CUSBOTGWATCHER_POST_EXIT ); } @@ -747,7 +828,7 @@ * Performs 2nd phase construction of the OTG object. */ { - LOG_FUNC + OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_CONSTRUCTL_ENTRY ); TInt err = RProperty::Define(KUsbRequestSessionProperty, RProperty::EInt, KAllowAllPolicy, KRequestSessionPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -762,13 +843,15 @@ User::LeaveIfError(iProp.Attach(KUidUsbManCategory, KUsbRequestSessionProperty)); iProp.Subscribe(iStatus); SetActive(); + OstTraceFunctionExit0( CREQUESTSESSIONWATCHER_CONSTRUCTL_EXIT ); } CRequestSessionWatcher::CRequestSessionWatcher(MUsbOtgObserver& aOwner) : CActive(CActive::EPriorityStandard), iOwner(aOwner) { - LOG_FUNC + OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_CREQUESTSESSIONWATCHER_CONS_ENTRY ); CActiveScheduler::Add(this); + OstTraceFunctionExit0( CREQUESTSESSIONWATCHER_CREQUESTSESSIONWATCHER_CONS_EXIT ); } /** @@ -776,8 +859,8 @@ */ void CRequestSessionWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CRequestSessionWatcher::RunL [iStatus=%d]"), iStatus.Int()); + OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CREQUESTSESSIONWATCHER_RUNL, "CRequestSessionWatcher::RunL;iStatus=%d", iStatus.Int() ); RDebug::Printf(">>CRequestSessionWatcher::RunL [iStatus=%d]", iStatus.Int()); iProp.Subscribe(iStatus); @@ -789,7 +872,7 @@ iOwner.NotifyMessage(KUsbMessageRequestSession); - LOGTEXT(_L8("<ConstructL(); CleanupStack::Pop(self); + OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_NEWL_EXIT ); return self; } @@ -834,9 +919,10 @@ */ CUsbOtgConnectionIdleWatcher::~CUsbOtgConnectionIdleWatcher() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_DES_ENTRY ); Cancel(); RProperty::Delete(KUsbOtgConnectionIdleProperty); + OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_DES_EXIT ); } /** @@ -844,7 +930,7 @@ */ void CUsbOtgConnectionIdleWatcher::ConstructL() { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CONSTRUCTL_ENTRY ); TInt err = RProperty::Define(KUsbOtgConnectionIdleProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -856,6 +942,7 @@ { User::LeaveIfError(err); } + OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CONSTRUCTL_EXIT ); } /** @@ -869,7 +956,8 @@ CUsbOtgConnectionIdleWatcher::CUsbOtgConnectionIdleWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - LOG_FUNC + OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_CONS_ENTRY ); + OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_CONS_EXIT ); } /** @@ -877,14 +965,20 @@ */ void CUsbOtgConnectionIdleWatcher::RunL() { - LOG_FUNC - LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::RunL [iStatus=%d]"), iStatus.Int()); - - LEAVEIFERRORL(iStatus.Int()); + OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_RUNL_ENTRY ); + OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_RUNL, + "CUsbOtgConnectionIdleWatcher::RunL;iStatus=%d", iStatus.Int() ); + TInt err = iStatus.Int(); + if(err < 0) + { + OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_RUNL_DUP1, "CUsbOtgConnectionIdleWatcher::RunL;iStatus.Int() with error=%d", err ); + User::Leave(err); + } + Post(); - LOGTEXT(_L8("<>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] - property is set to 1"), iConnectionIdle); + OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_POST_DUP1, + "CUsbOtgConnectionIdleWatcher::Post;[iConnectionIdle=%d] - property is set to 1", iConnectionIdle ); break; case RUsbOtgDriver::EConnectionBusy: RProperty::Set(KUidUsbManCategory,KUsbOtgConnectionIdleProperty,EFalse); - LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] - property is set to 0"), iConnectionIdle); + OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_POST_DUP2, + "CUsbOtgConnectionIdleWatcher::Post;[iConnectionIdle=%d] - property is set to 0", iConnectionIdle ); break; default: - LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] is unrecognized, re-request QueueOtgIdPinNotification"), iConnectionIdle); + OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_POST_DUP3, + "CUsbOtgConnectionIdleWatcher::Post;[iConnectionIdle=%d] is unrecognized, re-request QueueOtgIdPinNotification", iConnectionIdle ); break; } SetActive(); + OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_POST_EXIT ); }