Add a proc_is_traced_p() macro and use it, instead of copying the same code
in many places. Idea from thorpej.
This commit is contained in:
parent
1b2709754a
commit
beea4fc3fa
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.c,v 1.16 2006/03/05 07:21:37 christos Exp $ */
|
||||
/* $NetBSD: linux_syscall.c,v 1.17 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -102,7 +102,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.16 2006/03/05 07:21:37 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.17 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -140,20 +140,7 @@ void linux_syscall_fancy(struct lwp *, u_int64_t, struct trapframe *);
|
||||
void
|
||||
linux_syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: osf1_syscall.c,v 1.18 2006/03/05 07:21:37 christos Exp $ */
|
||||
/* $NetBSD: osf1_syscall.c,v 1.19 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -102,7 +102,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.18 2006/03/05 07:21:37 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.19 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -137,19 +137,7 @@ void osf1_syscall_fancy(struct lwp *, u_int64_t, struct trapframe *);
|
||||
void
|
||||
osf1_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = osf1_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = osf1_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = osf1_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = osf1_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.19 2006/03/05 07:21:37 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.20 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -100,7 +100,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.19 2006/03/05 07:21:37 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.20 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -130,19 +130,7 @@ void syscall_fancy(struct lwp *, u_int64_t, struct trapframe *);
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: linux32_syscall.c,v 1.2 2006/03/05 07:21:37 christos Exp $ */
|
||||
/* $NetBSD: linux32_syscall.c,v 1.3 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.2 2006/03/05 07:21:37 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.3 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -35,22 +35,9 @@ void linux32_syscall_plain(struct trapframe *);
|
||||
void linux32_syscall_fancy(struct trapframe *);
|
||||
|
||||
void
|
||||
linux32_syscall_intern(p)
|
||||
struct proc *p;
|
||||
linux32_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux32_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = linux32_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux32_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux32_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.c,v 1.5 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: linux_syscall.c,v 1.6 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.5 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.6 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -84,19 +84,7 @@ static void linux_syscall_fancy(struct trapframe *);
|
||||
void
|
||||
linux_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_syscall.c,v 1.9 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: netbsd32_syscall.c,v 1.10 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.9 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.10 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -69,22 +69,9 @@ void netbsd32_syscall_plain(struct trapframe *);
|
||||
void netbsd32_syscall_fancy(struct trapframe *);
|
||||
|
||||
void
|
||||
netbsd32_syscall_intern(p)
|
||||
struct proc *p;
|
||||
netbsd32_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = netbsd32_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = netbsd32_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = netbsd32_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = netbsd32_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.15 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.16 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.15 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.16 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -97,19 +97,7 @@ child_return(void *arg)
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.c,v 1.15 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: linux_syscall.c,v 1.16 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.15 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.16 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include <sys/device.h>
|
||||
#include <sys/errno.h>
|
||||
@ -117,19 +117,7 @@ void linux_syscall_fancy(struct trapframe *, struct lwp *, u_int32_t);
|
||||
void
|
||||
linux_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (p->p_flag & P_SYSTRACE) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.30 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.31 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.30 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.31 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include <sys/device.h>
|
||||
#include <sys/errno.h>
|
||||
@ -217,19 +217,7 @@ void syscall_fancy(struct trapframe *, struct lwp *, u_int32_t);
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (p->p_flag & P_SYSTRACE) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: freebsd_syscall.c,v 1.21 2006/03/05 12:31:23 yamt Exp $ */
|
||||
/* $NetBSD: freebsd_syscall.c,v 1.22 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.21 2006/03/05 12:31:23 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.22 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -74,23 +74,9 @@ void freebsd_syscall_plain(struct trapframe *);
|
||||
void freebsd_syscall_fancy(struct trapframe *);
|
||||
|
||||
void
|
||||
freebsd_syscall_intern(p)
|
||||
struct proc *p;
|
||||
freebsd_syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = freebsd_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = freebsd_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = freebsd_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = freebsd_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ibcs2_syscall.c,v 1.30 2006/03/05 12:31:23 yamt Exp $ */
|
||||
/* $NetBSD: ibcs2_syscall.c,v 1.31 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.30 2006/03/05 12:31:23 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.31 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -76,22 +76,9 @@ void ibcs2_syscall_fancy(struct trapframe *);
|
||||
extern struct sysent ibcs2_sysent[];
|
||||
|
||||
void
|
||||
ibcs2_syscall_intern(p)
|
||||
struct proc *p;
|
||||
ibcs2_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = ibcs2_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = ibcs2_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = ibcs2_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = ibcs2_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.c,v 1.34 2006/03/05 12:31:23 yamt Exp $ */
|
||||
/* $NetBSD: linux_syscall.c,v 1.35 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.34 2006/03/05 12:31:23 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.35 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -77,22 +77,9 @@ void linux_syscall_fancy(struct trapframe *);
|
||||
extern struct sysent linux_sysent[];
|
||||
|
||||
void
|
||||
linux_syscall_intern(p)
|
||||
struct proc *p;
|
||||
linux_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mach_syscall.c,v 1.16 2006/03/05 12:31:23 yamt Exp $ */
|
||||
/* $NetBSD: mach_syscall.c,v 1.17 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mach_syscall.c,v 1.16 2006/03/05 12:31:23 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mach_syscall.c,v 1.17 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_vm86.h"
|
||||
@ -72,22 +72,9 @@ void mach_syscall_fancy(struct trapframe *);
|
||||
extern struct sysent mach_sysent[];
|
||||
|
||||
void
|
||||
mach_syscall_intern(p)
|
||||
struct proc *p;
|
||||
mach_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = mach_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = mach_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = mach_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = mach_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svr4_syscall.c,v 1.29 2006/03/05 12:31:23 yamt Exp $ */
|
||||
/* $NetBSD: svr4_syscall.c,v 1.30 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.29 2006/03/05 12:31:23 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.30 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -75,22 +75,9 @@ void svr4_syscall_fancy(struct trapframe *);
|
||||
extern struct sysent svr4_sysent[];
|
||||
|
||||
void
|
||||
svr4_syscall_intern(p)
|
||||
struct proc *p;
|
||||
svr4_syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = svr4_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = svr4_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = svr4_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = svr4_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.35 2006/03/05 12:22:46 yamt Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.36 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.35 2006/03/05 12:22:46 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.36 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_vm86.h"
|
||||
@ -75,19 +75,7 @@ void
|
||||
syscall_intern(p)
|
||||
struct proc *p;
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((p->p_flag & P_SYSCALL) != 0)
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.c,v 1.11 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: linux_syscall.c,v 1.12 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Portions Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -110,7 +110,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.11 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.12 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_execfmt.h"
|
||||
@ -145,20 +145,7 @@ static void linux_syscall_fancy(register_t, struct lwp *, struct frame *);
|
||||
void
|
||||
linux_syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = linux_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = linux_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: m68k_syscall.c,v 1.18 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: m68k_syscall.c,v 1.19 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Portions Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -110,7 +110,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: m68k_syscall.c,v 1.18 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: m68k_syscall.c,v 1.19 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_execfmt.h"
|
||||
@ -185,20 +185,7 @@ syscall(register_t code, struct frame frame)
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sunos_syscall.c,v 1.10 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: sunos_syscall.c,v 1.11 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Portions Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -110,7 +110,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sunos_syscall.c,v 1.10 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sunos_syscall.c,v 1.11 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_execfmt.h"
|
||||
@ -148,20 +148,7 @@ static void sunos_syscall_fancy(register_t, struct lwp *, struct frame *);
|
||||
void
|
||||
sunos_syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = sunos_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = sunos_syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = sunos_syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = sunos_syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.25 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.26 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -114,7 +114,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.25 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.26 2006/03/05 19:08:38 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_ktrace.h"
|
||||
@ -164,19 +164,7 @@ vaddr_t MachEmulateBranch(struct frame *, vaddr_t, u_int, int);
|
||||
void
|
||||
EMULNAME(syscall_intern)(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
else
|
||||
p->p_md.md_syscall = EMULNAME(syscall_plain);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.26 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.27 2006/03/05 19:08:39 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Matt Thomas
|
||||
@ -69,7 +69,7 @@
|
||||
#define EMULNAME(x) (x)
|
||||
#define EMULNAMEU(x) (x)
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.26 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.27 2006/03/05 19:08:39 christos Exp $");
|
||||
|
||||
void
|
||||
child_return(void *arg)
|
||||
@ -327,19 +327,7 @@ void EMULNAME(syscall_intern)(struct proc *);
|
||||
void
|
||||
EMULNAME(syscall_intern)(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = EMULNAME(syscall_fancy);
|
||||
else
|
||||
p->p_md.md_syscall = EMULNAME(syscall_plain);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.3 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.4 2006/03/05 19:08:39 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
|
||||
@ -109,20 +109,7 @@ static void syscall_fancy(struct lwp *, struct trapframe *);
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.16 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.17 2006/03/05 19:08:39 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -130,7 +130,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.16 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.17 2006/03/05 19:08:39 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -164,20 +164,7 @@ static void syscall_fancy(struct lwp *, struct trapframe *);
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.6 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.7 2006/03/05 19:08:39 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -49,7 +49,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.6 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.7 2006/03/05 19:08:39 christos Exp $");
|
||||
|
||||
#include "opt_syscall_debug.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -189,19 +189,7 @@ save_fpu(struct trapframe *tf)
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syscall.c,v 1.12 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.13 2006/03/05 19:08:39 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||
@ -86,7 +86,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.12 2006/03/05 07:21:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.13 2006/03/05 19:08:39 christos Exp $");
|
||||
|
||||
#define NEW_FPSTATE
|
||||
|
||||
@ -256,19 +256,7 @@ getargs(struct proc *p, struct trapframe64 *tf, register_t *code,
|
||||
void
|
||||
syscall_intern(struct proc *p)
|
||||
{
|
||||
#ifdef KTRACE
|
||||
if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SYSTRACE
|
||||
if (ISSET(p->p_flag, P_SYSTRACE)) {
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(p->p_flag, P_SYSCALL))
|
||||
if (proc_is_traced_p(p))
|
||||
p->p_md.md_syscall = syscall_fancy;
|
||||
else
|
||||
p->p_md.md_syscall = syscall_plain;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: proc.h,v 1.214 2006/03/05 07:21:38 christos Exp $ */
|
||||
/* $NetBSD: proc.h,v 1.215 2006/03/05 19:08:38 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1986, 1989, 1991, 1993
|
||||
@ -478,6 +478,20 @@ void cpu_lwp_free(struct lwp *, int);
|
||||
void syscall_intern(struct proc *);
|
||||
#endif
|
||||
|
||||
#ifdef SYSTRACE
|
||||
#define proc_is_systraced_p(p) ISSET((p)->p_flag, P_SYSTRACE)
|
||||
#else
|
||||
#define proc_is_systraced_p(p) 0
|
||||
#endif
|
||||
#ifdef KTRACE
|
||||
#define proc_is_ktraced_p(p) ((p)->p_traceflag & (KTRFAC_SYSCALL|KTRFAC_SYSRET))
|
||||
#else
|
||||
#define proc_is_ktraced_p(p) 0
|
||||
#endif
|
||||
|
||||
#define proc_is_traced_p(p) (proc_is_systraced_p(p) || proc_is_ktraced_p(p) || \
|
||||
ISSET((p)->p_flag, P_SYSCALL))
|
||||
|
||||
void child_return(void *);
|
||||
|
||||
int proc_isunder(struct proc *, struct lwp *);
|
||||
|
Loading…
Reference in New Issue
Block a user