Add debug log messages 40/258840/1 submit/tizen_6.0/20210531.064050
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 26 May 2021 11:10:30 +0000 (20:10 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 26 May 2021 11:10:30 +0000 (20:10 +0900)
Change-Id: Idf957bb93d8352472847920f6fcff4d87fe9a987

mDNSCore/DNSCommon.c
mDNSCore/mDNS.c
mDNSPosix/Makefile
mDNSPosix/mDNSPosix.c
mDNSShared/uds_daemon.c

index 597c4cc..15c4162 100755 (executable)
@@ -3841,6 +3841,7 @@ mDNSexport mStatus mDNSSendDNSMessage(mDNS *const m, DNSMessage *const msg, mDNS
 
 mDNSexport void mDNS_Lock_(mDNS *const m, const char * const functionname)
 {
+       LogInfo("mDNS_Lock_: locked from %s", functionname);
     // MUST grab the platform lock FIRST!
     mDNSPlatformLock(m);
 
@@ -4014,6 +4015,7 @@ mDNSexport void ShowTaskSchedulingError(mDNS *const m)
 
 mDNSexport void mDNS_Unlock_(mDNS *const m, const char *const functionname)
 {
+       LogInfo("mDNS_Unlock_: unlocked from %s", functionname);
     // Decrement mDNS_busy
     m->mDNS_busy--;
 
index 0788ab6..0226ebf 100755 (executable)
@@ -5818,6 +5818,7 @@ mDNSexport void mDNSCoreRestartQuestion(mDNS *const m, DNSQuestion *q)
 // restart the probe/announce cycle for multicast record
 mDNSexport void mDNSCoreRestartRegistration(mDNS *const m, AuthRecord *rr, int announceCount)
 {
+    LogInfo("mDNSCoreRestartRegistration: enter");
     if (!AuthRecord_uDNS(rr))
     {
         if (rr->resrec.RecordType == kDNSRecordTypeVerified && !rr->DependentOn) rr->resrec.RecordType = kDNSRecordTypeUnique;
@@ -5839,6 +5840,7 @@ mDNSexport void mDNSCoreRestartRegistration(mDNS *const m, AuthRecord *rr, int a
         rr->SendNSECNow    = mDNSNULL;
         InitializeLastAPTime(m, rr);
     }
+    LogInfo("mDNSCoreRestartRegistration: exit");
 }
 
 // ***************************************************************************
@@ -5850,6 +5852,7 @@ mDNSexport void mDNSCoreRestartRegistration(mDNS *const m, AuthRecord *rr, int a
 mDNSexport void mDNS_UpdateAllowSleep(mDNS *const m)
 {
 #ifndef IDLESLEEPCONTROL_DISABLED
+    LogInfo("mDNS_UpdateAllowSleep: enter");
     mDNSBool allowSleep = mDNStrue;
     char reason[128];
 
@@ -5892,7 +5895,7 @@ mDNSexport void mDNS_UpdateAllowSleep(mDNS *const m)
                         // Disallow sleep if there is no sleep proxy server
                         const CacheRecord *cr = FindSPSInCache1(m, &intf->NetWakeBrowse, mDNSNULL, mDNSNULL);
                         if ( cr == mDNSNULL)
-                        {
+                       {
                             allowSleep = mDNSfalse;
                             mDNS_snprintf(reason, sizeof(reason), "No sleep proxy server on %s", intf->ifname);
                             LogInfo("mDNS_UpdateAllowSleep: Sleep disabled because %s has no sleep proxy server", intf->ifname);
@@ -5918,6 +5921,7 @@ mDNSexport void mDNS_UpdateAllowSleep(mDNS *const m)
 
     // Call the platform code to enable/disable sleep
     mDNSPlatformSetAllowSleep(allowSleep, reason);
+    LogInfo("mDNS_UpdateAllowSleep: exit");
 #else
     (void) m;
 #endif /* !defined(IDLESLEEPCONTROL_DISABLED) */
@@ -12878,6 +12882,7 @@ mDNSexport mStatus mDNS_RegisterInterface(mDNS *const m, NetworkInterfaceInfo *s
     mDNSBool FirstOfType = mDNStrue;
     NetworkInterfaceInfo **p = &m->HostInterfaces;
 
+       LogInfo("mDNS_RegisterInterface: enter");
     if (!set->InterfaceID)
     { LogMsg("mDNS_RegisterInterface: Error! Tried to register a NetworkInterfaceInfo %#a with zero InterfaceID", &set->ip); return(mStatus_Invalid); }
 
@@ -13027,6 +13032,7 @@ mDNSexport mStatus mDNS_RegisterInterface(mDNS *const m, NetworkInterfaceInfo *s
                 }
             }
         }
+        LogInfo("mDNS_RegisterInterface: finished scanning the list of questions.");
 
         // For all our non-specific authoritative resource records (and any dormant records specific to this interface)
         // we now need them to re-probe if necessary, and then re-announce.
@@ -13049,6 +13055,9 @@ mDNSexport mStatus mDNS_RegisterInterface(mDNS *const m, NetworkInterfaceInfo *s
     mDNS_UpdateAllowSleep(m);
 
     mDNS_Unlock(m);
+
+       LogInfo("mDNS_RegisterInterface: exit");
+
     return(mStatus_NoError);
 }
 
index 0aff503..ede6cea 100755 (executable)
@@ -70,7 +70,7 @@ LDSUFFIX = so
 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
 
 # Set up diverging paths for debug vs. prod builds
-DEBUG=0
+DEBUG=1
 ifeq ($(DEBUG),1)
 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
 OBJDIR = objects/debug
index 4ea304b..bbcd6f8 100755 (executable)
@@ -488,6 +488,8 @@ mDNSexport int ParseDNSServers(mDNS *m, const char *filePath)
     int numOfServers = 0;
     FILE *fp = fopen(filePath, "r");
     if (fp == NULL) return -1;
+
+       LogInfo("ParseDNSServers: enter");
     while (fgets(line,sizeof(line),fp))
     {
         struct in_addr ina;
@@ -504,6 +506,7 @@ mDNSexport int ParseDNSServers(mDNS *m, const char *filePath)
         }
     }
        fclose(fp);
+       LogInfo("ParseDNSServers: exit");
     return (numOfServers > 0) ? 0 : -1;
 }
 
@@ -869,6 +872,8 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
     assert(intfName != NULL);
     assert(intfMask != NULL);
 
+       LogInfo("SetupOneInterface: enter %s", intfName);
+
     // Allocate the interface structure itself.
     intf = (PosixNetworkInterface*)calloc(1, sizeof(*intf));
     if (intf == NULL) { assert(0); err = ENOMEM; }
@@ -948,6 +953,8 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
 
     assert((err == 0) == (intf != NULL));
 
+       LogInfo("SetupOneInterface: exit %s", intfName);
+
     return err;
 }
 
@@ -1004,8 +1011,10 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
         // Temporary workaround: Multicast loopback on IPv6 interfaces appears not to work.
         // In the interim, we skip loopback interface only if we found at least one v4 interface to use
         // if ((m->HostInterfaces == NULL) && (firstLoopback != NULL))
-        if (!foundav4 && firstLoopback)
+        if (!foundav4 && firstLoopback) {
+                       LogInfo("SetupInterfaceList: setup for loopback.");
             (void) SetupOneInterface(m, firstLoopback->ifi_addr, firstLoopback->ifi_netmask, firstLoopback->ifi_name, firstLoopback->ifi_index);
+               }
     }
 
     // Clean up.
@@ -1020,7 +1029,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
         if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
         else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); }
     }
-
+       LogInfo("SetupInterfaceList: exit");
     return err;
 }
 
@@ -1036,6 +1045,8 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
     int sock;
     int ret;
 
+       LogInfo("OpenIfNotifySocket: enter");
+
     sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
     if (sock < 0)
         return errno;
@@ -1053,6 +1064,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
     else
         err = errno;
 
+       LogInfo("OpenIfNotifySocket: exit");
     return err;
 }
 
@@ -1314,6 +1326,7 @@ mDNSexport mStatus mDNSPlatformInit(mDNS *const m)
     struct sockaddr sa;
     assert(m != NULL);
 
+       LogInfo("mDNSPlatformInit: enter");
     if (mDNSPlatformInit_CanReceiveUnicast()) m->CanReceiveUnicastOn5353 = mDNStrue;
 
     // Tell mDNS core the names of this machine.
@@ -1364,6 +1377,7 @@ mDNSexport mStatus mDNSPlatformInit(mDNS *const m)
     if (err == mStatus_NoError)
         mDNSCoreInitComplete(m, mStatus_NoError);
 
+       LogInfo("mDNSPlatformInit: exit");
     return PosixErrorToStatus(err);
 }
 
index 946ad16..16dabbb 100755 (executable)
@@ -5039,6 +5039,7 @@ mDNSlocal mDNSBool uds_socket_setup(dnssd_sock_t skt)
     if (setsockopt(skt, SOL_SOCKET, SO_NP_EXTENSIONS, &sonpx, optlen) < 0)
         my_perror("WARNING: could not set sockopt - SO_NP_EXTENSIONS");
 #endif
+       LogInfo("uds_socket_setup: enter");
 #if defined(_WIN32)
     // SEH: do we even need to do this on windows?
     // This socket will be given to WSAEventSelect which will automatically set it to non-blocking
@@ -5068,6 +5069,7 @@ mDNSlocal mDNSBool uds_socket_setup(dnssd_sock_t skt)
         LogOperation("%3d: Listening for incoming Unix Domain Socket client requests", skt);
         mDNSStorage.uds_listener_skt = skt;
     }
+       LogInfo("uds_socket_setup: exit");
     return mDNStrue;
 }