sys/vm: Add TSLOG to some functions
The functions pbuf_init, kva_alloc, and keg_alloc_slab are significant contributors to the kernel boot time when FreeBSD boots inside the Firecracker VMM. Instrument them so they show up on flamecharts.
This commit is contained in:
parent
b7bf3cb07f
commit
b9fd884a8d
@ -1762,6 +1762,8 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags,
|
||||
uint8_t sflags;
|
||||
int i;
|
||||
|
||||
TSENTER();
|
||||
|
||||
KASSERT(domain >= 0 && domain < vm_ndomains,
|
||||
("keg_alloc_slab: domain %d out of range", domain));
|
||||
|
||||
@ -1858,6 +1860,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags,
|
||||
dom->ud_pages += keg->uk_ppera;
|
||||
dom->ud_free_items += keg->uk_ipers;
|
||||
|
||||
TSEXIT();
|
||||
return (slab);
|
||||
|
||||
fail:
|
||||
|
@ -148,9 +148,11 @@ kva_alloc(vm_size_t size)
|
||||
{
|
||||
vm_offset_t addr;
|
||||
|
||||
TSENTER();
|
||||
size = round_page(size);
|
||||
if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr))
|
||||
return (0);
|
||||
TSEXIT();
|
||||
|
||||
return (addr);
|
||||
}
|
||||
|
@ -495,6 +495,8 @@ pbuf_init(void *mem, int size, int flags)
|
||||
{
|
||||
struct buf *bp = mem;
|
||||
|
||||
TSENTER();
|
||||
|
||||
bp->b_kvabase = (void *)kva_alloc(ptoa(PBUF_PAGES));
|
||||
if (bp->b_kvabase == NULL)
|
||||
return (ENOMEM);
|
||||
@ -504,6 +506,8 @@ pbuf_init(void *mem, int size, int flags)
|
||||
bp->b_rcred = bp->b_wcred = NOCRED;
|
||||
bp->b_xflags = 0;
|
||||
|
||||
TSEXIT();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user