Skip to contentSkip to conversation

master - clvmd: add client id to debug log messages

PATCH Alasdair Kergon 1 participant 1 message Jul 1, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=af789fd6d0cba45cc4897772bae3ca73a3f15b38
Commit:        af789fd6d0cba45cc4897772bae3ca73a3f15b38
Parent:        17ed25409136162d091809d412596a45e0a30fd4
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Sat Jul 1 01:17:40 2017 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Sat Jul 1 01:17:40 2017 +0100

clvmd: add client id to debug log messages

Use standard format to make it easier to find the client to which each debug log message refers.

---
 WHATS_NEW                     |    2 +-
 daemons/clvmd/clvmd-command.c |    6 +-
 daemons/clvmd/clvmd.c         |  120 +++++++++++++++++++++--------------------
 3 files changed, 65 insertions(+), 63 deletions(-)
WHATS_NEW +1 -1
index 3f496fe..29f07b8 100644
@@ -1,6 +1,6 @@
 Version 2.02.173 - 
 =================================
-  Protect clvmd debug log messages with mutex.
+  Protect clvmd debug log messages with mutex and add client id.
   Fix shellcheck reported issues for script files.
 
 Version 2.02.172 - 28th June 2017
daemons/clvmd/clvmd-command.c +3 -3
index 0593f6f..cf19dc2 100644
@@ -206,7 +206,7 @@ static int lock_vg(struct local_client *client)
 	lock_mode = ((int) lock_cmd & LCK_TYPE_MASK);
 	/* lock_flags = args[1]; */
 	lockname = &args[2];
-	DEBUGLOG("doing PRE command LOCK_VG '%s' at %x (client=%p)\n", lockname, lock_cmd, client);
+	DEBUGLOG("(%p) doing PRE command LOCK_VG '%s' at %x\n", client, lockname, lock_cmd);
 
 	if (lock_mode == LCK_UNLOCK) {
 		if (!(lkid = (int) (long) dm_hash_lookup(lock_hash, lockname)))
@@ -323,7 +323,7 @@ void cmd_client_cleanup(struct local_client *client)
 	int lkid;
 	char *lockname;
 
-	DEBUGLOG("Client thread cleanup (%p)\n", client);
+	DEBUGLOG("(%p) Client thread cleanup\n", client);
 	if (!client->bits.localsock.private)
 		return;
 
@@ -332,7 +332,7 @@ void cmd_client_cleanup(struct local_client *client)
 	dm_hash_iterate(v, lock_hash) {
 		lkid = (int)(long)dm_hash_get_data(lock_hash, v);
 		lockname = dm_hash_get_key(lock_hash, v);
-		DEBUGLOG("Cleanup (%p): Unlocking lock %s %x\n", client, lockname, lkid);
+		DEBUGLOG("(%p) Cleanup: Unlocking lock %s %x\n", client, lockname, lkid);
 		(void) sync_unlock(lockname, lkid);
 	}
 
daemons/clvmd/clvmd.c +61 -59

379 lines not on this page · raw message