|
|
1.1 root 1: Disk Statistics notes
2:
3: int dk_ndrive = DK_NDRIVE;
4: int dk_busy;
5: long dk_time[DK_NDRIVE];
6: long dk_seek[DK_NDRIVE];
7: long dk_xfer[DK_NDRIVE];
8: long dk_wds[DK_NDRIVE];
9: float dk_mspw[DK_NDRIVE]; // never Used!!!!!!
10: long dk_bps[DK_NDRIVE];
11:
12: SCSI Disk Driver
13:
14: dk_bps[dk] set once, in sdsetbratio. Calculated from values in
15: label (dlp->nsect, dlp->dl_secsize, dlp->rpm)
16: sdstart:
17: dk_busy |= 1 << device;
18: dk_xfer[device]++;
19: dk_seek[device]++;
20: dk_wds[device] += bp->b_bcount >> 6;
21:
22: sdintr:
23: dk_busy &=~ (1 << device);
24:
25: OD driver
26:
27: od_read_label:
28: dk_bps[dk] = l->dl_secsize * l->dl_nsect *
29: l->dl_rpm / 60;
30:
31: od_go:
32: dk_busy |= 1 << dk;
33: dk_xfer[dk]++;
34: dk_wds[dk] += bp->b_bcount >> 6;
35:
36: od_done:
37: dk_busy &= ~(1 << dk);
38:
39: state machine starting seek:
40: dk_seek[dk]++;
41:
42: In gatherstats(), every hardclock (hz times per second?)
43:
44: for (s = 0; s < DK_NDRIVE; s++)
45: if (dk_busy & (1 << s))
46: dk_time[s]++;
47:
48: In mach table() syscall:
49:
50: ti.io_dkbusy = dk_busy;
51: ti.io_ndrive = dk_ndrive; // don't know any better
52:
53: In bsd machine_table() syscall:
54:
55: ti.io_dkbusy = dk_busy;
56: ti.io_ndrive = 0;
57: for (i = 0; bus_dinit[i].bd_driver; i++)
58: if (bus_dinit[i].bd_dk >= 0)
59: ti.io_ndrive++;
60:
61: Proposed IODiskDevice counters (all unsigned int's)
62: readOps
63: bytesRead
64: timeReading
65: writeOps
66: timeWriting
67: bytesWritten
68:
69: methods
70: - (void)startRead;
71: - (void)endRead : (int)bytesTransferred;
72: - (void)startWrite;
73: - (void)endWrite : (int)bytesTransferred;
74:
75: ..also, in kernel, current dk_XXX variables will be supported for a while.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.