Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch MD systrace gluons.



details:   https://anonhg.NetBSD.org/src/rev/24e7e50b895c
branches:  trunk
changeset: 532893:24e7e50b895c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 17 16:32:57 2002 +0000

description:
MD systrace gluons.

diffstat:

 sys/arch/acorn26/acorn26/conf.c           |  11 ++++++-
 sys/arch/acorn32/acorn32/conf.c           |   9 +++++-
 sys/arch/algor/algor/conf.c               |  13 +++++++-
 sys/arch/alpha/alpha/conf.c               |  11 ++++++-
 sys/arch/alpha/alpha/linux_syscall.c      |  46 +++++++++++++++---------------
 sys/arch/alpha/alpha/osf1_syscall.c       |  46 ++++++++++++++----------------
 sys/arch/alpha/alpha/syscall.c            |  44 +++++++++++++----------------
 sys/arch/amiga/amiga/conf.c               |  18 +++++++++--
 sys/arch/arc/arc/conf.c                   |  10 ++++++-
 sys/arch/arm/arm/linux_syscall.c          |  27 +++++++----------
 sys/arch/arm/arm/syscall.c                |  26 ++++++----------
 sys/arch/arm/arm32/conf.c                 |  11 ++++++-
 sys/arch/atari/atari/conf.c               |   9 +++++-
 sys/arch/bebox/bebox/conf.c               |  10 +++++-
 sys/arch/cesfic/cesfic/conf.c             |  10 ++++++-
 sys/arch/cobalt/cobalt/conf.c             |  10 ++++++-
 sys/arch/dreamcast/dreamcast/conf.c       |  10 ++++++-
 sys/arch/evbmips/malta/conf.c             |  13 +++++++-
 sys/arch/evbsh3/evbsh3/conf.c             |  11 ++++++-
 sys/arch/hp300/hp300/conf.c               |  11 ++++++-
 sys/arch/hp700/hp700/conf.c               |  19 ++++++++++--
 sys/arch/hpcmips/hpcmips/conf.c           |   9 +++++-
 sys/arch/hpcsh/hpcsh/conf.c               |   8 ++++-
 sys/arch/hppa/hppa/trap.c                 |  29 +++++++++----------
 sys/arch/i386/conf/GENERIC                |   5 ++-
 sys/arch/i386/i386/conf.c                 |  12 ++++++-
 sys/arch/i386/i386/freebsd_syscall.c      |  39 +++++++++++++------------
 sys/arch/i386/i386/ibcs2_syscall.c        |  40 +++++++++++++-------------
 sys/arch/i386/i386/linux_syscall.c        |  43 +++++++++++++++-------------
 sys/arch/i386/i386/mach_syscall.c         |  42 ++++++++++++++--------------
 sys/arch/i386/i386/svr4_syscall.c         |  40 +++++++++++++-------------
 sys/arch/i386/i386/syscall.c              |  41 ++++++++++++++-------------
 sys/arch/luna68k/luna68k/conf.c           |  10 +++++-
 sys/arch/m68k/m68k/m68k_syscall.c         |  33 +++++++++------------
 sys/arch/mac68k/mac68k/conf.c             |   9 +++++-
 sys/arch/macppc/macppc/conf.c             |  10 ++++++-
 sys/arch/mips/mips/syscall.c              |  41 ++++++++++++--------------
 sys/arch/mipsco/mipsco/conf.c             |  10 ++++++-
 sys/arch/mmeye/mmeye/conf.c               |  10 ++++++-
 sys/arch/mvme68k/mvme68k/conf.c           |   9 +++++-
 sys/arch/mvmeppc/mvmeppc/conf.c           |   9 +++++-
 sys/arch/news68k/news68k/conf.c           |   9 +++++-
 sys/arch/newsmips/newsmips/conf.c         |  10 ++++++-
 sys/arch/next68k/next68k/conf.c           |   9 +++++-
 sys/arch/ofppc/ofppc/conf.c               |  11 ++++++-
 sys/arch/pc532/pc532/conf.c               |  11 ++++++-
 sys/arch/pc532/pc532/trap.c               |  33 +++++++++------------
 sys/arch/playstation2/playstation2/conf.c |  10 ++++++-
 sys/arch/pmax/pmax/conf.c                 |  10 ++++++-
 sys/arch/pmppc/pmppc/conf.c               |  10 +++++-
 sys/arch/powerpc/ibm4xx/trap.c            |  32 +++++++++------------
 sys/arch/powerpc/powerpc/trap.c           |  21 ++++++++------
 sys/arch/prep/prep/conf.c                 |  11 ++++++-
 sys/arch/sandpoint/sandpoint/conf.c       |   9 +++++-
 sys/arch/sbmips/sbmips/conf.c             |  12 ++++++-
 sys/arch/sgimips/sgimips/conf.c           |   9 +++++-
 sys/arch/sh3/sh3/exception.c              |  27 ++++++++----------
 sys/arch/shark/shark/conf.c               |  10 ++++++-
 sys/arch/sparc/sparc/conf.c               |   9 +++++-
 sys/arch/sparc/sparc/trap.c               |  33 +++++++--------------
 sys/arch/sparc64/sparc64/conf.c           |   8 ++++-
 sys/arch/sparc64/sparc64/trap.c           |  33 ++++++++++------------
 sys/arch/sun2/sun2/conf.c                 |   9 +++++-
 sys/arch/sun3/sun3/conf.c                 |   9 +++++-
 sys/arch/vax/vax/conf.c                   |  13 ++++++--
 sys/arch/vax/vax/trap.c                   |  33 ++++++++-------------
 sys/arch/walnut/walnut/conf.c             |  10 ++++++-
 sys/arch/x68k/x68k/conf.c                 |   9 ++++-
 sys/arch/x86_64/x86_64/conf.c             |   9 +++++-
 sys/arch/x86_64/x86_64/netbsd32_syscall.c |  41 ++++++++++++++------------
 sys/arch/x86_64/x86_64/syscall.c          |  39 ++++++++++++-------------
 71 files changed, 817 insertions(+), 506 deletions(-)

diffs (truncated from 3743 to 300 lines):

diff -r 42001cb13148 -r 24e7e50b895c sys/arch/acorn26/acorn26/conf.c
--- a/sys/arch/acorn26/acorn26/conf.c   Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/acorn26/acorn26/conf.c   Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.2 2002/03/24 23:37:42 bjh21 Exp $ */
+/* $NetBSD: conf.c,v 1.3 2002/06/17 16:32:57 christos Exp $ */
 /*-
  * Copyright (c) 1998, 2000 Ben Harris
  * All rights reserved.
@@ -29,9 +29,10 @@
  * conf.c -- Device switch tables and related gumf.
  */
 
+#include "opt_systrace.h"
 #include <sys/param.h>
 
-__RCSID("$NetBSD: conf.c,v 1.2 2002/03/24 23:37:42 bjh21 Exp $");
+__RCSID("$NetBSD: conf.c,v 1.3 2002/06/17 16:32:57 christos Exp $");
 
 #include <sys/systm.h>
 #include <sys/buf.h>
@@ -130,6 +131,11 @@
                cdev_vc_nb_init(NVCODA,vc_nb_), /* 25: coda file system psdev */
        cdev_disk_init(NRAID,raid),     /* 26: RAIDframe disk driver */
        cdev_clockctl_init(NCLOCKCTL, clockctl),/* 27: clockctl pseudo device */
+#ifdef SYSTRACE
+       cdev_systrace_init(1, systrace),/* 28: system call tracing */
+#else
+       cdev_notdef(),                  /* 28: system call tracing */
+#endif
 };
 
 int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
@@ -200,6 +206,7 @@
        /* 25 */        NODEV,
        /* 26 */        7,              /* raid */
        /* 27 */        NODEV,
+       /* 28 */        NODEV,
 };
 
 /*
diff -r 42001cb13148 -r 24e7e50b895c sys/arch/acorn32/acorn32/conf.c
--- a/sys/arch/acorn32/acorn32/conf.c   Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/acorn32/acorn32/conf.c   Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.5 2002/04/19 01:04:42 wiz Exp $     */
+/*     $NetBSD: conf.c,v 1.6 2002/06/17 16:32:57 christos Exp $        */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -45,6 +45,7 @@
  */
 
 #include "opt_footbridge.h"
+#include "opt_systrace.h"
  
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -297,6 +298,11 @@
        cdev_isdntrc_init(NISDNTRC, isdntrc),   /* 82: isdn trace device */
        cdev_isdntel_init(NISDNTEL, isdntel),   /* 83: isdn phone device */
        cdev_clockctl_init(NCLOCKCTL, clockctl),/* 84: clockctl pseudo device */
+#ifdef SYSTRACE
+       cdev_systrace_init(1, systrace),/* 85: system call tracing */
+#else
+       cdev_notdef(),                  /* 85: system call tracing */
+#endif
 };
 
 int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
@@ -423,6 +429,7 @@
     /* 82 */       NODEV,
     /* 83 */       NODEV,
     /* 84 */       NODEV,
+    /* 85 */       NODEV,
 };
 
 /*
diff -r 42001cb13148 -r 24e7e50b895c sys/arch/algor/algor/conf.c
--- a/sys/arch/algor/algor/conf.c       Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/algor/algor/conf.c       Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.5 2002/03/16 16:55:52 martin Exp $  */
+/*     $NetBSD: conf.c,v 1.6 2002/06/17 16:32:57 christos Exp $        */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -37,7 +37,9 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.5 2002/03/16 16:55:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.6 2002/06/17 16:32:57 christos Exp $");
+
+#include "opt_systrace.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,6 +140,7 @@
        bdev_lkm_dummy(),               /* 64 */
        bdev_lkm_dummy(),               /* 65 */
        bdev_lkm_dummy(),               /* 66 */
+       bdev_lkm_dummy(),               /* 67 */
 };
 int    nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
 
@@ -328,6 +331,11 @@
        cdev_altq_init(NALTQ,altq),     /* 64: ALTQ control interface */
        cdev__oci_init(NMLX,mlx),       /* 65: Mylex DAC960 control interface */
        cdev_clockctl_init(NCLOCKCTL,clockctl), /* 66: clockctl pseudo device */
+#ifdef SYSTRACE
+       cdev_systrace_init(1, systrace),/* 67: system call tracing */
+#else
+       cdev_notdef(),                  /* 67: system call tracing */
+#endif
 };
 int    nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
 
@@ -436,6 +444,7 @@
        /* 64 */        NODEV,
        /* 65 */        NODEV,
        /* 66 */        NODEV,
+       /* 67 */        NODEV,
 };
 
 /*
diff -r 42001cb13148 -r 24e7e50b895c sys/arch/alpha/alpha/conf.c
--- a/sys/arch/alpha/alpha/conf.c       Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/alpha/alpha/conf.c       Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.62 2002/03/16 16:55:52 martin Exp $ */
+/* $NetBSD: conf.c,v 1.63 2002/06/17 16:32:58 christos Exp $ */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -37,8 +37,9 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.62 2002/03/16 16:55:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.63 2002/06/17 16:32:58 christos Exp $");
 
+#include "opt_systrace.h"
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/buf.h>
@@ -303,6 +304,11 @@
        cdev__ocim_init(NAGP,agp),      /* 67: AGP graphics aperture device */
        cdev__ocm_init(NSTIC,stic),     /* 68: PixelStamp mmap interface */
        cdev_clockctl_init(NCLOCKCTL, clockctl),/* 69: clockctl pseudo device */
+#ifdef SYSTRACE
+       cdev_systrace_init(1, systrace),/* 70: system call tracing */
+#else
+       cdev_notdef(),                  /* 70: system call tracing */
+#endif
 };
 int    nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
 
@@ -414,6 +420,7 @@
        /* 67 */        NODEV,
        /* 68 */        NODEV,
        /* 69 */        NODEV,
+       /* 70 */        NODEV,
 };
 
 /*
diff -r 42001cb13148 -r 24e7e50b895c sys/arch/alpha/alpha/linux_syscall.c
--- a/sys/arch/alpha/alpha/linux_syscall.c      Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/alpha/alpha/linux_syscall.c      Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.c,v 1.5 2001/05/30 12:28:38 mrg Exp $ */
+/* $NetBSD: linux_syscall.c,v 1.6 2002/06/17 16:32:58 christos Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -97,11 +97,12 @@
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
 #include "opt_ktrace.h"
+#include "opt_systrace.h"
 #endif
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.5 2001/05/30 12:28:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.6 2002/06/17 16:32:58 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,6 +112,9 @@
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif
+#ifdef SYSTRACE
+#include <sys/systrace.h>
+#endif
 #include <sys/syscall.h>
 
 #include <uvm/uvm_extern.h>
@@ -136,11 +140,18 @@
 {
 
 #ifdef KTRACE
-       if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET))
-               p->p_md.md_syscall = linux_syscall_fancy;
-       else
+       if (p->p_traceflag & (KTRFAC_SYSCALL | KTRFAC_SYSRET)) {
+               p->p_md.md_syscall = syscall_fancy;
+               return;
+       }
 #endif
-               p->p_md.md_syscall = linux_syscall_plain;
+#ifdef SYSTRACE
+       if (ISSET(p->p_flag, P_SYSTRACE)) {
+               p->p_md.md_syscall = syscall_fancy;
+               return;
+       } 
+#endif
+       p->p_md.md_syscall = syscall_plain;
 }
 
 /*
@@ -304,13 +315,9 @@
        }
        args += hidden;
 
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_SYSCALL))
-               ktrsyscall(p, code, callp->sy_argsize, args);
-#endif
-#ifdef SYSCALL_DEBUG
-       scdebug_call(p, code, args);
-#endif
+
+       if ((error = trace_enter(p, code, args, rval)) != 0)
+               goto bad;
 
        rval[0] = 0;
        rval[1] = 0;
@@ -335,16 +342,9 @@
                break;
        }
 
-#ifdef SYSCALL_DEBUG
-       scdebug_ret(p, code, error, rval);
-#endif
        KERNEL_PROC_UNLOCK(p);
+
+       trace_exit(p, code, args, rval, error);
+
        userret(p);
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_SYSRET)) {
-               KERNEL_PROC_LOCK(p);
-               ktrsysret(p, code, error, rval[0]);
-               KERNEL_PROC_UNLOCK(p);
-       }
-#endif
 }
diff -r 42001cb13148 -r 24e7e50b895c sys/arch/alpha/alpha/osf1_syscall.c
--- a/sys/arch/alpha/alpha/osf1_syscall.c       Mon Jun 17 16:31:50 2002 +0000
+++ b/sys/arch/alpha/alpha/osf1_syscall.c       Mon Jun 17 16:32:57 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_syscall.c,v 1.7 2002/04/10 04:19:47 mycroft Exp $ */
+/* $NetBSD: osf1_syscall.c,v 1.8 2002/06/17 16:32:58 christos Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -97,11 +97,12 @@
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
 #include "opt_ktrace.h"
+#include "opt_systrace.h"
 #endif
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.7 2002/04/10 04:19:47 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.8 2002/06/17 16:32:58 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,6 +112,9 @@
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif
+#ifdef SYSTRACE
+#include <sys/systrace.h>
+#endif
 #include <sys/syscall.h>
 
 #include <uvm/uvm_extern.h>
@@ -131,13 +135,19 @@
 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;



Home | Main Index | Thread Index | Old Index