From f40f3c3255364f472ec06d9ba5ad0b66f16a6572 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 15 Nov 2012 00:51:57 +0000 Subject: - Implement run-time expansion of the KTR buffer via sysctl. - Implement a function to ensure that all preempted threads have switched back out at least once. Use this to make sure there are no stale references to the old ktr_buf or the lock profiling buffers before updating them. Reviewed by: marius (sparc64 parts), attilio (earlier patch) Sponsored by: EMC / Isilon Storage Division --- usr.bin/ktrdump/ktrdump.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ktrdump/ktrdump.c b/usr.bin/ktrdump/ktrdump.c index d74b979..77ae522 100644 --- a/usr.bin/ktrdump/ktrdump.c +++ b/usr.bin/ktrdump/ktrdump.c @@ -86,6 +86,7 @@ main(int ac, char **av) u_long parms[KTR_PARMS]; struct ktr_entry *buf; uintmax_t tlast, tnow; + unsigned long bufptr; struct stat sb; kvm_t *kd; FILE *out; @@ -179,8 +180,9 @@ main(int ac, char **av) if ((buf = malloc(sizeof(*buf) * entries)) == NULL) err(1, NULL); if (kvm_read(kd, nl[2].n_value, &index, sizeof(index)) == -1 || - kvm_read(kd, nl[3].n_value, buf, sizeof(*buf) * entries) - == -1) + kvm_read(kd, nl[3].n_value, &bufptr, + sizeof(bufptr)) == -1 || + kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1) errx(1, "%s", kvm_geterr(kd)); } -- cgit v1.1