kern_ktrace.c (2112) | kern_ktrace.c (3308) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 |
34 * $Id: kern_ktrace.c,v 1.3 1994/08/02 07:42:02 davidg Exp $ | 34 * $Id: kern_ktrace.c,v 1.4 1994/08/18 22:35:01 wollman Exp $ |
35 */ 36 37#ifdef KTRACE 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/proc.h> 42#include <sys/file.h> 43#include <sys/namei.h> 44#include <sys/vnode.h> 45#include <sys/ktrace.h> 46#include <sys/malloc.h> 47#include <sys/syslog.h> 48 | 35 */ 36 37#ifdef KTRACE 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/proc.h> 42#include <sys/file.h> 43#include <sys/namei.h> 44#include <sys/vnode.h> 45#include <sys/ktrace.h> 46#include <sys/malloc.h> 47#include <sys/syslog.h> 48 |
49void ktrwrite __P((struct vnode *, struct ktr_header *)); 50 | |
51struct ktr_header * 52ktrgetheader(type) 53 int type; 54{ 55 register struct ktr_header *kth; 56 struct proc *p = curproc; /* XXX */ 57 58 MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header), --- 190 unchanged lines hidden (view full) --- 249 struct nameidata nd; 250 251 curp->p_traceflag |= KTRFAC_ACTIVE; 252 if (ops != KTROP_CLEAR) { 253 /* 254 * an operation which requires a file argument. 255 */ 256 NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname, curp); | 49struct ktr_header * 50ktrgetheader(type) 51 int type; 52{ 53 register struct ktr_header *kth; 54 struct proc *p = curproc; /* XXX */ 55 56 MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header), --- 190 unchanged lines hidden (view full) --- 247 struct nameidata nd; 248 249 curp->p_traceflag |= KTRFAC_ACTIVE; 250 if (ops != KTROP_CLEAR) { 251 /* 252 * an operation which requires a file argument. 253 */ 254 NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->fname, curp); |
257 if (error = vn_open(&nd, FREAD|FWRITE, 0)) { | 255 error = vn_open(&nd, FREAD|FWRITE, 0); 256 if (error) { |
258 curp->p_traceflag &= ~KTRFAC_ACTIVE; 259 return (error); 260 } 261 vp = nd.ni_vp; 262 VOP_UNLOCK(vp); 263 if (vp->v_type != VREG) { 264 (void) vn_close(vp, FREAD|FWRITE, curp->p_ucred, curp); 265 curp->p_traceflag &= ~KTRFAC_ACTIVE; --- 215 unchanged lines hidden --- | 257 curp->p_traceflag &= ~KTRFAC_ACTIVE; 258 return (error); 259 } 260 vp = nd.ni_vp; 261 VOP_UNLOCK(vp); 262 if (vp->v_type != VREG) { 263 (void) vn_close(vp, FREAD|FWRITE, curp->p_ucred, curp); 264 curp->p_traceflag &= ~KTRFAC_ACTIVE; --- 215 unchanged lines hidden --- |