MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_show_lockmgr

Function db_show_lockmgr

freebsd/kern/kern_lock.c:1809–1852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1807}
1808
1809static void
1810db_show_lockmgr(const struct lock_object *lock)
1811{
1812 struct thread *td;
1813 const struct lock *lk;
1814
1815 lk = (const struct lock *)lock;
1816
1817 db_printf(" state: ");
1818 if (lk->lk_lock == LK_UNLOCKED)
1819 db_printf("UNLOCKED\n");
1820 else if (lk->lk_lock & LK_SHARE)
1821 db_printf("SLOCK: %ju\n", (uintmax_t)LK_SHARERS(lk->lk_lock));
1822 else {
1823 td = lockmgr_xholder(lk);
1824 if (td == (struct thread *)LK_KERNPROC)
1825 db_printf("XLOCK: LK_KERNPROC\n");
1826 else
1827 db_printf("XLOCK: %p (tid %d, pid %d, \"%s\")\n", td,
1828 td->td_tid, td->td_proc->p_pid,
1829 td->td_proc->p_comm);
1830 if (lockmgr_recursed(lk))
1831 db_printf(" recursed: %d\n", lk->lk_recurse);
1832 }
1833 db_printf(" waiters: ");
1834 switch (lk->lk_lock & LK_ALL_WAITERS) {
1835 case LK_SHARED_WAITERS:
1836 db_printf("shared\n");
1837 break;
1838 case LK_EXCLUSIVE_WAITERS:
1839 db_printf("exclusive\n");
1840 break;
1841 case LK_ALL_WAITERS:
1842 db_printf("shared and exclusive\n");
1843 break;
1844 default:
1845 db_printf("none\n");
1846 }
1847 db_printf(" spinners: ");
1848 if (lk->lk_lock & LK_EXCLUSIVE_SPINNERS)
1849 db_printf("exclusive\n");
1850 else
1851 db_printf("none\n");
1852}
1853#endif

Callers

nothing calls this directly

Calls 2

db_printfFunction · 0.85
lockmgr_xholderFunction · 0.85

Tested by

no test coverage detected