From f366e4f987df72c92eadd60fbe90cb148d3117e7 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 22 Dec 2017 08:41:05 -0800 Subject: [PATCH] [logging] remove otLogFunc macros (#2438) --- src/core/api/instance_api.cpp | 4 -- src/core/api/ip6_api.cpp | 8 ---- src/core/api/tasklet_api.cpp | 3 +- src/core/api/thread_api.cpp | 3 -- src/core/coap/coap_secure.cpp | 19 +------- src/core/common/logging.hpp | 8 ---- src/core/common/timer.cpp | 8 +--- src/core/mac/mac.cpp | 26 +++-------- src/core/meshcop/commissioner.cpp | 72 ++++++------------------------ src/core/meshcop/joiner.cpp | 31 ++----------- src/core/meshcop/joiner_router.cpp | 13 +----- src/core/net/ip6.cpp | 6 --- src/core/thread/mle.cpp | 12 +---- 13 files changed, 29 insertions(+), 184 deletions(-) diff --git a/src/core/api/instance_api.cpp b/src/core/api/instance_api.cpp index ac4b3ed6a..0d70f91e6 100644 --- a/src/core/api/instance_api.cpp +++ b/src/core/api/instance_api.cpp @@ -50,10 +50,8 @@ otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize) { Instance *instance; - otLogFuncEntry(); instance = Instance::Init(aInstanceBuffer, aInstanceBufferSize); otLogInfoApi(*instance, "otInstance Initialized"); - otLogFuncExit(); return instance; } @@ -76,9 +74,7 @@ void otInstanceFinalize(otInstance *aInstance) { Instance &instance = *static_cast(aInstance); - otLogFuncEntry(); instance.Finalize(); - otLogFuncExit(); } otError otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext) diff --git a/src/core/api/ip6_api.cpp b/src/core/api/ip6_api.cpp index 904384628..a47ddf45b 100644 --- a/src/core/api/ip6_api.cpp +++ b/src/core/api/ip6_api.cpp @@ -48,8 +48,6 @@ otError otIp6SetEnabled(otInstance *aInstance, bool aEnabled) otError error = OT_ERROR_NONE; Instance &instance = *static_cast(aInstance); - otLogFuncEntry(); - if (aEnabled) { #if OPENTHREAD_ENABLE_RAW_LINK_API @@ -68,7 +66,6 @@ otError otIp6SetEnabled(otInstance *aInstance, bool aEnabled) #if OPENTHREAD_ENABLE_RAW_LINK_API exit: #endif // OPENTHREAD_ENABLE_RAW_LINK_API - otLogFuncExitErr(error); return error; } @@ -189,13 +186,9 @@ otError otIp6Send(otInstance *aInstance, otMessage *aMessage) otError error; Instance &instance = *static_cast(aInstance); - otLogFuncEntry(); - error = instance.GetIp6().SendRaw(*static_cast(aMessage), instance.GetThreadNetif().GetInterfaceId()); - otLogFuncExitErr(error); - return error; } @@ -204,7 +197,6 @@ otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled) Instance &instance = *static_cast(aInstance); Message *message = instance.GetMessagePool().New(Message::kTypeIp6, 0); - if (message) { message->SetLinkSecurityEnabled(aLinkSecurityEnabled); diff --git a/src/core/api/tasklet_api.cpp b/src/core/api/tasklet_api.cpp index 69db5ff7a..cb3dccd1b 100644 --- a/src/core/api/tasklet_api.cpp +++ b/src/core/api/tasklet_api.cpp @@ -47,12 +47,11 @@ void otTaskletsProcess(otInstance *aInstance) { Instance &instance = *static_cast(aInstance); - otLogFuncEntry(); VerifyOrExit(otInstanceIsInitialized(aInstance)); instance.GetTaskletScheduler().ProcessQueuedTasklets(); exit: - otLogFuncExit(); + return; } bool otTaskletsArePending(otInstance *aInstance) diff --git a/src/core/api/thread_api.cpp b/src/core/api/thread_api.cpp index 0db82cd16..cd7ec1bea 100644 --- a/src/core/api/thread_api.cpp +++ b/src/core/api/thread_api.cpp @@ -480,8 +480,6 @@ otError otThreadSetEnabled(otInstance *aInstance, bool aEnabled) otError error = OT_ERROR_NONE; Instance &instance = *static_cast(aInstance); - otLogFuncEntry(); - if (aEnabled) { VerifyOrExit(instance.GetThreadNetif().GetMac().GetPanId() != Mac::kPanIdBroadcast, @@ -494,7 +492,6 @@ otError otThreadSetEnabled(otInstance *aInstance, bool aEnabled) } exit: - otLogFuncExitErr(error); return error; } diff --git a/src/core/coap/coap_secure.cpp b/src/core/coap/coap_secure.cpp index 6fcc1c07c..4d754f056 100644 --- a/src/core/coap/coap_secure.cpp +++ b/src/core/coap/coap_secure.cpp @@ -131,14 +131,11 @@ otError CoapSecure::SendMessage(Message &aMessage, otCoapResponseHandler aHandle { otError error = OT_ERROR_NONE; - otLogFuncEntry(); - VerifyOrExit(IsConnected(), error = OT_ERROR_INVALID_STATE); error = CoapBase::SendMessage(aMessage, mPeerAddress, aHandler, aContext); exit: - otLogFuncExitErr(error); return error; } @@ -158,8 +155,6 @@ void CoapSecure::Receive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo { ThreadNetif &netif = GetNetif(); - otLogFuncEntry(); - if (!netif.GetDtls().IsStarted()) { Ip6::SockAddr sockAddr; @@ -193,7 +188,7 @@ void CoapSecure::Receive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo netif.GetDtls().Receive(aMessage, aMessage.GetOffset(), aMessage.GetLength() - aMessage.GetOffset()); exit: - otLogFuncExit(); + return; } void CoapSecure::HandleDtlsConnected(void *aContext, bool aConnected) @@ -218,8 +213,6 @@ void CoapSecure::HandleDtlsReceive(uint8_t *aBuf, uint16_t aLength) { Message *message = NULL; - otLogFuncEntry(); - VerifyOrExit((message = GetInstance().GetMessagePool().New(Message::kTypeIp6, 0)) != NULL); SuccessOrExit(message->Append(aBuf, aLength)); @@ -231,8 +224,6 @@ exit: { message->Free(); } - - otLogFuncExit(); } otError CoapSecure::HandleDtlsSend(void *aContext, const uint8_t *aBuf, uint16_t aLength, uint8_t aMessageSubType) @@ -244,8 +235,6 @@ otError CoapSecure::HandleDtlsSend(const uint8_t *aBuf, uint16_t aLength, uint8_ { otError error = OT_ERROR_NONE; - otLogFuncEntry(); - if (mTransmitMessage == NULL) { VerifyOrExit((mTransmitMessage = mSocket.NewMessage(0)) != NULL, error = OT_ERROR_NO_BUFS); @@ -271,8 +260,6 @@ exit: mTransmitMessage = NULL; } - otLogFuncExitErr(error); - return error; } @@ -285,8 +272,6 @@ void CoapSecure::HandleUdpTransmit(void) { otError error = OT_ERROR_NONE; - otLogFuncEntry(); - VerifyOrExit(mTransmitMessage != NULL, error = OT_ERROR_NO_BUFS); if (mTransportCallback) @@ -306,8 +291,6 @@ exit: } mTransmitMessage = NULL; - - otLogFuncExit(); } void CoapSecure::HandleRetransmissionTimer(Timer &aTimer) diff --git a/src/core/common/logging.hpp b/src/core/common/logging.hpp index f6b90a1c2..27d4afaf8 100644 --- a/src/core/common/logging.hpp +++ b/src/core/common/logging.hpp @@ -58,14 +58,6 @@ extern "C" { #endif -#ifndef WINDOWS_LOGGING -#define otLogFuncEntry() -#define otLogFuncEntryMsg(aFormat, ...) -#define otLogFuncExit() -#define otLogFuncExitMsg(aFormat, ...) -#define otLogFuncExitErr(error) -#endif - /** * @def otLogCrit * diff --git a/src/core/common/timer.cpp b/src/core/common/timer.cpp index a5c675a69..8cdfe5c96 100644 --- a/src/core/common/timer.cpp +++ b/src/core/common/timer.cpp @@ -215,13 +215,11 @@ extern "C" void otPlatAlarmMilliFired(otInstance *aInstance) { Instance *instance = static_cast(aInstance); - otLogFuncEntry(); - VerifyOrExit(otInstanceIsInitialized(aInstance)); instance->GetTimerMilliScheduler().ProcessTimers(); exit: - otLogFuncExit(); + return; } #if OPENTHREAD_CONFIG_ENABLE_PLATFORM_USEC_TIMER @@ -253,13 +251,11 @@ extern "C" void otPlatAlarmMicroFired(otInstance *aInstance) { Instance *instance = static_cast(aInstance); - otLogFuncEntry(); - VerifyOrExit(otInstanceIsInitialized(aInstance)); instance->GetTimerMicroScheduler().ProcessTimers(); exit: - otLogFuncExit(); + return; } #endif // OPENTHREAD_CONFIG_ENABLE_PLATFORM_USEC_TIMER diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 7f0c2190e..b20cef804 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -419,8 +419,6 @@ void Mac::SetExtAddress(const ExtAddress &aExtAddress) { otExtAddress address; - otLogFuncEntry(); - for (size_t i = 0; i < sizeof(address); i++) { address.m8[i] = aExtAddress.m8[7 - i]; @@ -428,16 +426,13 @@ void Mac::SetExtAddress(const ExtAddress &aExtAddress) otPlatRadioSetExtendedAddress(&GetInstance(), &address); mExtAddress = aExtAddress; - - otLogFuncExit(); } otError Mac::SetShortAddress(ShortAddress aShortAddress) { - otLogFuncEntryMsg("%d", aShortAddress); mShortAddress = aShortAddress; otPlatRadioSetShortAddress(&GetInstance(), aShortAddress); - otLogFuncExit(); + return OT_ERROR_NONE; } @@ -445,15 +440,12 @@ otError Mac::SetChannel(uint8_t aChannel) { otError error = OT_ERROR_NONE; - otLogFuncEntryMsg("%d", aChannel); - VerifyOrExit(OT_RADIO_CHANNEL_MIN <= aChannel && aChannel <= OT_RADIO_CHANNEL_MAX, error = OT_ERROR_INVALID_ARGS); mChannel = aChannel; UpdateIdleMode(); exit: - otLogFuncExit(); return error; } @@ -461,23 +453,19 @@ otError Mac::SetNetworkName(const char *aNetworkName) { otError error = OT_ERROR_NONE; - otLogFuncEntryMsg("%s", aNetworkName); - VerifyOrExit(strlen(aNetworkName) <= OT_NETWORK_NAME_MAX_SIZE, error = OT_ERROR_INVALID_ARGS); (void)strlcpy(mNetworkName.m8, aNetworkName, sizeof(mNetworkName)); exit: - otLogFuncExitErr(error); return error; } otError Mac::SetPanId(PanId aPanId) { - otLogFuncEntryMsg("%d", aPanId); mPanId = aPanId; otPlatRadioSetPanId(&GetInstance(), mPanId); - otLogFuncExit(); + return OT_ERROR_NONE; } @@ -977,11 +965,11 @@ extern "C" void otPlatRadioTxStarted(otInstance *aInstance, otRadioFrame *aFrame { Instance *instance = static_cast(aInstance); - otLogFuncEntry(); VerifyOrExit(instance->IsInitialized()); instance->GetThreadNetif().GetMac().HandleTransmitStarted(aFrame); + exit: - otLogFuncExit(); + return; } void Mac::HandleTransmitStarted(otRadioFrame *aFrame) @@ -1000,7 +988,6 @@ extern "C" void otPlatRadioTxDone(otInstance *aInstance, otRadioFrame *aFrame, o { Instance *instance = static_cast(aInstance); - otLogFuncEntryMsg("%!otError!", aError); VerifyOrExit(instance->IsInitialized()); #if OPENTHREAD_ENABLE_RAW_LINK_API @@ -1016,7 +1003,7 @@ extern "C" void otPlatRadioTxDone(otInstance *aInstance, otRadioFrame *aFrame, o } exit: - otLogFuncExit(); + return; } void Mac::HandleTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError) @@ -1496,7 +1483,6 @@ extern "C" void otPlatRadioReceiveDone(otInstance *aInstance, otRadioFrame *aFra { Instance *instance = static_cast(aInstance); - otLogFuncEntryMsg("%!otError!", aError); VerifyOrExit(instance->IsInitialized()); #if OPENTHREAD_ENABLE_RAW_LINK_API @@ -1512,7 +1498,7 @@ extern "C" void otPlatRadioReceiveDone(otInstance *aInstance, otRadioFrame *aFra } exit: - otLogFuncExit(); + return; } void Mac::HandleReceivedFrame(Frame *aFrame, otError aError) diff --git a/src/core/meshcop/commissioner.cpp b/src/core/meshcop/commissioner.cpp index 8e8e97b4d..924709618 100644 --- a/src/core/meshcop/commissioner.cpp +++ b/src/core/meshcop/commissioner.cpp @@ -102,7 +102,6 @@ otError Commissioner::Start(void) { otError error = OT_ERROR_NONE; - otLogFuncEntry(); VerifyOrExit(mState == OT_COMMISSIONER_STATE_DISABLED, error = OT_ERROR_INVALID_STATE); SuccessOrExit(error = GetNetif().GetCoapSecure().Start(OPENTHREAD_CONFIG_JOINER_UDP_PORT, SendRelayTransmit, this)); @@ -113,7 +112,6 @@ otError Commissioner::Start(void) SendPetition(); exit: - otLogFuncExitErr(error); return error; } @@ -121,7 +119,6 @@ otError Commissioner::Stop(void) { otError error = OT_ERROR_NONE; - otLogFuncEntry(); VerifyOrExit(mState != OT_COMMISSIONER_STATE_DISABLED, error = OT_ERROR_INVALID_STATE); GetNetif().GetCoapSecure().Stop(); @@ -138,7 +135,6 @@ otError Commissioner::Stop(void) SendKeepAlive(); exit: - otLogFuncExitErr(error); return error; } @@ -148,7 +144,6 @@ otError Commissioner::SendCommissionerSet(void) otCommissioningDataset dataset; SteeringDataTlv steeringData; - otLogFuncEntry(); VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); memset(&dataset, 0, sizeof(dataset)); @@ -186,21 +181,17 @@ otError Commissioner::SendCommissionerSet(void) SuccessOrExit(error = SendMgmtCommissionerSetRequest(dataset, NULL, 0)); exit: - otLogFuncExitErr(error); return error; } void Commissioner::ClearJoiners(void) { - otLogFuncEntry(); - for (size_t i = 0; i < sizeof(mJoiners) / sizeof(mJoiners[0]); i++) { mJoiners[i].mValid = false; } SendCommissionerSet(); - otLogFuncExit(); } otError Commissioner::AddJoiner(const Mac::ExtAddress *aEui64, const char *aPSKd, uint32_t aTimeout) @@ -209,7 +200,9 @@ otError Commissioner::AddJoiner(const Mac::ExtAddress *aEui64, const char *aPSKd VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); - otLogFuncEntryMsg("%llX, %s", (aEui64 ? HostSwap64(*reinterpret_cast(aEui64)) : 0), aPSKd); + otLogInfoMeshCoP(GetInstance(), "AddJoiner() %llX, %s", + (aEui64 ? HostSwap64(*reinterpret_cast(aEui64)) : 0), aPSKd); + VerifyOrExit(strlen(aPSKd) <= Dtls::kPskMaxLength, error = OT_ERROR_INVALID_ARGS); RemoveJoiner(aEui64, 0); // remove immediately @@ -242,7 +235,6 @@ otError Commissioner::AddJoiner(const Mac::ExtAddress *aEui64, const char *aPSKd } exit: - otLogFuncExitErr(error); return error; } @@ -253,7 +245,8 @@ otError Commissioner::RemoveJoiner(const Mac::ExtAddress *aEui64, uint32_t aDela VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); - otLogFuncEntryMsg("%llX", (aEui64 ? HostSwap64(*reinterpret_cast(aEui64)) : 0)); + otLogInfoMeshCoP(GetInstance(), "RemoveJoiner() %llX", + (aEui64 ? HostSwap64(*reinterpret_cast(aEui64)) : 0)); if (aEui64 != NULL) { @@ -301,7 +294,6 @@ otError Commissioner::RemoveJoiner(const Mac::ExtAddress *aEui64, uint32_t aDela } exit: - otLogFuncExitErr(error); return error; } @@ -412,8 +404,6 @@ otError Commissioner::SendMgmtCommissionerGetRequest(const uint8_t *aTlvs, Ip6::MessageInfo messageInfo; MeshCoP::Tlv tlv; - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); header.SetToken(Coap::Header::kDefaultTokenLength); header.AppendUriPathOptions(OT_URI_PATH_COMMISSIONER_GET); @@ -448,7 +438,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } @@ -463,16 +452,14 @@ void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeade void Commissioner::HandleMgmtCommissisonerGetResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, otError aResult) { - (void) aMessage; - (void) aMessageInfo; - - otLogFuncEntry(); + OT_UNUSED_VARIABLE(aMessage); + OT_UNUSED_VARIABLE(aMessageInfo); VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED); otLogInfoMeshCoP(GetInstance(), "received MGMT_COMMISSIONER_GET response"); exit: - otLogFuncExit(); + return; } otError Commissioner::SendMgmtCommissionerSetRequest(const otCommissioningDataset &aDataset, @@ -484,8 +471,6 @@ otError Commissioner::SendMgmtCommissionerSetRequest(const otCommissioningDatase Message *message; Ip6::MessageInfo messageInfo; - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); header.SetToken(Coap::Header::kDefaultTokenLength); header.AppendUriPathOptions(OT_URI_PATH_COMMISSIONER_SET); @@ -552,7 +537,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } @@ -567,16 +551,14 @@ void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeade void Commissioner::HandleMgmtCommissisonerSetResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, otError aResult) { - (void) aMessage; - (void) aMessageInfo; - - otLogFuncEntry(); + OT_UNUSED_VARIABLE(aMessage); + OT_UNUSED_VARIABLE(aMessageInfo); VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED); otLogInfoMeshCoP(GetInstance(), "received MGMT_COMMISSIONER_SET response"); exit: - otLogFuncExit(); + return; } otError Commissioner::SendPetition(void) @@ -588,8 +570,6 @@ otError Commissioner::SendPetition(void) Ip6::MessageInfo messageInfo; CommissionerIdTlv commissionerId; - otLogFuncEntry(); - mTransmitAttempts++; header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); @@ -619,7 +599,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } @@ -641,8 +620,6 @@ void Commissioner::HandleLeaderPetitionResponse(Coap::Header *aHeader, Message * CommissionerSessionIdTlv sessionId; bool retransmit = false; - otLogFuncEntry(); - VerifyOrExit(mState == OT_COMMISSIONER_STATE_PETITION, mState = OT_COMMISSIONER_STATE_DISABLED); VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED, retransmit = true); @@ -678,8 +655,6 @@ exit: } GetNotifier().SetFlags(OT_CHANGED_COMMISSIONER_STATE); - - otLogFuncExit(); } otError Commissioner::SendKeepAlive(void) @@ -692,8 +667,6 @@ otError Commissioner::SendKeepAlive(void) StateTlv state; CommissionerSessionIdTlv sessionId; - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); header.SetToken(Coap::Header::kDefaultTokenLength); header.AppendUriPathOptions(OT_URI_PATH_LEADER_KEEP_ALIVE); @@ -724,7 +697,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } @@ -743,8 +715,6 @@ void Commissioner::HandleLeaderKeepAliveResponse(Coap::Header *aHeader, Message StateTlv state; - otLogFuncEntry(); - VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, mState = OT_COMMISSIONER_STATE_DISABLED); VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED, mState = OT_COMMISSIONER_STATE_DISABLED); @@ -764,8 +734,6 @@ exit: { RemoveCoapResources(); } - - otLogFuncExit(); } void Commissioner::HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -788,8 +756,6 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage, uint16_t length; bool enableJoiner = false; - otLogFuncEntry(); - VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_NON_CONFIRMABLE && @@ -856,7 +822,8 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage, exit: OT_UNUSED_VARIABLE(aMessageInfo); - otLogFuncExit(); + + return; } void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -869,7 +836,6 @@ void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, o void Commissioner::HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo) { - otLogFuncEntry(); VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST); @@ -881,7 +847,7 @@ void Commissioner::HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage otLogInfoMeshCoP(GetInstance(), "sent dataset changed acknowledgment"); exit: - otLogFuncExit(); + return; } void Commissioner::HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -898,7 +864,6 @@ void Commissioner::HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage StateTlv::State state = StateTlv::kAccept; ProvisioningUrlTlv provisioningUrl; - otLogFuncEntry(); otLogInfoMeshCoP(GetInstance(), "received joiner finalize"); if (Tlv::GetTlv(aMessage, Tlv::kProvisioningUrl, sizeof(provisioningUrl), provisioningUrl) == OT_ERROR_NONE) @@ -922,8 +887,6 @@ exit: #endif SendJoinFinalizeResponse(aHeader, state); - - otLogFuncExit(); } @@ -937,8 +900,6 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader, Message *message; Mac::ExtAddress extAddr; - otLogFuncEntry(); - responseHeader.SetDefaultResponseHeader(aRequestHeader); responseHeader.SetPayloadMarker(); @@ -977,8 +938,6 @@ exit: { message->Free(); } - - otLogFuncExit(); } otError Commissioner::SendRelayTransmit(void *aContext, Message &aMessage, const Ip6::MessageInfo &aMessageInfo) @@ -1001,8 +960,6 @@ otError Commissioner::SendRelayTransmit(Message &aMessage, const Ip6::MessageInf OT_UNUSED_VARIABLE(aMessageInfo); - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_POST); header.AppendUriPathOptions(OT_URI_PATH_RELAY_TX); header.SetPayloadMarker(); @@ -1052,7 +1009,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index baec25cec..ea08e713c 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -94,8 +94,6 @@ otError Joiner::Start(const char *aPSKd, const char *aProvisioningUrl, Crc16 ccitt(Crc16::kCcitt); Crc16 ansi(Crc16::kAnsi); - otLogFuncEntry(); - VerifyOrExit(mState == OT_JOINER_STATE_IDLE, error = OT_ERROR_BUSY); GetNotifier().SetFlags(OT_CHANGED_JOINER_STATE); @@ -138,17 +136,13 @@ otError Joiner::Start(const char *aPSKd, const char *aProvisioningUrl, mState = OT_JOINER_STATE_DISCOVER; exit: - otLogFuncExitErr(error); return error; } otError Joiner::Stop(void) { - otLogFuncEntry(); - Close(); - otLogFuncExit(); return OT_ERROR_NONE; } @@ -160,12 +154,9 @@ otJoinerState Joiner::GetState(void) const void Joiner::Close(void) { ThreadNetif &netif = GetNetif(); - otLogFuncEntry(); netif.GetCoapSecure().Disconnect(); netif.GetIp6Filter().RemoveUnsecurePort(netif.GetCoapSecure().GetPort()); - - otLogFuncExit(); } void Joiner::Complete(otError aError) @@ -198,13 +189,12 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult, void *aContext) void Joiner::HandleDiscoverResult(otActiveScanResult *aResult) { - otLogFuncEntry(); - if (aResult != NULL) { JoinerRouter joinerRouter; - otLogFuncEntryMsg("aResult = %llX", HostSwap64(*reinterpret_cast(&aResult->mExtAddress))); + otLogDebgMeshCoP(GetInstance(), "HandleDiscoverResult() aResult = %llX", + HostSwap64(*reinterpret_cast(&aResult->mExtAddress))); // Joining is disabled if the Steering Data is not included if (aResult->mSteeringData.mLength == 0) @@ -248,7 +238,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult) } exit: - otLogFuncExit(); + return; } void Joiner::AddJoinerRouter(JoinerRouter &aJoinerRouter) @@ -356,8 +346,6 @@ void Joiner::SendJoinerFinalize(void) VendorSwVersionTlv vendorSwVersionTlv; VendorStackVersionTlv vendorStackVersionTlv; - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); header.AppendUriPathOptions(OT_URI_PATH_JOINER_FINALIZE); header.SetPayloadMarker(); @@ -419,8 +407,6 @@ exit: { message->Free(); } - - otLogFuncExit(); } void Joiner::HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -437,8 +423,6 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Header *aHeader, Message *aMessa (void) aMessageInfo; StateTlv state; - otLogFuncEntry(); - VerifyOrExit(mState == OT_JOINER_STATE_CONNECTED && aResult == OT_ERROR_NONE && aHeader->GetType() == OT_COAP_TYPE_ACKNOWLEDGMENT && @@ -461,7 +445,6 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Header *aHeader, Message *aMessa exit: Close(); - otLogFuncExit(); } void Joiner::HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -483,8 +466,6 @@ void Joiner::HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const ActiveTimestampTlv activeTimestamp; NetworkKeySequenceTlv networkKeySeq; - otLogFuncEntry(); - VerifyOrExit(mState == OT_JOINER_STATE_ENTRUST && aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST, error = OT_ERROR_DROP); @@ -537,8 +518,6 @@ exit: otLogWarnMeshCoP(GetInstance(), "Error while processing joiner entrust: %s", otThreadErrorToString(error)); } - - otLogFuncExit(); } void Joiner::SendJoinerEntrustResponse(const Coap::Header &aRequestHeader, @@ -550,8 +529,6 @@ void Joiner::SendJoinerEntrustResponse(const Coap::Header &aRequestHeader, Coap::Header responseHeader; Ip6::MessageInfo responseInfo(aRequestInfo); - otLogFuncEntry(); - responseHeader.SetDefaultResponseHeader(aRequestHeader); VerifyOrExit((message = NewMeshCoPMessage(netif.GetCoap(), responseHeader)) != NULL, error = OT_ERROR_NO_BUFS); @@ -573,8 +550,6 @@ exit: { message->Free(); } - - otLogFuncExit(); } void Joiner::HandleTimer(Timer &aTimer) diff --git a/src/core/meshcop/joiner_router.cpp b/src/core/meshcop/joiner_router.cpp index 8cf8a7c27..fe29d84e4 100644 --- a/src/core/meshcop/joiner_router.cpp +++ b/src/core/meshcop/joiner_router.cpp @@ -139,11 +139,10 @@ exit: otError JoinerRouter::SetJoinerUdpPort(uint16_t aJoinerUdpPort) { - otLogFuncEntry(); mJoinerUdpPort = aJoinerUdpPort; mIsJoinerPortConfigured = true; HandleStateChanged(OT_CHANGED_THREAD_NETDATA); - otLogFuncExit(); + return OT_ERROR_NONE; } @@ -166,8 +165,6 @@ void JoinerRouter::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a ExtendedTlv tlv; uint16_t borderAgentRloc; - otLogFuncEntryMsg("from peer: %llX", - HostSwap64(*reinterpret_cast(aMessageInfo.GetPeerAddr().mFields.m8 + 8))); otLogInfoMeshCoP(GetInstance(), "JoinerRouter::HandleUdpReceive"); SuccessOrExit(error = GetBorderAgentRloc(borderAgentRloc)); @@ -226,8 +223,6 @@ exit: { message->Free(); } - - otLogFuncExitErr(error); } void JoinerRouter::HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, @@ -249,7 +244,6 @@ void JoinerRouter::HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage, Message *message = NULL; Ip6::MessageInfo messageInfo; - otLogFuncEntry(); VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_NON_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST, error = OT_ERROR_DROP); @@ -307,8 +301,6 @@ exit: { message->Free(); } - - otLogFuncExitErr(error); } @@ -330,8 +322,6 @@ otError JoinerRouter::DelaySendingJoinerEntrust(const Ip6::MessageInfo &aMessage DelayedJoinEntHeader delayedMessage; - otLogFuncEntry(); - header.Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST); header.AppendUriPathOptions(OT_URI_PATH_JOINER_ENTRUST); header.SetPayloadMarker(); @@ -422,7 +412,6 @@ exit: message->Free(); } - otLogFuncExitErr(error); return error; } diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index 6eb950454..26e563484 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -706,7 +706,6 @@ otError Ip6::HandleDatagram(Message &aMessage, Netif *aNetif, int8_t aInterfaceI uint8_t hopLimit; int8_t forwardInterfaceId; - otLogFuncEntry(); #if 0 uint8_t buf[1024]; @@ -833,7 +832,6 @@ exit: aMessage.Free(); } - otLogFuncExitErr(error); return error; } @@ -841,8 +839,6 @@ int8_t Ip6::FindForwardInterfaceId(const MessageInfo &aMessageInfo) { int8_t interfaceId; - otLogFuncEntry(); - if (aMessageInfo.GetSockAddr().IsMulticast()) { // multicast @@ -868,8 +864,6 @@ int8_t Ip6::FindForwardInterfaceId(const MessageInfo &aMessageInfo) interfaceId = 0; } - otLogFuncExit(); - return interfaceId; } diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 49454d8fd..445548466 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -238,8 +238,6 @@ otError Mle::Start(bool aEnableReattach, bool aAnnounceAttach) ThreadNetif &netif = GetNetif(); otError error = OT_ERROR_NONE; - otLogFuncEntry(); - // cannot bring up the interface if IEEE 802.15.4 promiscuous mode is enabled VerifyOrExit(otPlatRadioGetPromiscuous(&netif.GetInstance()) == false, error = OT_ERROR_INVALID_STATE); VerifyOrExit(netif.IsUp(), error = OT_ERROR_INVALID_STATE); @@ -274,7 +272,6 @@ otError Mle::Start(bool aEnableReattach, bool aAnnounceAttach) } exit: - otLogFuncExitErr(error); return error; } @@ -282,7 +279,6 @@ otError Mle::Stop(bool aClearNetworkDatasets) { ThreadNetif &netif = GetNetif(); - otLogFuncEntry(); netif.GetKeyManager().Stop(); SetStateDetached(); netif.RemoveUnicastAddress(mMeshLocal16); @@ -298,7 +294,7 @@ otError Mle::Stop(bool aClearNetworkDatasets) } mRole = OT_DEVICE_ROLE_DISABLED; - otLogFuncExit(); + return OT_ERROR_NONE; } @@ -503,8 +499,6 @@ otError Mle::BecomeDetached(void) ThreadNetif &netif = GetNetif(); otError error = OT_ERROR_NONE; - otLogFuncEntry(); - VerifyOrExit(mRole != OT_DEVICE_ROLE_DISABLED, error = OT_ERROR_INVALID_STATE); // not in reattach stage after reset @@ -523,7 +517,6 @@ otError Mle::BecomeDetached(void) BecomeChild(kAttachAny); exit: - otLogFuncExitErr(error); return error; } @@ -532,8 +525,6 @@ otError Mle::BecomeChild(AttachMode aMode) ThreadNetif &netif = GetNetif(); otError error = OT_ERROR_NONE; - otLogFuncEntry(); - VerifyOrExit(mRole != OT_DEVICE_ROLE_DISABLED, error = OT_ERROR_INVALID_STATE); VerifyOrExit(mParentRequestState == kParentIdle, error = OT_ERROR_BUSY); @@ -568,7 +559,6 @@ otError Mle::BecomeChild(AttachMode aMode) mParentRequestTimer.Start((otPlatRandomGet() % kParentRequestRouterTimeout) + 1); exit: - otLogFuncExitErr(error); return error; }