| 1649 | } |
| 1650 | |
| 1651 | void |
| 1652 | lockmgr_printinfo(const struct lock *lk) |
| 1653 | { |
| 1654 | struct thread *td; |
| 1655 | uintptr_t x; |
| 1656 | |
| 1657 | if (lk->lk_lock == LK_UNLOCKED) |
| 1658 | printf("lock type %s: UNLOCKED\n", lk->lock_object.lo_name); |
| 1659 | else if (lk->lk_lock & LK_SHARE) |
| 1660 | printf("lock type %s: SHARED (count %ju)\n", |
| 1661 | lk->lock_object.lo_name, |
| 1662 | (uintmax_t)LK_SHARERS(lk->lk_lock)); |
| 1663 | else { |
| 1664 | td = lockmgr_xholder(lk); |
| 1665 | if (td == (struct thread *)LK_KERNPROC) |
| 1666 | printf("lock type %s: EXCL by KERNPROC\n", |
| 1667 | lk->lock_object.lo_name); |
| 1668 | else |
| 1669 | printf("lock type %s: EXCL by thread %p " |
| 1670 | "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name, |
| 1671 | td, td->td_proc->p_pid, td->td_proc->p_comm, |
| 1672 | td->td_tid); |
| 1673 | } |
| 1674 | |
| 1675 | x = lk->lk_lock; |
| 1676 | if (x & LK_EXCLUSIVE_WAITERS) |
| 1677 | printf(" with exclusive waiters pending\n"); |
| 1678 | if (x & LK_SHARED_WAITERS) |
| 1679 | printf(" with shared waiters pending\n"); |
| 1680 | if (x & LK_EXCLUSIVE_SPINNERS) |
| 1681 | printf(" with exclusive spinners pending\n"); |
| 1682 | |
| 1683 | STACK_PRINT(lk); |
| 1684 | } |
| 1685 | |
| 1686 | int |
| 1687 | lockstatus(const struct lock *lk) |
no test coverage detected