[sr-dev] git:master:dcfd5012: tls: debug messages for mutex ops with lock function

Daniel-Constantin Mierla miconda at gmail.com
Thu Feb 11 22:16:22 CET 2016


Module: kamailio
Branch: master
Commit: dcfd5012c0fe10c2697ceeaf5b09d24e1ae8719e
URL: https://github.com/kamailio/kamailio/commit/dcfd5012c0fe10c2697ceeaf5b09d24e1ae8719e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-02-11T22:16:09+01:00

tls: debug messages for mutex ops with lock function

---

Modified: modules/tls/tls_locking.c

---

Diff:  https://github.com/kamailio/kamailio/commit/dcfd5012c0fe10c2697ceeaf5b09d24e1ae8719e.diff
Patch: https://github.com/kamailio/kamailio/commit/dcfd5012c0fe10c2697ceeaf5b09d24e1ae8719e.patch

---

diff --git a/modules/tls/tls_locking.c b/modules/tls/tls_locking.c
index 46a8387..434f490 100644
--- a/modules/tls/tls_locking.c
+++ b/modules/tls/tls_locking.c
@@ -1,7 +1,7 @@
 /*
  * TLS module
  *
- * Copyright (C) 2007 iptelorg GmbH 
+ * Copyright (C) 2007 iptelorg GmbH
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -42,7 +42,7 @@ struct CRYPTO_dynlock_value{
 static struct CRYPTO_dynlock_value* dyn_create_f(const char* file, int line)
 {
 	struct CRYPTO_dynlock_value* l;
-	
+
 	l=shm_malloc(sizeof(struct CRYPTO_dynlock_value));
 	if (l==0){
 		LOG(L_CRIT, "ERROR: tls: dyn_create_f locking callback out of shm."
@@ -104,11 +104,12 @@ static void locking_f(int mode, int n, const char* file, int line)
 		abort(); /* quick crash :-) */
 	}
 	if (mode & CRYPTO_LOCK){
+		LM_DBG("lock get (%d): %d (%s:%d)\n", mode, n, file, line);
 		lock_set_get(static_locks, n);
 	}else{
 		lock_set_release(static_locks, n);
+		LM_DBG("lock release (%d): %d (%s:%d)\n", mode, n, file, line);
 	}
-	
 }
 
 
@@ -160,7 +161,7 @@ int tls_init_locks()
 	CRYPTO_set_dynlock_create_callback(dyn_create_f);
 	CRYPTO_set_dynlock_lock_callback(dyn_lock_f);
 	CRYPTO_set_dynlock_destroy_callback(dyn_destroy_f);
-	
+
 	/* starting with v1.0.0 openssl does not use anymore getpid(), but address
 	 * of errno which can point to same virtual address in a multi-process
 	 * application
@@ -172,8 +173,7 @@ int tls_init_locks()
 	 *  (only atomic_inc), fallback to the default use-locks mode
 	 * CRYPTO_set_add_lock_callback(atomic_add_f);
 	 */
-	
-	
+
 	return 0;
 error:
 	tls_destroy_locks();




More information about the sr-dev mailing list