/* * Copyright (c) 1992 The Regents of the University of California. * All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Lawrence Berkeley Laboratories. * * %sccs.include.redist.c% * * @(#)sys_machdep.c 7.2 (Berkeley) 07/21/92 * * from: $Header: sys_machdep.c,v 1.5 92/07/10 00:29:56 torek Exp $ (LBL) */ #ifdef TRACE #include "sys/param.h" #include "sys/systm.h" #include "sys/ioctl.h" #include "sys/file.h" #include "sys/time.h" #include "sys/proc.h" #include "sys/uio.h" #include "sys/kernel.h" #include "sys/mtio.h" #include "sys/buf.h" #include "sys/trace.h" int nvualarm; struct vtrace_args { int request; int value; }; vtrace(p, uap, retval) struct proc *p; register struct vtrace_args *uap; int *retval; { int vdoualarm(); switch (uap->request) { case VTR_DISABLE: /* disable a trace point */ case VTR_ENABLE: /* enable a trace point */ if (uap->value < 0 || uap->value >= TR_NFLAGS) return (EINVAL); *retval = traceflags[uap->value]; traceflags[uap->value] = uap->request; break; case VTR_VALUE: /* return a trace point setting */ if (uap->value < 0 || uap->value >= TR_NFLAGS) return (EINVAL); *retval = traceflags[uap->value]; break; case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) return (EINVAL); nvualarm++; timeout(vdoualarm, (caddr_t)p->p_pid, uap->value); break; case VTR_STAMP: trace(TR_STAMP, uap->value, p->p_pid); break; } return (0); } vdoualarm(arg) int arg; { register struct proc *p = pfind(arg); if (p != NULL) psignal(p, 16); nvualarm--; } #endif