PERFORCE change 87977 for review

John Baldwin jhb at FreeBSD.org
Fri Dec 9 13:04:17 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=87977

Change 87977 by jhb at jhb_slimer on 2005/12/09 21:03:55

	Add a state field and list state of mtx_lock there and only output
	owner field if the lock is held.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_mutex.c#112 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_mutex.c#112 (text+ko) ====

@@ -990,14 +990,21 @@
 		db_printf(", RECURSE");
 	if (m->mtx_object.lo_flags & LO_DUPOK)
 		db_printf(", DUPOK");
-	db_printf("}\n");
-	db_printf(" owner: ");
+	db_printf(" state: {");
 	if (mtx_unowned(m))
-		db_printf("UNOWNED\n");
+		db_printf("UNOWNED");
 	else {
+		db_printf("OWNED");
+		if (m->mtx_lock & MTX_CONTESTED)
+			db_printf(", CONTESTED");
+		if (m->mtx_lock & MTX_RECURSED)
+			db_printf(", RECURSED");
+	}
+	db_printf("}\n");
+	if (!mtx_unowned(m)) {
 		td = mtx_owner(m);
-		db_printf("%p (tid %d, pid %d, \"%s\")\n", td, td->td_tid,
-		    td->td_proc->p_pid, td->td_proc->p_comm);
+		db_printf(" owner: %p (tid %d, pid %d, \"%s\")\n", td,
+		    td->td_tid, td->td_proc->p_pid, td->td_proc->p_comm);
 		if (mtx_recursed(m))
 			db_printf(" recursed: %d\n", m->mtx_recurse);
 	}


More information about the p4-projects mailing list