Module Name: src Committed By: chs Date: Mon Oct 18 00:09:13 UTC 2010
Modified Files: src/sys/kern: kern_ktrace.c Log Message: when using ktrace format version 0 or 1, don't adjust the changed fields in ktealloc(), since we do the same adjustment later in ktrwrite(). also, remove an unused variable in ktr_csw(). To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/kern/kern_ktrace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_ktrace.c diff -u src/sys/kern/kern_ktrace.c:1.153 src/sys/kern/kern_ktrace.c:1.154 --- src/sys/kern/kern_ktrace.c:1.153 Thu Jul 1 02:38:30 2010 +++ src/sys/kern/kern_ktrace.c Mon Oct 18 00:09:13 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_ktrace.c,v 1.153 2010/07/01 02:38:30 rmind Exp $ */ +/* $NetBSD: kern_ktrace.c,v 1.154 2010/10/18 00:09:13 chs Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.153 2010/07/01 02:38:30 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.154 2010/10/18 00:09:13 chs Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -524,7 +524,6 @@ struct proc *p = l->l_proc; struct ktrace_entry *kte; struct ktr_header *kth; - struct timespec ts; void *buf; if (ktrenter(l)) @@ -550,27 +549,8 @@ kth->ktr_pid = p->p_pid; memcpy(kth->ktr_comm, p->p_comm, MAXCOMLEN); kth->ktr_version = KTRFAC_VERSION(p->p_traceflag); - - nanotime(&ts); - switch (KTRFAC_VERSION(p->p_traceflag)) { - case 0: - /* This is the original format */ - kth->ktr_otv.tv_sec = ts.tv_sec; - kth->ktr_otv.tv_usec = ts.tv_nsec / 1000; - break; - case 1: - kth->ktr_olid = l->l_lid; - kth->ktr_ots.tv_sec = ts.tv_sec; - kth->ktr_ots.tv_nsec = ts.tv_nsec; - break; - case 2: - kth->ktr_lid = l->l_lid; - kth->ktr_ts.tv_sec = ts.tv_sec; - kth->ktr_ts.tv_nsec = ts.tv_nsec; - break; - default: - break; - } + kth->ktr_lid = l->l_lid; + nanotime(&kth->ktr_ts); *ktep = kte; *bufp = buf; @@ -861,13 +841,11 @@ * from that is difficult to do. */ if (out) { - struct timespec ts; if (ktrenter(l)) return; nanotime(&l->l_ktrcsw); l->l_pflag |= LP_KTRCSW; - nanotime(&ts); if (user) l->l_pflag |= LP_KTRCSWUSER; else