[asterisk-commits] mjordan: branch mjordan/1.8_instrumented r362535 - /team/mjordan/1.8_instrume...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 19 09:20:36 CDT 2012


Author: mjordan
Date: Thu Apr 19 09:20:32 2012
New Revision: 362535

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362535
Log:
Change the printfs to standard mutex logger

Modified:
    team/mjordan/1.8_instrumented/main/lock.c

Modified: team/mjordan/1.8_instrumented/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/1.8_instrumented/main/lock.c?view=diff&rev=362535&r1=362534&r2=362535
==============================================================================
--- team/mjordan/1.8_instrumented/main/lock.c (original)
+++ team/mjordan/1.8_instrumented/main/lock.c Thu Apr 19 09:20:32 2012
@@ -117,13 +117,13 @@
 				   filename, lineno, func, mutex_name);
 		if (t->tracking) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 			__ast_mutex_logger("%s line %d (%s): Error: '%s' was locked here.\n",
 				    lt->file[ROFFSET], lt->lineno[ROFFSET], lt->func[ROFFSET], mutex_name);
 #ifdef HAVE_BKTR
 			__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
 #endif
-			printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 			ast_reentrancy_unlock(lt);
 		}
 		break;
@@ -139,7 +139,7 @@
 	}
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		lt->file[0] = filename;
 		lt->lineno[0] = lineno;
 		lt->func[0] = func;
@@ -148,7 +148,7 @@
 #ifdef HAVE_BKTR
 		memset(&lt->backtrace[0], 0, sizeof(lt->backtrace[0]));
 #endif
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		delete_reentrancy_cs(&t->track);
 	}
@@ -192,12 +192,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
 #else
@@ -224,7 +224,7 @@
 					__ast_mutex_logger("%s line %d (%s): Deadlock? waited %d sec for mutex '%s'?\n",
 							   filename, lineno, func, (int) wait_time, mutex_name);
 					ast_reentrancy_lock(lt);
-					printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+					__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 #ifdef HAVE_BKTR
 					__dump_backtrace(&lt->backtrace[lt->reentrancy], canlog);
 #endif
@@ -234,7 +234,7 @@
 #ifdef HAVE_BKTR
 					__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
 #endif
-					printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+					__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 					ast_reentrancy_unlock(lt);
 					reported_wait = wait_time;
 				}
@@ -255,7 +255,7 @@
 #ifdef DEBUG_THREADS
 	if (t->tracking && !res) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = lineno;
@@ -266,7 +266,7 @@
 			__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
 							   filename, lineno, func, mutex_name);
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -275,9 +275,9 @@
 #ifdef HAVE_BKTR
 		if (lt->reentrancy) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 			bt = &lt->backtrace[lt->reentrancy-1];
-			printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 			ast_reentrancy_unlock(lt);
 		} else {
 			bt = NULL;
@@ -290,7 +290,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error obtaining mutex: %s\n",
 				   filename, lineno, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -333,12 +333,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
 #else
@@ -352,7 +352,7 @@
 #ifdef DEBUG_THREADS
 	if (t->tracking && !res) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = lineno;
@@ -363,7 +363,7 @@
 			__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
 					   filename, lineno, func, mutex_name);
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -408,7 +408,7 @@
 
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
 			__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
 					   filename, lineno, func, mutex_name);
@@ -417,7 +417,7 @@
 #ifdef HAVE_BKTR
 			__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
 #endif
-			printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+			__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 			DO_THREAD_CRASH;
 		}
 
@@ -439,7 +439,7 @@
 			bt = &lt->backtrace[lt->reentrancy - 1];
 		}
 #endif
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -456,7 +456,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error releasing mutex: %s\n",
 				   filename, lineno, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -522,7 +522,7 @@
 
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
 			__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
 					   filename, lineno, func, mutex_name);
@@ -531,7 +531,7 @@
 #ifdef HAVE_BKTR
 			__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
 #endif
-			printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+			__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 			DO_THREAD_CRASH;
 		}
 
@@ -553,7 +553,7 @@
 			bt = &lt->backtrace[lt->reentrancy - 1];
 		}
 #endif
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -570,11 +570,11 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
 				   filename, lineno, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 		DO_THREAD_CRASH;
 	} else if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = lineno;
@@ -589,7 +589,7 @@
 			__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
 							   filename, lineno, func, mutex_name);
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -636,7 +636,7 @@
 
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
 			__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
 					   filename, lineno, func, mutex_name);
@@ -645,7 +645,7 @@
 #ifdef HAVE_BKTR
 			__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
 #endif
-			printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+			__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 			DO_THREAD_CRASH;
 		}
 
@@ -666,7 +666,7 @@
 			bt = &lt->backtrace[lt->reentrancy - 1];
 		}
 #endif
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -683,11 +683,11 @@
 	if (res && (res != ETIMEDOUT)) {
 		__ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
 				   filename, lineno, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, lineno, func);
 		DO_THREAD_CRASH;
 	} else if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = lineno;
@@ -702,7 +702,7 @@
 			__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
 							   filename, lineno, func, mutex_name);
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -776,7 +776,7 @@
 	}
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
 		lt->file[0] = filename;
 		lt->lineno[0] = lineno;
 		lt->func[0] = func;
@@ -785,7 +785,7 @@
 #ifdef HAVE_BKTR
 		memset(&lt->backtrace[0], 0, sizeof(lt->backtrace[0]));
 #endif
-		printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, lineno, func);
 		ast_reentrancy_unlock(lt);
 		delete_reentrancy_cs(&t->track);
 	}
@@ -827,7 +827,7 @@
 
 	if (t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy) {
 			int i;
 			pthread_t self = pthread_self();
@@ -857,7 +857,7 @@
 					filename, line, func, name);
 			lt->reentrancy = 0;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 
 #ifdef HAVE_BKTR
@@ -874,7 +874,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error releasing rwlock: %s\n",
 				filename, line, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, line, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -916,12 +916,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
 #else
@@ -943,7 +943,7 @@
 						filename, line, func, (int)wait_time, name);
 					if (t->tracking) {
 						ast_reentrancy_lock(lt);
-						printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+						__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 #ifdef HAVE_BKTR
 						__dump_backtrace(&lt->backtrace[lt->reentrancy], canlog);
 #endif
@@ -953,7 +953,7 @@
 #ifdef HAVE_BKTR
 						__dump_backtrace(&lt->backtrace[lt->reentrancy-1], canlog);
 #endif
-						printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+						__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 						ast_reentrancy_unlock(lt);
 					}
 					reported_wait = wait_time;
@@ -969,7 +969,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -977,7 +977,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -986,9 +986,9 @@
 #ifdef HAVE_BKTR
 		if (lt->reentrancy) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 			bt = &lt->backtrace[lt->reentrancy-1];
-			printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 			ast_reentrancy_unlock(lt);
 		} else {
 			bt = NULL;
@@ -1002,7 +1002,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
 				filename, line, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, line, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -1044,12 +1044,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
 #else
@@ -1071,7 +1071,7 @@
 						filename, line, func, (int)wait_time, name);
 					if (t->tracking) {
 						ast_reentrancy_lock(lt);
-						printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+						__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 #ifdef HAVE_BKTR
 						__dump_backtrace(&lt->backtrace[lt->reentrancy], canlog);
 #endif
@@ -1081,7 +1081,7 @@
 #ifdef HAVE_BKTR
 						__dump_backtrace(&lt->backtrace[lt->reentrancy-1], canlog);
 #endif
-						printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+						__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 						ast_reentrancy_unlock(lt);
 					}
 					reported_wait = wait_time;
@@ -1097,7 +1097,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -1105,7 +1105,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -1114,9 +1114,9 @@
 #ifdef HAVE_BKTR
 		if (lt->reentrancy) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 			bt = &lt->backtrace[lt->reentrancy-1];
-			printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 			ast_reentrancy_unlock(lt);
 		} else {
 			bt = NULL;
@@ -1133,7 +1133,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error obtaining write lock: %s\n",
 				filename, line, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, line, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -1176,12 +1176,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
 #else
@@ -1211,7 +1211,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -1219,7 +1219,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -1228,9 +1228,9 @@
 #ifdef HAVE_BKTR
 		if (lt->reentrancy) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 			bt = &lt->backtrace[lt->reentrancy-1];
-			printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 			ast_reentrancy_unlock(lt);
 		} else {
 			bt = NULL;
@@ -1243,7 +1243,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
 				filename, line, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, line, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -1286,12 +1286,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
 #else
@@ -1321,7 +1321,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -1329,7 +1329,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -1338,9 +1338,9 @@
 #ifdef HAVE_BKTR
 		if (lt->reentrancy) {
 			ast_reentrancy_lock(lt);
-			printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+			__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 			bt = &lt->backtrace[lt->reentrancy-1];
-			printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+			__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 			ast_reentrancy_unlock(lt);
 		} else {
 			bt = NULL;
@@ -1357,7 +1357,7 @@
 	if (res) {
 		__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
 				filename, line, func, strerror(res));
-		printf("Crashing thread %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Crashing thread %s line %d (%s)\n", filename, line, func);
 		DO_THREAD_CRASH;
 	}
 #endif /* DEBUG_THREADS */
@@ -1371,11 +1371,11 @@
 
 #ifdef DEBUG_THREADS
 	struct ast_lock_track *lt;
+	int canlog = strcmp(filename, "logger.c") & t->tracking;
 #ifdef HAVE_BKTR
 	struct ast_bt *bt = NULL;
 #endif
 #if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
-	int canlog = strcmp(filename, "logger.c") & t->tracking;
 
 	if ((t->lock) == ((pthread_rwlock_t) __AST_RWLOCK_INIT_VALUE)) {
 		 /* Don't warn abount uninitialized lock.
@@ -1399,12 +1399,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
 #else
@@ -1418,7 +1418,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -1426,7 +1426,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		if (t->tracking) {
 			ast_mark_lock_acquired(t);
@@ -1445,11 +1445,11 @@
 
 #ifdef DEBUG_THREADS
 	struct ast_lock_track *lt;
+	int canlog = strcmp(filename, "logger.c") & t->tracking;
 #ifdef HAVE_BKTR
 	struct ast_bt *bt = NULL;
 #endif
 #if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
-	int canlog = strcmp(filename, "logger.c") & t->tracking;
 
 	if ((t->lock) == ((pthread_rwlock_t) __AST_RWLOCK_INIT_VALUE)) {
 		 /* Don't warn abount uninitialized lock.
@@ -1473,12 +1473,12 @@
 	if (t->tracking) {
 #ifdef HAVE_BKTR
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
 #else
@@ -1492,7 +1492,7 @@
 #ifdef DEBUG_THREADS
 	if (!res && t->tracking) {
 		ast_reentrancy_lock(lt);
-		printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
+		__ast_mutex_logger("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
 		if (lt->reentrancy < AST_MAX_REENTRANCY) {
 			lt->file[lt->reentrancy] = filename;
 			lt->lineno[lt->reentrancy] = line;
@@ -1500,7 +1500,7 @@
 			lt->thread[lt->reentrancy] = pthread_self();
 			lt->reentrancy++;
 		}
-		printf("Global lock released by %s line %d (%s)\n", filename, line, func);
+		__ast_mutex_logger("Global lock released by %s line %d (%s)\n", filename, line, func);
 		ast_reentrancy_unlock(lt);
 		ast_mark_lock_acquired(t);
 	} else if (t->tracking) {




More information about the asterisk-commits mailing list