]> git.proxmox.com Git - mirror_corosync.git/commitdiff
Add debug log messages to corosync for join/leave
authorAngus Salkeld <asalkeld@redhat.com>
Tue, 24 Jan 2012 12:54:17 +0000 (23:54 +1100)
committerAngus Salkeld <asalkeld@redhat.com>
Wed, 25 Jan 2012 00:33:09 +0000 (11:33 +1100)
This is needed by cts.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
cts/agents/cpg_test_agent.c
cts/corotests.py
exec/main.c

index a2f68e68cbd9840a2ffa03bbfe78ce7f6f9e31c3..727b69c28e9c7df88dda13f73bde1783225517b9 100644 (file)
@@ -203,8 +203,6 @@ static void config_change_callback (
        /* group_name,ip,pid,join|leave */
 
        for (i = 0; i < left_list_entries; i++) {
-               qb_log(LOG_INFO, "Member left: %s", left_list[i].nodeid);
-
                if (record_config_events_g > 0) {
                        log_pt = malloc (sizeof(log_entry_t));
                        list_init (&log_pt->list);
@@ -214,8 +212,6 @@ static void config_change_callback (
                }
        }
        for (i = 0; i < joined_list_entries; i++) {
-               qb_log(LOG_INFO, "Member joined: %s", joined_list[i].nodeid);
-
                if (record_config_events_g > 0) {
                        log_pt = malloc (sizeof(log_entry_t));
                        list_init (&log_pt->list);
index 061c6839d51d3fff423368ee30cdc4cbcb49f577..620faf250da323c9d96095d72c82284e532ab984 100644 (file)
@@ -49,6 +49,8 @@ class CoroTest(CTSTest):
         self.start = StartTest(cm)
         self.stop = StopTest(cm)
         self.config = {}
+        self.config['logging/logger_subsys[1]/subsys'] = 'MAIN'
+        self.config['logging/logger_subsys[1]/debug'] = 'on'
         self.need_all_up = True
         self.CM.start_cpg = True
 
@@ -960,9 +962,8 @@ class GenStopAllBeekhof(CoroTest):
         CoroTest.__init__(self,cm)
         self.name="GenStopAllBeekhof"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'CFG'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
-        self.config['logging/logger_subsys[1]/tags'] = 'trace1|enter|leave'
+        self.config['logging/logger_subsys[2]/subsys'] = 'CFG'
+        self.config['logging/logger_subsys[2]/debug'] = 'on'
 
     def __call__(self, node):
         '''Perform the 'GenStopAllBeekhof' test. '''
@@ -1100,8 +1101,8 @@ confirm watchdog action
         CoroTest.__init__(self,cm)
         self.name="WDOnForkBomb"
         self.need_all_up = False
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
+        self.config['logging/logger_subsys[2]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[2]/debug'] = 'on'
         self.config['resources/system/memory_used/recovery'] = 'watchdog'
         self.config['resources/system/memory_used/max'] = '80'
         self.config['resources/system/memory_used/poll_period'] = '800'
@@ -1152,8 +1153,8 @@ confirm action
         CoroTest.__init__(self,cm)
         self.name="SamWdIntegration1"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
+        self.config['logging/logger_subsys[2]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[2]/debug'] = 'on'
 
     def __call__(self, node):
         '''Perform the test. '''
@@ -1186,8 +1187,8 @@ confirm resource "stopped" and no watchdog action.
         CoroTest.__init__(self,cm)
         self.name="SamWdIntegration2"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
+        self.config['logging/logger_subsys[2]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[2]/debug'] = 'on'
 
     def __call__(self, node):
         '''Perform the test. '''
@@ -1230,10 +1231,10 @@ check that we do NOT get watchdog'ed
         CoroTest.__init__(self,cm)
         self.name="WdDeleteResource"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
         self.config['logging/logger_subsys[2]/subsys'] = 'MON'
         self.config['logging/logger_subsys[2]/debug'] = 'on'
+        self.config['logging/logger_subsys[3]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[3]/debug'] = 'on'
         self.config['resources/system/memory_used/recovery'] = 'watchdog'
         self.config['resources/system/memory_used/max'] = '80'
         self.config['resources/system/memory_used/poll_period'] = '800'
@@ -1275,10 +1276,10 @@ check that we do NOT get watchdog'ed
         CoroTest.__init__(self,cm)
         self.name="ResourcePollAdjust"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
         self.config['logging/logger_subsys[2]/subsys'] = 'MON'
         self.config['logging/logger_subsys[2]/debug'] = 'on'
+        self.config['logging/logger_subsys[3]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[3]/debug'] = 'on'
         self.config['resources/system/memory_used/recovery'] = 'none'
         self.config['resources/system/memory_used/max'] = '80'
         self.config['resources/system/memory_used/poll_period'] = '800'
@@ -1322,8 +1323,8 @@ confirm reboot action
         CoroTest.__init__(self,cm)
         self.name="RebootOnHighMem"
         self.need_all_up = True
-        self.config['logging/logger_subsys[1]/subsys'] = 'WD'
-        self.config['logging/logger_subsys[1]/debug'] = 'on'
+        self.config['logging/logger_subsys[2]/subsys'] = 'WD'
+        self.config['logging/logger_subsys[2]/debug'] = 'on'
         self.config['resources/system/memory_used/recovery'] = 'reboot'
         self.config['resources/system/memory_used/max'] = '80'
         self.config['resources/system/memory_used/poll_period'] = '800'
index 206122b57f83c941e0f7a2a544fb18046892c44a..79c05a8d273cbc69a6c11695191bcdee745778fc 100644 (file)
@@ -353,6 +353,9 @@ static void member_object_joined (unsigned int nodeid)
                icmap_set_uint32(member_join_count, 1);
                icmap_set_string(member_status, "joined");
        }
+
+       log_printf (LOGSYS_LEVEL_DEBUG,
+               "Member joined: %s", api->totem_ifaces_print (nodeid));
 }
 
 static void member_object_left (unsigned int nodeid)
@@ -362,6 +365,9 @@ static void member_object_left (unsigned int nodeid)
        snprintf(member_status, ICMAP_KEYNAME_MAXLEN,
                "runtime.totem.pg.mrp.srp.members.%u.status", nodeid);
        icmap_set_string(member_status, "left");
+
+       log_printf (LOGSYS_LEVEL_DEBUG,
+               "Member left: %s", api->totem_ifaces_print (nodeid));
 }
 
 static void confchg_fn (