1kstat_intr(9S) Data Structures for Drivers kstat_intr(9S)
2
3
4
6 kstat_intr - structure for interrupt kstats
7
9 #include <sys/types.h>
10 #include <sys/kstat.h>
11 #include <sys/ddi.h>
12 #include <sys/sunddi.h>
13
14
16 Solaris DDI specific (Solaris DDI)
17
19 Interrupt statistics are kept in the kstat_intr structure. When
20 kstat_create(9F) creates an interrupt kstat, the ks_data field is a
21 pointer to one of these structures. The macro KSTAT_INTR_PTR() is pro‐
22 vided to retrieve this field. It looks like this:
23
24 #define KSTAT_INTR_PTR(kptr) ((kstat_intr_t *)(kptr)->ks_data)
25
26
27
28 An interrupt is a hard interrupt (sourced from the hardware device
29 itself), a soft interrupt (induced by the system through the use of
30 some system interrupt source), a watchdog interrupt (induced by a peri‐
31 odic timer call), spurious (an interrupt entry point was entered but
32 there was no interrupt to service), or multiple service (an interrupt
33 was detected and serviced just prior to returning from any of the other
34 types).
35
36
37 Drivers generally report only claimed hard interrupts and soft inter‐
38 rupts from their handlers, but measurement of the spurious class of
39 interrupts is useful for auto-vectored devices in order to pinpoint any
40 interrupt latency problems in a particular system configuration.
41
42
43 Devices that have more than one interrupt of the same type should use
44 multiple structures.
45
47 ulong_t intrs[KSTAT_NUM_INTRS]; /* interrupt counters */
48
49
50
51 The only member exposed to drivers is the intrs member. This field is
52 an array of counters. The driver must use the appropriate counter in
53 the array based on the type of interrupt condition.
54
55
56 The following indexes are supported:
57
58 KSTAT_INTR_HARD Hard interrupt
59
60
61 KSTAT_INTR_SOFT Soft interrupt
62
63
64 KSTAT_INTR_WATCHDOG Watchdog interrupt
65
66
67 KSTAT_INTR_SPURIOUS Spurious interrupt
68
69
70 KSTAT_INTR_MULTSVC Multiple service interrupt
71
72
74 kstat(9S)
75
76
77 Writing Device Drivers
78
79
80
81SunOS 5.11 4 Apr 1994 kstat_intr(9S)