Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/systat/devs.c
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "systat.h" | #include "systat.h" | ||||
#include "extern.h" | #include "extern.h" | ||||
#include "devs.h" | |||||
typedef enum { | typedef enum { | ||||
DS_MATCHTYPE_NONE, | DS_MATCHTYPE_NONE, | ||||
DS_MATCHTYPE_SPEC, | DS_MATCHTYPE_SPEC, | ||||
DS_MATCHTYPE_PATTERN | DS_MATCHTYPE_PATTERN | ||||
} last_match_type; | } last_match_type; | ||||
struct statinfo cur_dev, last_dev, run_dev; | struct statinfo cur_dev, last_dev, run_dev; | ||||
▲ Show 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) | ||||
lc = diskcol + lc * 6; | lc = diskcol + lc * 6; | ||||
putlongdouble(kb_per_transfer, diskrow + 1, lc, 5, 2, 0); | putlongdouble(kb_per_transfer, diskrow + 1, lc, 5, 2, 0); | ||||
putlongdouble(transfers_per_second, diskrow + 2, lc, 5, 0, 0); | putlongdouble(transfers_per_second, diskrow + 2, lc, 5, 0, 0); | ||||
putlongdouble(mb_per_second, diskrow + 3, lc, 5, 2, 0); | putlongdouble(mb_per_second, diskrow + 3, lc, 5, 2, 0); | ||||
putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); | putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); | ||||
} | } | ||||
static void | |||||
dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) | |||||
{ | |||||
dsshow2(diskcol, diskrow, dn, lc, now, then); | |||||
} | |||||
void | void | ||||
dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) | dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) | ||||
{ | { | ||||
int i, lc; | int i, lc; | ||||
for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) | for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) | ||||
if (dev_select[i].selected) | if (dev_select[i].selected) | ||||
dsshow3(diskcol, diskrow, i, ++lc, now, then); | dsshow2(diskcol, diskrow, i, ++lc, now, then); | ||||
} | } |