Increment an interrupt depth counter in non-clock interrupt cases
so that we can get time spent in interrupt statistics.
This commit is contained in:
parent
0da76771e9
commit
df4a5a7f43
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */
|
/* $NetBSD: interrupt.c,v 1.47 2000/06/04 03:40:03 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.47 2000/06/04 03:40:03 thorpej Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -166,6 +166,8 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||||
{
|
{
|
||||||
u_long pending_ipis, bit;
|
u_long pending_ipis, bit;
|
||||||
|
|
||||||
|
atomic_add_ulong(&ci->ci_intrdepth, 1);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf("CPU %lu got IPI\n", cpu_id);
|
printf("CPU %lu got IPI\n", cpu_id);
|
||||||
#endif
|
#endif
|
||||||
|
@ -190,6 +192,8 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||||
if (ci->ci_cpuid == hwrpb->rpb_primary_cpu_id &&
|
if (ci->ci_cpuid == hwrpb->rpb_primary_cpu_id &&
|
||||||
hwrpb->rpb_txrdy != 0)
|
hwrpb->rpb_txrdy != 0)
|
||||||
cpu_iccb_receive();
|
cpu_iccb_receive();
|
||||||
|
|
||||||
|
atomic_sub_ulong(&ci->ci_intrdepth, 1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
printf("WARNING: received interprocessor interrupt!\n");
|
printf("WARNING: received interprocessor interrupt!\n");
|
||||||
|
@ -197,6 +201,12 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALPHA_INTR_CLOCK: /* clock interrupt */
|
case ALPHA_INTR_CLOCK: /* clock interrupt */
|
||||||
|
/*
|
||||||
|
* We don't increment the interrupt depth for the
|
||||||
|
* clock interrupt, since it is *sampled* from
|
||||||
|
* the clock interrupt, so if we did, all system
|
||||||
|
* time would be counted as interrupt time.
|
||||||
|
*/
|
||||||
#if defined(MULTIPROCESSOR)
|
#if defined(MULTIPROCESSOR)
|
||||||
/* XXX XXX XXX */
|
/* XXX XXX XXX */
|
||||||
if (CPU_IS_PRIMARY(ci) == 0)
|
if (CPU_IS_PRIMARY(ci) == 0)
|
||||||
|
@ -223,11 +233,13 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALPHA_INTR_ERROR: /* Machine Check or Correctable Error */
|
case ALPHA_INTR_ERROR: /* Machine Check or Correctable Error */
|
||||||
|
atomic_add_ulong(&ci->ci_intrdepth, 1);
|
||||||
a0 = alpha_pal_rdmces();
|
a0 = alpha_pal_rdmces();
|
||||||
if (platform.mcheck_handler)
|
if (platform.mcheck_handler)
|
||||||
(*platform.mcheck_handler)(a0, framep, a1, a2);
|
(*platform.mcheck_handler)(a0, framep, a1, a2);
|
||||||
else
|
else
|
||||||
machine_check(a0, framep, a1, a2);
|
machine_check(a0, framep, a1, a2);
|
||||||
|
atomic_sub_ulong(&ci->ci_intrdepth, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALPHA_INTR_DEVICE: /* I/O device interrupt */
|
case ALPHA_INTR_DEVICE: /* I/O device interrupt */
|
||||||
|
@ -236,9 +248,11 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||||
if (CPU_IS_PRIMARY(ci) == 0)
|
if (CPU_IS_PRIMARY(ci) == 0)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
atomic_add_ulong(&ci->ci_intrdepth, 1);
|
||||||
uvmexp.intrs++;
|
uvmexp.intrs++;
|
||||||
if (platform.iointr)
|
if (platform.iointr)
|
||||||
(*platform.iointr)(framep, a1);
|
(*platform.iointr)(framep, a1);
|
||||||
|
atomic_sub_ulong(&ci->ci_intrdepth, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALPHA_INTR_PERF: /* performance counter interrupt */
|
case ALPHA_INTR_PERF: /* performance counter interrupt */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: cpu.h,v 1.41 2000/06/03 20:47:40 thorpej Exp $ */
|
/* $NetBSD: cpu.h,v 1.42 2000/06/04 03:40:04 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
|
||||||
|
@ -128,6 +128,7 @@ struct cpu_info {
|
||||||
struct device *ci_dev; /* pointer to our device */
|
struct device *ci_dev; /* pointer to our device */
|
||||||
u_long ci_want_resched; /* preempt current process */
|
u_long ci_want_resched; /* preempt current process */
|
||||||
u_long ci_astpending; /* AST is pending */
|
u_long ci_astpending; /* AST is pending */
|
||||||
|
u_long ci_intrdepth; /* interrupt trap depth */
|
||||||
#if defined(MULTIPROCESSOR)
|
#if defined(MULTIPROCESSOR)
|
||||||
u_long ci_flags; /* flags; see below */
|
u_long ci_flags; /* flags; see below */
|
||||||
u_long ci_ipis; /* interprocessor interrupts pending */
|
u_long ci_ipis; /* interprocessor interrupts pending */
|
||||||
|
@ -179,11 +180,13 @@ struct clockframe {
|
||||||
#define CLKF_BASEPRI(framep) \
|
#define CLKF_BASEPRI(framep) \
|
||||||
(((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_IPL_MASK) == 0)
|
(((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_IPL_MASK) == 0)
|
||||||
#define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC])
|
#define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC])
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX No way to accurately tell if we were in interrupt mode before taking
|
* This isn't perfect; if the clock interrupt comes in before the
|
||||||
* clock interrupt.
|
* r/m/w cycle is complete, we won't be counted... but it's not
|
||||||
|
* like this stastic has to be extremely accurate.
|
||||||
*/
|
*/
|
||||||
#define CLKF_INTR(framep) (0)
|
#define CLKF_INTR(framep) (curcpu()->ci_intrdepth)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Preempt the current process if in interrupt from user mode,
|
* Preempt the current process if in interrupt from user mode,
|
||||||
|
|
Loading…
Reference in New Issue