*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> ktrsysret (9)              



NAME    [Toc]    [Back]

     ktrcsw, ktremul, ktrgenio,  ktrnamei,  ktrpsig,  ktrsyscall,
     KTRPOINT - process tracing kernel interface

SYNOPSIS    [Toc]    [Back]

     #include <sys/param.h>
     #include <sys/proc.h>
     #include <sys/ktrace.h>

     KTRPOINT(struct proc *p, int type);

     ktrcsw(struct proc *p, int out, int user);

     ktremul(struct proc *p, char *emul);

     ktrgenio(struct  proc  *p,  int  fd,  enum uio_rw rw, struct
iovec *iov,
             int len, int error);

     ktrnamei(struct proc *p, char *path);

     ktrpsig(struct proc *p, int sig, sig_t action, int mask, int
             siginfo_t *si);

     ktrsyscall(struct proc *p, register_t code, size_t argsize,
             register_t args[]);

     ktrsysret(struct   proc  *p,  register_t  code,  int  error,
register_t retval);

DESCRIPTION    [Toc]    [Back]

     This interface is meant for kernel  subsystems  and  machine
dependent code
     to inform the user about the events occurring to the process
should tracing
 of such be enabled  using  the  ktrace(2)  system  call.
Each of the
     functions  (except  for  KTRPOINT) is meant for a particular
type of event
     and is described below.

     The KTRPOINT() macro should be used before  calling  any  of
the other tracing
  functions  to  verify  that tracing for that particular
type of events
     has been enabled.  Possible values for the type argument are
a mask of
     the KTRFAC_ values described in ktrace(2).

     ktrcsw()  is  called during the context switching.  The user
argument is a
     boolean value specifying whether the process  has  been  put
into a waiting
     state  (true)  or placed onto a running queue (false).  Furthermore the
     user argument indicates whether a voluntary  (false)  or  an
     (true) switching has happened.

     ktremul() should be called every time emulation for the execution environment
 is changed and thus the name of which  is  given  in
the name argument.

     ktrgenio()  should  be  called for each generic input/output
     that is described by the fd file descriptor, rw  transaction
type (consult
     sys/sys/uio.h  for  the  enum  uio_rw  definition),  iov input/output data vector,
 len size of the iov vector, and, lastly,  error  status
of the transaction.

     ktrnamei()  should be called every time a namei(9) operation
is performed
     over the path name.

     ktrpsig() should be called for each signal  sig  posted  for
the traced process.
   The  action  taken  is  one  of SIG_DFL, SIG_IGN, or
SIG_ERR as described
 in the sigaction(2) document.  mask is  the  current
traced process'
  signal  mask.   Signal-specific  code  and  siginfo_t
structure as described
 in <sys/siginfo.h> are given in the code and si  arguments respectively.

     ktrsyscall()  should  be  called for each system call number
code executed
     with arguments in args of total count of argsize.

     ktrsysret() should be called for a return from  each  system
call number
     code  and error number of error as described in errno(2) and
a return value
 in retval that is syscall dependent.

CODE REFERENCES    [Toc]    [Back]

     The   process   tracing   facility   is    implemented    in

SEE ALSO    [Toc]    [Back]

     errno(2), ktrace(2), syscall(2), namei(9), syscall(9)

HISTORY    [Toc]    [Back]

     The process tracing facility first appeared in 4.4BSD.

     The ktrace section manual page appeared in OpenBSD 3.4.

OpenBSD      3.6                           July      21,     2003
[ Back ]
 Similar pages
Name OS Title
ktrace FreeBSD enable kernel process tracing
ktrace OpenBSD enable kernel process tracing
trace FreeBSD enable kernel process tracing
ktrace OpenBSD process tracing
fktrace NetBSD process tracing
ktrace FreeBSD process tracing
ktrace NetBSD process tracing
ptrace OpenBSD process tracing and debugging
ptrace NetBSD process tracing and debugging
ptrace FreeBSD process tracing and debugging
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service