Generate KTR trace records for uma_zalloc_arg() and uma_zfree_arg().

This doesn't trace every event of interest in UMA, but provides
enough basic information to explain lock traces and sleep patterns.
This commit is contained in:
Robert Watson 2004-08-06 21:52:38 +00:00
parent ff7ec58af8
commit 3659f747f1

View File

@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/sysctl.h>
#include <sys/mutex.h>
@ -1766,6 +1767,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags)
#ifdef UMA_DEBUG_ALLOC_1
printf("Allocating one item from %s(%p)\n", zone->uz_name, zone);
#endif
CTR3(KTR_UMA, "uma_zalloc_arg thread %x zone %s flags %d", curthread,
zone->uz_name, flags);
if (!(flags & M_NOWAIT)) {
KASSERT(curthread->td_intr_nesting_level == 0,
@ -2182,6 +2185,9 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
#ifdef UMA_DEBUG_ALLOC_1
printf("Freeing item %p to %s(%p)\n", item, zone->uz_name, zone);
#endif
CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread,
zone->uz_name);
/*
* The race here is acceptable. If we miss it we'll just have to wait
* a little longer for the limits to be reset.