1
2
3
4
5
6
7
8
9
10
11
12
13
14 package procfs
15
16 import "testing"
17
18 func TestSoftirqs(t *testing.T) {
19 s, err := getProcFixtures(t).Softirqs()
20 if err != nil {
21 t.Fatal(err)
22 }
23
24
25 if want, have := uint64(3), s.Hi[0]; want != have {
26 t.Errorf("want softirq HI count %d, have %d", want, have)
27 }
28
29 if want, have := uint64(247490), s.Timer[1]; want != have {
30 t.Errorf("want softirq TIMER count %d, have %d", want, have)
31 }
32
33 if want, have := uint64(2419), s.NetTx[0]; want != have {
34 t.Errorf("want softirq NET_TX count %d, have %d", want, have)
35 }
36
37 if want, have := uint64(28694), s.NetRx[1]; want != have {
38 t.Errorf("want softirq NET_RX count %d, have %d", want, have)
39 }
40
41 if want, have := uint64(262755), s.Block[1]; want != have {
42 t.Errorf("want softirq BLOCK count %d, have %d", want, have)
43 }
44
45 if want, have := uint64(0), s.IRQPoll[0]; want != have {
46 t.Errorf("want softirq IRQ_POLL count %d, have %d", want, have)
47 }
48
49 if want, have := uint64(209), s.Tasklet[0]; want != have {
50 t.Errorf("want softirq TASKLET count %d, have %d", want, have)
51 }
52
53 if want, have := uint64(2278692), s.Sched[0]; want != have {
54 t.Errorf("want softirq SCHED count %d, have %d", want, have)
55 }
56
57 if want, have := uint64(1281), s.HRTimer[0]; want != have {
58 t.Errorf("want softirq HRTIMER count %d, have %d", want, have)
59 }
60
61 if want, have := uint64(532783), s.RCU[1]; want != have {
62 t.Errorf("want softirq RCU count %d, have %d", want, have)
63 }
64 }
65
View as plain text