Bug 945193 - Print function name in bluetooth logs, r=echou
authorBen Tian <btian@mozilla.com>
Mon, 02 Dec 2013 18:50:23 +0800
changeset 174403 7141a3a6681a630bd56349fd7f6d16d7ce7dd381
parent 174402 d3f56187fa5dd089a6b9e508d6ac5c880f5ec681
child 174404 8bf0701f98892508842eb1a2cf7f8916692c766b
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs945193
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 945193 - Print function name in bluetooth logs, r=echou
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/BluetoothProfileController.cpp
dom/bluetooth/BluetoothRilListener.cpp
dom/bluetooth/bluedroid/BluetoothHfpManager.cpp
dom/bluetooth/bluedroid/BluetoothOppManager.cpp
dom/bluetooth/bluedroid/BluetoothSocket.cpp
dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
dom/bluetooth/bluez/BluetoothOppManager.cpp
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -14,49 +14,52 @@
 
 extern bool gBluetoothDebugFlag;
 
 #define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
 
 #undef BT_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
+
 /**
  * Prints 'D'EBUG build logs, which show in DEBUG build only when
  * developer setting 'Bluetooth output in adb' is enabled.
  */
-#define BT_LOGD(args...)                                             \
+#define BT_LOGD(msg, ...)                                            \
   do {                                                               \
     if (gBluetoothDebugFlag) {                                       \
-      __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", args); \
+      __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth",        \
+                          "%s: " msg, __FUNCTION__, ##__VA_ARGS__);  \
     }                                                                \
   } while(0)
 
 /**
  * Prints 'R'ELEASE build logs, which show in both RELEASE and DEBUG builds.
  */
-#define BT_LOGR(args...)                                             \
-  __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", args)      \
+#define BT_LOGR(msg, ...)                                            \
+  __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth",            \
+                      "%s: " msg, __FUNCTION__, ##__VA_ARGS__)       \
 
 /**
  * Prints DEBUG build warnings, which show in DEBUG build only.
  */
 #define BT_WARNING(args...)                                          \
   NS_WARNING(nsPrintfCString(args).get())                            \
 
 #else
-#define BT_LOGD(args, ...)                                           \
+#define BT_LOGD(msg, ...)                                            \
   do {                                                               \
     if (gBluetoothDebugFlag) {                                       \
-      printf(args, ##__VA_ARGS__);                                   \
+      printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__);               \
     }                                                                \
   } while(0)
 
-#define BT_LOGR(args, ...) printf(args, ##__VA_ARGS__)
-#define BT_WARNING(args, ...) printf(args, ##__VA_ARGS__)
+#define BT_LOGR(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__))
+#define BT_WARNING(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__))
 #endif
 
 #define BEGIN_BLUETOOTH_NAMESPACE \
   namespace mozilla { namespace dom { namespace bluetooth {
 #define END_BLUETOOTH_NAMESPACE \
   } /* namespace bluetooth */ } /* namespace dom */ } /* namespace mozilla */
 #define USING_BLUETOOTH_NAMESPACE \
   using namespace mozilla::dom::bluetooth;
--- a/dom/bluetooth/BluetoothProfileController.cpp
+++ b/dom/bluetooth/BluetoothProfileController.cpp
@@ -11,22 +11,21 @@
 #include "BluetoothHfpManager.h"
 #include "BluetoothHidManager.h"
 
 #include "BluetoothUtils.h"
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
 
 USING_BLUETOOTH_NAMESPACE
 
-#define BT_LOGR_PROFILE(mgr, args...)                 \
-  do {                                                \
-    nsCString name;                                   \
-    mgr->GetName(name);                               \
-    BT_LOGR("%s: [%s] %s", __FUNCTION__, name.get(),  \
-      nsPrintfCString(args).get());                   \
+#define BT_LOGR_PROFILE(mgr, msg, ...)               \
+  do {                                               \
+    nsCString name;                                  \
+    mgr->GetName(name);                              \
+    BT_LOGR("[%s] " msg, name.get(), ##__VA_ARGS__); \
   } while(0)
 
 BluetoothProfileController::BluetoothProfileController(
                                    bool aConnect,
                                    const nsAString& aDeviceAddress,
                                    BluetoothReplyRunnable* aRunnable,
                                    BluetoothProfileControllerCallback aCallback,
                                    uint16_t aServiceUuid,
--- a/dom/bluetooth/BluetoothRilListener.cpp
+++ b/dom/bluetooth/BluetoothRilListener.cpp
@@ -374,18 +374,17 @@ BluetoothRilListener::ServiceChanged(uin
     mClientId = aClientId;
   } else {
     SelectClient();
   }
 
   // Restart listening
   ListenMobileConnAndIccInfo(true);
 
-  BT_LOGR("%s: %d client %d. new mClientId %d",
-          __FUNCTION__, aRegistered, aClientId,
+  BT_LOGR("%d client %d. new mClientId %d", aRegistered, aClientId,
           (mClientId < mMobileConnListeners.Length()) ? mClientId : -1);
 }
 
 void
 BluetoothRilListener::EnumerateCalls()
 {
   nsCOMPtr<nsITelephonyProvider> provider =
     do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
--- a/dom/bluetooth/bluedroid/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHfpManager.cpp
@@ -513,17 +513,17 @@ BluetoothHfpManager::Notify(const hal::B
   mBattChg = (int) ceil(aBatteryInfo.level() * 5.0);
   UpdateDeviceCIND();
 }
 
 void
 BluetoothHfpManager::ProcessConnectionState(bthf_connection_state_t aState,
                                             bt_bdaddr_t* aBdAddress)
 {
-  BT_LOGR("%s: state %d", __FUNCTION__, aState);
+  BT_LOGR("state %d", aState);
 
   mConnectionState = aState;
 
   if (aState == BTHF_CONNECTION_STATE_CONNECTED) {
     BdAddressTypeToString(aBdAddress, mDeviceAddress);
     BT_HF_DISPATCH_MAIN(MainThreadTaskCmd::NOTIFY_CONN_STATE_CHANGED,
                         NS_LITERAL_STRING(BLUETOOTH_HFP_STATUS_CHANGED_ID));
   } else if (aState == BTHF_CONNECTION_STATE_DISCONNECTED) {
@@ -532,17 +532,17 @@ BluetoothHfpManager::ProcessConnectionSt
                         NS_LITERAL_STRING(BLUETOOTH_HFP_STATUS_CHANGED_ID));
   }
 }
 
 void
 BluetoothHfpManager::ProcessAudioState(bthf_audio_state_t aState,
                                        bt_bdaddr_t* aBdAddress)
 {
-  BT_LOGR("%s: state %d", __FUNCTION__, aState);
+  BT_LOGR("state %d", aState);
 
   mAudioState = aState;
 
   if (aState == BTHF_AUDIO_STATE_CONNECTED ||
       aState == BTHF_AUDIO_STATE_DISCONNECTED) {
     BT_HF_DISPATCH_MAIN(MainThreadTaskCmd::NOTIFY_CONN_STATE_CHANGED,
                         NS_LITERAL_STRING(BLUETOOTH_SCO_STATUS_CHANGED_ID));
   }
@@ -697,17 +697,17 @@ BluetoothHfpManager::ProcessAtClcc()
 
     SendCLCC(mCdmaSecondCall, 2);
   }
 }
 
 void
 BluetoothHfpManager::ProcessUnknownAt(char *aAtString)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, aAtString);
+  BT_LOGR("[%s]", aAtString);
 
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
   NS_ENSURE_TRUE_VOID(BT_STATUS_SUCCESS ==
     sBluetoothHfpInterface->at_response(BTHF_AT_RESPONSE_ERROR, 0));
 }
 
 void
 BluetoothHfpManager::NotifyConnectionStateChanged(const nsAString& aType)
@@ -962,18 +962,18 @@ BluetoothHfpManager::UpdatePhoneCIND(uin
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   int numActive = GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_CONNECTED);
   int numHeld = GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_HELD);
   bthf_call_state_t bthfCallState = ConvertToBthfCallState(mCallSetupState);
   nsAutoCString number = NS_ConvertUTF16toUTF8(mCurrentCallArray[aCallIndex].mNumber);
   bthf_call_addrtype_t type = mCurrentCallArray[aCallIndex].mType;
 
-  BT_LOGR("%s: [%d] state %d => BTHF: active[%d] held[%d] state[%d]",
-    __FUNCTION__, aCallIndex, callState, numActive, numHeld, bthfCallState);
+  BT_LOGR("[%d] state %d => BTHF: active[%d] held[%d] state[%d]",
+          aCallIndex, callState, numActive, numHeld, bthfCallState);
 
   NS_ENSURE_TRUE_VOID(BT_STATUS_SUCCESS ==
     sBluetoothHfpInterface->phone_state_change(
       numActive, numHeld, bthfCallState, number.get(), type));
 }
 
 void
 BluetoothHfpManager::UpdateDeviceCIND()
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -378,34 +378,34 @@ BluetoothOppManager::DiscardBlobsToSend(
 
   MOZ_ASSERT(!mBatches.IsEmpty());
   MOZ_ASSERT(!mIsServer);
 
   int length = (int) mBatches[0].mBlobs.Length();
   while (length > mCurrentBlobIndex + 1) {
     mBlob = mBatches[0].mBlobs[++mCurrentBlobIndex];
 
-    BT_LOGR("%s: idx %d", __FUNCTION__, mCurrentBlobIndex);
+    BT_LOGR("idx %d", mCurrentBlobIndex);
     ExtractBlobHeaders();
     StartFileTransfer();
     FileTransferComplete();
   }
 }
 
 bool
 BluetoothOppManager::ProcessNextBatch()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Remove the processed batch.
   // A batch is processed if we've incremented mCurrentBlobIndex for it.
   if (mCurrentBlobIndex >= 0) {
     ClearQueue();
     mBatches.RemoveElementAt(0);
-    BT_LOGR("%s: REMOVE. %d remaining", __FUNCTION__, mBatches.Length());
+    BT_LOGR("REMOVE. %d remaining", mBatches.Length());
   }
 
   // Process the next batch
   if (!mBatches.IsEmpty()) {
     ConnectInternal(mBatches[0].mDeviceAddress);
     return true;
   }
 
@@ -753,17 +753,17 @@ BluetoothOppManager::ComposePacket(uint8
     mPutFinalFlag = (aOpCode == ObexRequestCode::PutFinal);
   }
 
   int dataLength = aMessage->mSize - frameHeaderLength;
 
   // Check length before memcpy to prevent from memory pollution
   if (dataLength < 0 ||
       mPacketReceivedLength + dataLength > mPacketLength) {
-    BT_LOGR("%s: Received packet size is unreasonable", __FUNCTION__);
+    BT_LOGR("Received packet size is unreasonable");
 
     ReplyToPut(mPutFinalFlag, false);
     DeleteReceivedFile();
     FileTransferComplete();
 
     return false;
   }
 
@@ -1371,17 +1371,17 @@ BluetoothOppManager::NotifyAboutFileChan
   NS_ENSURE_TRUE_VOID(obs);
 
   obs->NotifyObservers(mDsFile, "file-watcher-notify", data.get());
 }
 
 void
 BluetoothOppManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer)? "server" : "client");
+  BT_LOGR("[%s]", (mIsServer)? "server" : "client");
   MOZ_ASSERT(aSocket);
 
   /**
    * If the created connection is an inbound connection, close server socket
    * because currently only one file-transfer session is allowed. After that,
    * we need to make sure that server socket would be nulled out.
    * As for outbound connections, we just notify the controller that it's done.
    */
@@ -1398,17 +1398,17 @@ BluetoothOppManager::OnSocketConnectSucc
   if (!mIsServer) {
     StartSendingNextFile();
   }
 }
 
 void
 BluetoothOppManager::OnSocketConnectError(BluetoothSocket* aSocket)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer)? "server" : "client");
+  BT_LOGR("[%s]", (mIsServer)? "server" : "client");
 
   mServerSocket = nullptr;
   mSocket = nullptr;
 
   if (!mIsServer) {
     // Inform gaia of remaining blobs' sending failure
     DiscardBlobsToSend();
   }
@@ -1422,17 +1422,17 @@ BluetoothOppManager::OnSocketConnectErro
 void
 BluetoothOppManager::OnSocketDisconnect(BluetoothSocket* aSocket)
 {
   MOZ_ASSERT(aSocket);
   if (aSocket != mSocket) {
     // Do nothing when a listening server socket is closed.
     return;
   }
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer) ? "client" : "server");
+  BT_LOGR("[%s]", (mIsServer) ? "client" : "server");
 
   /**
    * It is valid for a bluetooth device which is transfering file via OPP
    * closing socket without sending OBEX disconnect request first. So we
    * delete the broken file when we failed to receive a file from the remote,
    * and notify the transfer has been completed (but failed). We also call
    * AfterOppDisconnected here to ensure all variables will be cleaned.
    */
--- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp
@@ -664,25 +664,25 @@ BluetoothSocket::ReceiveSocketInfo(nsAut
   }
   mReceivedSocketInfoLength += aMessage->mSize;
 
   size_t offset = 0;
   if (mReceivedSocketInfoLength == FIRST_SOCKET_INFO_MSG_LENGTH) {
     // 1st message: [channel:4]
     int32_t channel = ReadInt32(aMessage->mData, &offset);
 
-    BT_LOGR("%s: channel %d", __FUNCTION__, channel);
+    BT_LOGR("channel %d", channel);
   } else if (mReceivedSocketInfoLength == TOTAL_SOCKET_INFO_LENGTH) {
     // 2nd message: [size:2][bd address:6][channel:4][connection status:4]
     int16_t size = ReadInt16(aMessage->mData, &offset);
     ReadBdAddress(aMessage->mData, &offset, mDeviceAddress);
     int32_t channel = ReadInt32(aMessage->mData, &offset);
     int32_t connectionStatus = ReadInt32(aMessage->mData, &offset);
 
-    BT_LOGR("%s: size %d channel %d remote addr %s status %d", __FUNCTION__,
+    BT_LOGR("size %d channel %d remote addr %s status %d",
       size, channel, NS_ConvertUTF16toUTF8(mDeviceAddress).get(), connectionStatus);
 
     if (connectionStatus != 0) {
       OnConnectError();
       return true;
     }
 
     if (mIsServer) {
--- a/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
@@ -100,31 +100,31 @@ public:
     prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE;
     prop.val = (void*)&mode;
     prop.len = sizeof(mode);
 
     NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
 
     int ret = sBtInterface->set_adapter_property(&prop);
     if (ret != BT_STATUS_SUCCESS) {
-      BT_LOGR("%s: Fail to set: BT_SCAN_MODE_CONNECTABLE", __FUNCTION__);
+      BT_LOGR("Fail to set: BT_SCAN_MODE_CONNECTABLE");
     }
 
     // Try to fire event 'AdapterAdded' to fit the original behaviour when
     // we used BlueZ as backend.
     BluetoothService* bs = BluetoothService::Get();
     NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
 
     bs->AdapterAddedReceived();
     bs->TryFiringAdapterAdded();
 
     // Trigger BluetoothOppManager to listen
     BluetoothOppManager* opp = BluetoothOppManager::Get();
     if (!opp || !opp->Listen()) {
-      BT_LOGR("%s: Fail to start BluetoothOppManager listening", __FUNCTION__);
+      BT_LOGR("Fail to start BluetoothOppManager listening");
     }
 
     return NS_OK;
   }
 };
 
 /**
  *  Static callback functions
@@ -267,17 +267,17 @@ BdAddressTypeToString(bt_bdaddr_t* aBdAd
   aRetBdAddress = NS_ConvertUTF8toUTF16((char*)bdstr);
 }
 
 static void
 AdapterStateChangeCallback(bt_state_t aStatus)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
-  BT_LOGR("%s, BT_STATE:%d", __FUNCTION__, aStatus);
+  BT_LOGR("BT_STATE %d", aStatus);
 
   sIsBtEnabled = (aStatus == BT_STATE_ON);
 
   {
     MonitorAutoLock lock(*sToggleBtMonitor);
     lock.Notify();
   }
 
@@ -668,26 +668,26 @@ bt_callbacks_t sBluetoothCallbacks =
  */
 static bool
 EnsureBluetoothHalLoad()
 {
   hw_module_t* module;
   hw_device_t* device;
   int err = hw_get_module(BT_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
   if (err != 0) {
-    BT_LOGR("Error: %s ", strerror(err));
+    BT_LOGR("Error: %s", strerror(err));
     return false;
   }
   module->methods->open(module, BT_HARDWARE_MODULE_ID, &device);
   sBtDevice = (bluetooth_device_t *)device;
   sBtInterface = sBtDevice->get_bluetooth_interface();
 
   int ret = sBtInterface->init(&sBluetoothCallbacks);
   if (ret != BT_STATUS_SUCCESS) {
-    BT_LOGR("Error while setting the callbacks %s", __FUNCTION__);
+    BT_LOGR("Error while setting the callbacks");
     sBtInterface = nullptr;
   }
 
   return true;
 }
 
 static nsresult
 StartStopGonkBluetooth(bool aShouldEnable)
@@ -707,17 +707,17 @@ StartStopGonkBluetooth(bool aShouldEnabl
 }
 
 static void
 ReplyStatusError(BluetoothReplyRunnable* aBluetoothReplyRunnable,
                  int aStatusCode, const nsAString& aCustomMsg)
 {
   MOZ_ASSERT(aBluetoothReplyRunnable, "Reply runnable is nullptr");
 
-  BT_LOGR("%s: error code(%d)", __FUNCTION__, aStatusCode);
+  BT_LOGR("error code(%d)", aStatusCode);
 
   nsAutoString replyError;
   replyError.Assign(aCustomMsg);
 
   if (aStatusCode == BT_STATUS_BUSY) {
     replyError.AppendLiteral(":BT_STATUS_BUSY");
   } else if (aStatusCode == BT_STATUS_NOT_READY) {
     replyError.AppendLiteral(":BT_STATUS_NOT_READY");
@@ -738,17 +738,17 @@ ReplyStatusError(BluetoothReplyRunnable*
 /**
  *  Member functions
  */
 BluetoothServiceBluedroid::BluetoothServiceBluedroid()
 {
   sToggleBtMonitor = new Monitor("BluetoothService.sToggleBtMonitor");
 
   if (!EnsureBluetoothHalLoad()) {
-    BT_LOGR("Error! Failed to load bluedroid library.\n");
+    BT_LOGR("Error! Failed to load bluedroid library.");
     return;
   }
 
   // Register all the bluedroid callbacks before enable() get called
   // It is required to register a2dp callbacks before a2dp media task starts up.
   BluetoothHfpManager::Get();
   BluetoothA2dpManager::Get();
 }
@@ -760,30 +760,30 @@ BluetoothServiceBluedroid::~BluetoothSer
 
 nsresult
 BluetoothServiceBluedroid::StartInternal()
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   nsresult ret = StartStopGonkBluetooth(true);
   if (NS_FAILED(ret)) {
-    BT_LOGR("Error: %s", __FUNCTION__);
+    BT_LOGR("Error");
   }
 
   return ret;
 }
 
 nsresult
 BluetoothServiceBluedroid::StopInternal()
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   nsresult ret = StartStopGonkBluetooth(false);
   if (NS_FAILED(ret)) {
-    BT_LOGR("Error: %s", __FUNCTION__);
+    BT_LOGR("Error");
   }
 
   return ret;
 }
 
 bool
 BluetoothServiceBluedroid::IsEnabledInternal()
 {
--- a/dom/bluetooth/bluez/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp
@@ -394,34 +394,34 @@ BluetoothOppManager::DiscardBlobsToSend(
 
   MOZ_ASSERT(!mBatches.IsEmpty());
   MOZ_ASSERT(!mIsServer);
 
   int length = (int) mBatches[0].mBlobs.Length();
   while (length > mCurrentBlobIndex + 1) {
     mBlob = mBatches[0].mBlobs[++mCurrentBlobIndex];
 
-    BT_LOGR("%s: idx %d", __FUNCTION__, mCurrentBlobIndex);
+    BT_LOGR("idx %d", mCurrentBlobIndex);
     ExtractBlobHeaders();
     StartFileTransfer();
     FileTransferComplete();
   }
 }
 
 bool
 BluetoothOppManager::ProcessNextBatch()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Remove the processed batch.
   // A batch is processed if we've incremented mCurrentBlobIndex for it.
   if (mCurrentBlobIndex >= 0) {
     ClearQueue();
     mBatches.RemoveElementAt(0);
-    BT_LOGR("%s: REMOVE. %d remaining", __FUNCTION__, mBatches.Length());
+    BT_LOGR("REMOVE. %d remaining", mBatches.Length());
   }
 
   // Process the next batch
   if (!mBatches.IsEmpty()) {
     ConnectInternal(mBatches[0].mDeviceAddress);
     return true;
   }
 
@@ -769,17 +769,17 @@ BluetoothOppManager::ComposePacket(uint8
     mPutFinalFlag = (aOpCode == ObexRequestCode::PutFinal);
   }
 
   int dataLength = aMessage->mSize - frameHeaderLength;
 
   // Check length before memcpy to prevent from memory pollution
   if (dataLength < 0 ||
       mPacketReceivedLength + dataLength > mPacketLength) {
-    BT_LOGR("%s: Received packet size is unreasonable", __FUNCTION__);
+    BT_LOGR("Received packet size is unreasonable");
 
     ReplyToPut(mPutFinalFlag, false);
     DeleteReceivedFile();
     FileTransferComplete();
 
     return false;
   }
 
@@ -1387,17 +1387,17 @@ BluetoothOppManager::NotifyAboutFileChan
   NS_ENSURE_TRUE_VOID(obs);
 
   obs->NotifyObservers(mDsFile, "file-watcher-notify", data.get());
 }
 
 void
 BluetoothOppManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer)? "server" : "client");
+  BT_LOGR("[%s]", (mIsServer)? "server" : "client");
   MOZ_ASSERT(aSocket);
 
   /**
    * If the created connection is an inbound connection, close another server
    * socket because currently only one file-transfer session is allowed. After
    * that, we need to make sure that both server socket would be nulled out.
    * As for outbound connections, we just notify the controller that it's done.
    */
@@ -1423,17 +1423,17 @@ BluetoothOppManager::OnSocketConnectSucc
   if (!mIsServer) {
     StartSendingNextFile();
   }
 }
 
 void
 BluetoothOppManager::OnSocketConnectError(BluetoothSocket* aSocket)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer)? "server" : "client");
+  BT_LOGR("[%s]", (mIsServer)? "server" : "client");
 
   mRfcommSocket = nullptr;
   mL2capSocket = nullptr;
   mSocket = nullptr;
 
   if (!mIsServer) {
     // Inform gaia of remaining blobs' sending failure
     DiscardBlobsToSend();
@@ -1443,17 +1443,17 @@ BluetoothOppManager::OnSocketConnectErro
   if (!ProcessNextBatch()) {
     Listen();
   }
 }
 
 void
 BluetoothOppManager::OnSocketDisconnect(BluetoothSocket* aSocket)
 {
-  BT_LOGR("%s: [%s]", __FUNCTION__, (mIsServer)? "server" : "client");
+  BT_LOGR("[%s]", (mIsServer)? "server" : "client");
   MOZ_ASSERT(aSocket);
 
   if (aSocket != mSocket) {
     // Do nothing when a listening server socket is closed.
     return;
   }
 
   /**