diff options
author | dg <dg@FreeBSD.org> | 1994-08-27 16:14:39 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-27 16:14:39 +0000 |
commit | 4d4250da00e8f202ebcf4523fa25568d04b116ad (patch) | |
tree | b3ca65b5c2af24b8ce278da15822a7fd638bbeb5 | |
parent | c900d4c13e16169b2482efbfb34820b08862bc16 (diff) | |
download | FreeBSD-src-4d4250da00e8f202ebcf4523fa25568d04b116ad.zip FreeBSD-src-4d4250da00e8f202ebcf4523fa25568d04b116ad.tar.gz |
1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
are no other pseudo declarations.
-rw-r--r-- | sys/amd64/amd64/machdep.c | 8 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 11 | ||||
-rw-r--r-- | sys/conf/files | 1 | ||||
-rw-r--r-- | sys/ddb/db_command.c | 8 | ||||
-rw-r--r-- | sys/ddb/db_output.c | 9 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 8 | ||||
-rw-r--r-- | sys/i386/eisa/aha1742.c | 16 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 11 | ||||
-rw-r--r-- | sys/i386/isa/aha1542.c | 3 | ||||
-rw-r--r-- | sys/i386/isa/aha1742.c | 16 | ||||
-rw-r--r-- | sys/i386/isa/bt742a.c | 3 | ||||
-rw-r--r-- | sys/i386/isa/syscons.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/ultra14f.c | 6 | ||||
-rw-r--r-- | sys/isa/syscons.c | 8 | ||||
-rw-r--r-- | sys/kern/init_main.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_clock.c | 25 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 25 | ||||
-rw-r--r-- | sys/kern/kern_timeout.c | 25 | ||||
-rw-r--r-- | sys/kern/subr_prf.c | 5 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 11 | ||||
-rw-r--r-- | sys/scsi/cd.c | 9 | ||||
-rw-r--r-- | sys/scsi/scsi_base.c | 10 | ||||
-rw-r--r-- | sys/scsi/sd.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 6 |
25 files changed, 130 insertions, 126 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index ce6863c..3ba8234 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.55 1994/08/20 16:02:57 davidg Exp $ + * $Id: machdep.c,v 1.56 1994/08/24 11:45:19 sos Exp $ */ #include "npx.h" @@ -1181,8 +1181,7 @@ init386(first) lldt(_default_ldt); currentldt = _default_ldt; -#include "ddb.h" -#if NDDB > 0 +#ifdef DDB kdb_init(); if (boothowto & RB_KDB) Debugger("Boot flags requested debugger"); @@ -1482,8 +1481,7 @@ set_regs (struct proc *p, struct reg *regs) { return 0; } -#include "ddb.h" -#if NDDB <= 0 +#ifndef DDB void Debugger(const char *msg) { diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index dc62dc9..e4a9100 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.29 1994/08/18 22:34:43 wollman Exp $ + * $Id: trap.c,v 1.30 1994/08/24 11:52:21 sos Exp $ */ /* @@ -67,7 +67,6 @@ #include "isa.h" #include "npx.h" -#include "ddb.h" int trap_pfault __P((struct trapframe *, int)); void trap_fatal __P((struct trapframe *)); @@ -225,7 +224,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -286,7 +285,7 @@ trap(frame) } break; -#if NDDB > 0 +#ifdef DDB case T_BPTFLT: case T_TRCTRAP: if (kdb_trap (type, 0, &frame)) @@ -301,7 +300,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -505,7 +504,7 @@ trap_fatal(frame) if (kdb_trap(&psl)) return; #endif -#if NDDB > 0 +#ifdef DDB if (kdb_trap (type, 0, frame)) return; #endif diff --git a/sys/conf/files b/sys/conf/files index 501d284..216785e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -8,6 +8,7 @@ ddb/db_input.c optional ddb ddb/db_lex.c optional ddb ddb/db_output.c optional ddb ddb/db_print.c optional ddb +ddb/db_ps.c optional ddb ddb/db_run.c optional ddb ddb/db_sym.c optional ddb ddb/db_trap.c optional ddb diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index ed328be..04793c9 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_command.c,v 1.6 1994/08/13 03:49:16 wollman Exp $ + * $Id: db_command.c,v 1.7 1994/08/18 22:34:20 wollman Exp $ */ /* @@ -306,15 +306,15 @@ db_command(last_cmdp, cmd_table) extern void db_show_one_thread(), db_show_all_threads(); extern void vm_page_print(); -/* extern void db_ps(); */ +extern void db_ps(); extern void ipc_port_print(); void db_show_help(); struct command db_show_all_cmds[] = { #if 0 { "threads", db_show_all_threads, 0, 0 }, - { "procs", db_ps, 0, 0 }, #endif + { "procs", db_ps, 0, 0 }, { (char *)0 } }; @@ -363,9 +363,7 @@ struct command db_command_table[] = { { "trace", db_stack_trace_cmd, 0, 0 }, { "call", db_fncall, CS_OWN, 0 }, { "show", 0, 0, db_show_cmds }, -#if 0 { "ps", db_ps, 0, 0 }, -#endif { (char *)0, } }; diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 98b668a..f2b14e4 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_output.c,v 1.6 1993/12/19 00:49:45 wollman Exp $ + * $Id: db_output.c,v 1.7 1994/08/13 03:49:21 wollman Exp $ */ /* @@ -107,6 +107,13 @@ db_putchar(c) db_last_non_space = db_output_position; } else if (c == '\n') { + /* Newline */ + cnputc(c); + db_output_position = 0; + db_last_non_space = 0; + db_check_interrupt(); + } + else if (c == '\r') { /* Return */ cnputc(c); db_output_position = 0; diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index eae66d6..59720db 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.51 1994/08/17 19:32:23 sos Exp $ + * $Id: syscons.c,v 1.52 1994/08/20 03:48:42 davidg Exp $ */ #include "sc.h" @@ -278,10 +278,6 @@ struct tty pccons[NCONS+1]; #define timeout_t timeout_func_t #define MONO_BUF (KERNBASE+0xB0000) #define CGA_BUF (KERNBASE+0xB8000) -#include "ddb.h" -#if NDDB > 0 -#define DDB 1 -#endif u_short *Crtat = (u_short *)MONO_BUF; void consinit(void) {scinit();} @@ -2412,7 +2408,7 @@ next_code: shutdown_nice(); break; case DBG: -#if DDB > 0 /* try to switch to console 0 */ +#ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0].smode.mode == VT_AUTO) switch_scr(0); diff --git a/sys/i386/eisa/aha1742.c b/sys/i386/eisa/aha1742.c index 1f770e2..7f35a77 100644 --- a/sys/i386/eisa/aha1742.c +++ b/sys/i386/eisa/aha1742.c @@ -14,7 +14,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aha1742.c,v 1.18 1994/08/20 03:48:38 davidg Exp $ + * $Id: aha1742.c,v 1.19 1994/08/23 07:52:04 paul Exp $ */ #include <sys/types.h> @@ -38,15 +38,11 @@ /* */ #ifdef KERNEL -# ifdef NetBSD -# ifdef DDB +# ifdef DDB int Debugger(); -# else /* DDB */ +# else /* DDB */ #define Debugger() panic("should call debugger here (adaptec.c)") -# endif /* DDB */ -# else -#include "ddb.h" -#endif /* netbsd */ +# endif /* DDB */ #else /* KERNEL */ #define NAHB 1 #endif /* kernel */ @@ -512,11 +508,7 @@ int ahb_attach(dev) struct isa_device *dev; { -#ifdef NetBSD - int unit = dev->id_masunit; -#else int unit = dev->id_unit; -#endif struct ahb_data *ahb = ahbdata[unit]; /* diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index ce6863c..3ba8234 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.55 1994/08/20 16:02:57 davidg Exp $ + * $Id: machdep.c,v 1.56 1994/08/24 11:45:19 sos Exp $ */ #include "npx.h" @@ -1181,8 +1181,7 @@ init386(first) lldt(_default_ldt); currentldt = _default_ldt; -#include "ddb.h" -#if NDDB > 0 +#ifdef DDB kdb_init(); if (boothowto & RB_KDB) Debugger("Boot flags requested debugger"); @@ -1482,8 +1481,7 @@ set_regs (struct proc *p, struct reg *regs) { return 0; } -#include "ddb.h" -#if NDDB <= 0 +#ifndef DDB void Debugger(const char *msg) { diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index dc62dc9..e4a9100 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.29 1994/08/18 22:34:43 wollman Exp $ + * $Id: trap.c,v 1.30 1994/08/24 11:52:21 sos Exp $ */ /* @@ -67,7 +67,6 @@ #include "isa.h" #include "npx.h" -#include "ddb.h" int trap_pfault __P((struct trapframe *, int)); void trap_fatal __P((struct trapframe *)); @@ -225,7 +224,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -286,7 +285,7 @@ trap(frame) } break; -#if NDDB > 0 +#ifdef DDB case T_BPTFLT: case T_TRCTRAP: if (kdb_trap (type, 0, &frame)) @@ -301,7 +300,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -505,7 +504,7 @@ trap_fatal(frame) if (kdb_trap(&psl)) return; #endif -#if NDDB > 0 +#ifdef DDB if (kdb_trap (type, 0, frame)) return; #endif diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c index 0a64cef..1190dab 100644 --- a/sys/i386/isa/aha1542.c +++ b/sys/i386/isa/aha1542.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1542.c,v 1.32 1994/08/20 03:48:37 davidg Exp $ + * $Id: aha1542.c,v 1.33 1994/08/23 07:52:00 paul Exp $ */ /* @@ -37,7 +37,6 @@ #include <scsi/scsiconf.h> #ifdef KERNEL -#include "ddb.h" #include <sys/kernel.h> #else /*KERNEL */ #define NAHA 1 diff --git a/sys/i386/isa/aha1742.c b/sys/i386/isa/aha1742.c index 1f770e2..7f35a77 100644 --- a/sys/i386/isa/aha1742.c +++ b/sys/i386/isa/aha1742.c @@ -14,7 +14,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aha1742.c,v 1.18 1994/08/20 03:48:38 davidg Exp $ + * $Id: aha1742.c,v 1.19 1994/08/23 07:52:04 paul Exp $ */ #include <sys/types.h> @@ -38,15 +38,11 @@ /* */ #ifdef KERNEL -# ifdef NetBSD -# ifdef DDB +# ifdef DDB int Debugger(); -# else /* DDB */ +# else /* DDB */ #define Debugger() panic("should call debugger here (adaptec.c)") -# endif /* DDB */ -# else -#include "ddb.h" -#endif /* netbsd */ +# endif /* DDB */ #else /* KERNEL */ #define NAHB 1 #endif /* kernel */ @@ -512,11 +508,7 @@ int ahb_attach(dev) struct isa_device *dev; { -#ifdef NetBSD - int unit = dev->id_masunit; -#else int unit = dev->id_unit; -#endif struct ahb_data *ahb = ahbdata[unit]; /* diff --git a/sys/i386/isa/bt742a.c b/sys/i386/isa/bt742a.c index 08e8926..fa4c8d7 100644 --- a/sys/i386/isa/bt742a.c +++ b/sys/i386/isa/bt742a.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: bt742a.c,v 1.20 1994/08/21 20:16:13 paul Exp $ + * $Id: bt742a.c,v 1.21 1994/08/23 07:52:07 paul Exp $ */ /* @@ -38,7 +38,6 @@ #include <scsi/scsiconf.h> #ifdef KERNEL -#include "ddb.h" #include <sys/kernel.h> #else /*KERNEL */ #define NBT 1 diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index eae66d6..59720db 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.51 1994/08/17 19:32:23 sos Exp $ + * $Id: syscons.c,v 1.52 1994/08/20 03:48:42 davidg Exp $ */ #include "sc.h" @@ -278,10 +278,6 @@ struct tty pccons[NCONS+1]; #define timeout_t timeout_func_t #define MONO_BUF (KERNBASE+0xB0000) #define CGA_BUF (KERNBASE+0xB8000) -#include "ddb.h" -#if NDDB > 0 -#define DDB 1 -#endif u_short *Crtat = (u_short *)MONO_BUF; void consinit(void) {scinit();} @@ -2412,7 +2408,7 @@ next_code: shutdown_nice(); break; case DBG: -#if DDB > 0 /* try to switch to console 0 */ +#ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0].smode.mode == VT_AUTO) switch_scr(0); diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c index d723ea0..d86629b 100644 --- a/sys/i386/isa/ultra14f.c +++ b/sys/i386/isa/ultra14f.c @@ -22,7 +22,7 @@ * today: Fri Jun 2 17:21:03 EST 1994 * added 24F support ++sg * - * $Id: ultra14f.c,v 1.21 1994/08/18 23:36:40 phk Exp $ + * $Id: ultra14f.c,v 1.22 1994/08/19 00:32:52 jkh Exp $ */ #include <sys/types.h> @@ -47,9 +47,7 @@ /* */ -#ifdef KERNEL -#include "ddb.h" -#else /*KERNEL */ +#ifndef KERNEL #define NUHA 1 #endif /*KERNEL */ diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index eae66d6..59720db 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.51 1994/08/17 19:32:23 sos Exp $ + * $Id: syscons.c,v 1.52 1994/08/20 03:48:42 davidg Exp $ */ #include "sc.h" @@ -278,10 +278,6 @@ struct tty pccons[NCONS+1]; #define timeout_t timeout_func_t #define MONO_BUF (KERNBASE+0xB0000) #define CGA_BUF (KERNBASE+0xB8000) -#include "ddb.h" -#if NDDB > 0 -#define DDB 1 -#endif u_short *Crtat = (u_short *)MONO_BUF; void consinit(void) {scinit();} @@ -2412,7 +2408,7 @@ next_code: shutdown_nice(); break; case DBG: -#if DDB > 0 /* try to switch to console 0 */ +#ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0].smode.mode == VT_AUTO) switch_scr(0); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 4c33667..d504345 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.5 1994/08/18 22:34:57 wollman Exp $ + * $Id: init_main.c,v 1.6 1994/08/24 11:50:37 sos Exp $ */ #include <sys/param.h> @@ -103,6 +103,10 @@ void __main() {} * This table is filled in by the linker with functions that need to be * called to initialize various pseudo-devices and whatnot. */ + +static void dummyinit() {} +TEXT_SET(pseudo_set, dummyinit); + typedef void (*pseudo_func_t)(void); extern const struct linker_set pseudo_set; static const pseudo_func_t *pseudos = diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 5b365f5..788e279 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $ + * $Id: kern_clock.c,v 1.4 1994/08/18 22:34:58 wollman Exp $ */ #include <sys/param.h> @@ -46,6 +46,7 @@ #include <sys/kernel.h> #include <sys/proc.h> #include <sys/resourcevar.h> +#include <vm/vm.h> #include <machine/cpu.h> @@ -431,11 +432,28 @@ statclock(frame) #ifdef GPROF register struct gmonparam *g; #endif - register struct proc *p; + register struct proc *p = curproc; register int i; + if (p) { + struct pstats *pstats; + struct rusage *ru; + struct vmspace *vm; + + /* bump the resource usage of integral space use */ + if ((pstats = p->p_stats) && (ru = &pstats->p_ru) && (vm = p->p_vmspace)) { + ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024; + ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024; + ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024; + if ((vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024) > + ru->ru_maxrss) { + ru->ru_maxrss = + vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024; + } + } + } + if (CLKF_USERMODE(frame)) { - p = curproc; if (p->p_flag & P_PROFIL) addupc_intr(p, CLKF_PC(frame), 1); if (--pscnt > 0) @@ -477,7 +495,6 @@ statclock(frame) * so that we know how much of its real time was spent * in ``non-process'' (i.e., interrupt) work. */ - p = curproc; if (CLKF_INTR(frame)) { if (p != NULL) p->p_iticks++; diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 5b365f5..788e279 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $ + * $Id: kern_clock.c,v 1.4 1994/08/18 22:34:58 wollman Exp $ */ #include <sys/param.h> @@ -46,6 +46,7 @@ #include <sys/kernel.h> #include <sys/proc.h> #include <sys/resourcevar.h> +#include <vm/vm.h> #include <machine/cpu.h> @@ -431,11 +432,28 @@ statclock(frame) #ifdef GPROF register struct gmonparam *g; #endif - register struct proc *p; + register struct proc *p = curproc; register int i; + if (p) { + struct pstats *pstats; + struct rusage *ru; + struct vmspace *vm; + + /* bump the resource usage of integral space use */ + if ((pstats = p->p_stats) && (ru = &pstats->p_ru) && (vm = p->p_vmspace)) { + ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024; + ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024; + ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024; + if ((vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024) > + ru->ru_maxrss) { + ru->ru_maxrss = + vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024; + } + } + } + if (CLKF_USERMODE(frame)) { - p = curproc; if (p->p_flag & P_PROFIL) addupc_intr(p, CLKF_PC(frame), 1); if (--pscnt > 0) @@ -477,7 +495,6 @@ statclock(frame) * so that we know how much of its real time was spent * in ``non-process'' (i.e., interrupt) work. */ - p = curproc; if (CLKF_INTR(frame)) { if (p != NULL) p->p_iticks++; diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 5b365f5..788e279 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $ + * $Id: kern_clock.c,v 1.4 1994/08/18 22:34:58 wollman Exp $ */ #include <sys/param.h> @@ -46,6 +46,7 @@ #include <sys/kernel.h> #include <sys/proc.h> #include <sys/resourcevar.h> +#include <vm/vm.h> #include <machine/cpu.h> @@ -431,11 +432,28 @@ statclock(frame) #ifdef GPROF register struct gmonparam *g; #endif - register struct proc *p; + register struct proc *p = curproc; register int i; + if (p) { + struct pstats *pstats; + struct rusage *ru; + struct vmspace *vm; + + /* bump the resource usage of integral space use */ + if ((pstats = p->p_stats) && (ru = &pstats->p_ru) && (vm = p->p_vmspace)) { + ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024; + ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024; + ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024; + if ((vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024) > + ru->ru_maxrss) { + ru->ru_maxrss = + vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024; + } + } + } + if (CLKF_USERMODE(frame)) { - p = curproc; if (p->p_flag & P_PROFIL) addupc_intr(p, CLKF_PC(frame), 1); if (--pscnt > 0) @@ -477,7 +495,6 @@ statclock(frame) * so that we know how much of its real time was spent * in ``non-process'' (i.e., interrupt) work. */ - p = curproc; if (CLKF_INTR(frame)) { if (p != NULL) p->p_iticks++; diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index dc55898..230ac73 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.3 1994/08/02 07:42:30 davidg Exp $ + * $Id: subr_prf.c,v 1.4 1994/08/13 14:21:51 davidg Exp $ */ #include <sys/param.h> @@ -122,8 +122,7 @@ panic(fmt, va_alist) if (boothowto & RB_KDB) kdbpanic(); #endif -#include "ddb.h" -#if NDDB > 0 +#ifdef DDB Debugger ("panic"); #endif boot(bootopt); diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index dc62dc9..e4a9100 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.29 1994/08/18 22:34:43 wollman Exp $ + * $Id: trap.c,v 1.30 1994/08/24 11:52:21 sos Exp $ */ /* @@ -67,7 +67,6 @@ #include "isa.h" #include "npx.h" -#include "ddb.h" int trap_pfault __P((struct trapframe *, int)); void trap_fatal __P((struct trapframe *)); @@ -225,7 +224,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -286,7 +285,7 @@ trap(frame) } break; -#if NDDB > 0 +#ifdef DDB case T_BPTFLT: case T_TRCTRAP: if (kdb_trap (type, 0, &frame)) @@ -301,7 +300,7 @@ trap(frame) #if NISA > 0 case T_NMI: -#if NDDB > 0 +#ifdef DDB /* NMI can be hooked up to a pushbutton for debugging */ printf ("NMI ... going to debugger\n"); if (kdb_trap (type, 0, &frame)) @@ -505,7 +504,7 @@ trap_fatal(frame) if (kdb_trap(&psl)) return; #endif -#if NDDB > 0 +#ifdef DDB if (kdb_trap (type, 0, frame)) return; #endif diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 899db93..d0bff56 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: cd.c,v 1.18 1994/04/20 07:06:51 davidg Exp $ + * $Id: cd.c,v 1.19 1994/05/25 09:13:15 rgrimes Exp $ */ #define SPLCD splbio @@ -50,11 +50,10 @@ static errval cd_read_toc(u_int32, u_int32, u_int32, struct cd_toc_entry *, int32 cdstrats, cdqueues; -#include <ddb.h> -#if NDDB > 0 -#else /* NDDB > 0 */ +#ifdef DDB +#else /* DDB */ #define Debugger() -#endif /* NDDB > 0 */ +#endif /* DDB */ #define PAGESIZ 4096 #define SECSIZE 2048 /* XXX */ /* default only */ diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 8ca4900..8cf9584 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -8,7 +8,7 @@ * file. * * Written by Julian Elischer (julian@dialix.oz.au) - * $Id: scsi_base.c,v 1.9 1994/05/25 09:13:20 rgrimes Exp $ + * $Id: scsi_base.c,v 1.10 1994/08/20 03:48:58 davidg Exp $ */ #define SPLSD splbio @@ -28,19 +28,11 @@ static errval sc_err1(struct scsi_xfer *); static errval scsi_interpret_sense(struct scsi_xfer *); -#ifdef NetBSD #ifdef DDB int Debugger(); #else /* DDB */ #define Debugger() #endif /* DDB */ -#else /* NetBSD */ -#include "ddb.h" -#if NDDB > 0 -#else /* NDDB > 0 */ -#define Debugger() -#endif /* NDDB > 0 */ -#endif struct scsi_xfer *next_free_xs; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 691430e..65b20df 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.23 1994/04/20 07:06:57 davidg Exp $ + * $Id: sd.c,v 1.24 1994/05/25 09:13:32 rgrimes Exp $ */ #define SPLSD splbio @@ -42,19 +42,11 @@ u_int32 sdstrats, sdqueues; -#ifdef NetBSD #ifdef DDB int Debugger(); #else /* DDB */ #define Debugger() #endif /* DDB */ -#else /* NetBSD */ -#include <ddb.h> -#if NDDB > 0 -#else /* NDDB > 0 */ -#define Debugger(s) -#endif /* NDDB > 0 */ -#endif #define PAGESIZ 4096 #define SECSIZE 512 diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 3bdb0a2..8ec42f3 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.4 1994/08/07 13:10:40 davidg Exp $ + * $Id: vm_object.c,v 1.5 1994/08/18 22:36:06 wollman Exp $ */ /* @@ -1605,7 +1605,7 @@ vm_object_page_lookup(object, offset) } #define DEBUG -#if defined(DEBUG) || (NDDB > 0) +#if defined(DEBUG) || defined(DDB) /* * vm_object_print: [ debug ] */ @@ -1652,4 +1652,4 @@ void vm_object_print(object, full) printf("\n"); indent -= 2; } -#endif /* defined(DEBUG) || (NDDB > 0) */ +#endif /* defined(DEBUG) || defined(DDB) */ |