[PATCH 2/8] Add debug log messages to corosync for join/leave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is needed by cts.

Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
---
 cts/agents/cpg_test_agent.c |    4 ----
 cts/corotests.py            |   31 ++++++++++++++++---------------
 exec/main.c                 |    6 ++++++
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/cts/agents/cpg_test_agent.c b/cts/agents/cpg_test_agent.c
index a2f68e6..727b69c 100644
--- a/cts/agents/cpg_test_agent.c
+++ b/cts/agents/cpg_test_agent.c
@@ -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);
diff --git a/cts/corotests.py b/cts/corotests.py
index 061c683..620faf2 100644
--- a/cts/corotests.py
+++ b/cts/corotests.py
@@ -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'
diff --git a/exec/main.c b/exec/main.c
index 206122b..79c05a8 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -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 (
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux