summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2012-11-15 00:51:57 +0000
committerjeff <jeff@FreeBSD.org>2012-11-15 00:51:57 +0000
commitf40f3c3255364f472ec06d9ba5ad0b66f16a6572 (patch)
treedc9bfdaab60c5892bec647736baab766ea8ee213 /usr.bin
parente8ae50d444598a029ceb39f734aeda3b5ee77521 (diff)
downloadFreeBSD-src-f40f3c3255364f472ec06d9ba5ad0b66f16a6572.zip
FreeBSD-src-f40f3c3255364f472ec06d9ba5ad0b66f16a6572.tar.gz
- 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
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ktrdump/ktrdump.c6
1 files changed, 4 insertions, 2 deletions
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));
}
OpenPOWER on IntegriCloud