Date: Fri, 9 Dec 2005 21:04:15 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 87977 for review Message-ID: <200512092104.jB9L4FqP042422@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87977 Change 87977 by jhb@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512092104.jB9L4FqP042422>