Count necpb interrupts with evcnt(9).

This commit is contained in:
tsutsui 2003-11-01 19:23:52 +00:00
parent 4318508981
commit c747a93798
2 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: necpb.c,v 1.16 2003/07/15 00:04:50 lukem Exp $ */
/* $NetBSD: necpb.c,v 1.17 2003/11/01 19:23:52 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.16 2003/07/15 00:04:50 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.17 2003/11/01 19:23:52 tsutsui Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -422,6 +422,9 @@ necpb_intr_establish(pc, ih, level, func, arg)
n->ih_arg = arg;
n->ih_next = NULL;
n->ih_intn = ih;
strlcpy(n->ih_evname, necpb_intr_string(pc, ih), sizeof(n->ih_evname));
evcnt_attach_dynamic(&n->ih_evcnt, EVCNT_TYPE_INTR, NULL, "necpb",
n->ih_evname);
if (necpb_inttbl[ih] == NULL) {
necpb_inttbl[ih] = n;
@ -467,6 +470,8 @@ necpb_intr_disestablish(pc, cookie)
} else
q->ih_next = n->ih_next;
evcnt_detach(&n->ih_evcnt);
free(n, M_DEVBUF);
}
@ -495,6 +500,7 @@ necpb_intr(mask, cf)
p = necpb_inttbl[a];
while (p != NULL) {
(*p->ih_func)(p->ih_arg);
p->ih_evcnt.ev_count++;
p = p->ih_next;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: necpbvar.h,v 1.3 2001/06/13 15:18:28 soda Exp $ */
/* $NetBSD: necpbvar.h,v 1.4 2003/11/01 19:23:52 tsutsui Exp $ */
/*-
* Copyright (C) 2000 Shuichiro URATA. All rights reserved.
@ -40,10 +40,12 @@ struct necpb_softc {
};
struct necpb_intrhand {
int (*ih_func) __P((void *));
void *ih_arg;
struct necpb_intrhand *ih_next;
int ih_intn;
int (*ih_func) __P((void *)); /* interrupt handler */
void *ih_arg; /* arg for handler */
struct necpb_intrhand *ih_next; /* next intrhand chain */
int ih_intn; /* interrupt channel */
struct evcnt ih_evcnt; /* interrupt counter */
char ih_evname[32]; /* event counter name */
};
void necpb_init __P((struct necpb_context *ncp));