/* Copyright 1985, Massachusetts Institute of Technology */
* X Unix performance monitor.
static char *rcsid_xperfmon_c
= "$Header: xperfmon.c,v 10.13 86/11/25 18:31:37 jg Rel $";
* Simple graphical performance monitor for system-wide data.
#include <vaxuba/ubavar.h>
#include <vaxmba/mbavar.h>
#include <sundev/mbvar.h>
#ifdef ibm032 /* IBM RT/PC */
#include <caio/ioccvar.h>
#include <tahoevba/vbavar.h>
int input
, output
, collisions
;
static struct packet packets
, old_packets
;
#define NUM_VALS_PER 1000
#define SECS_PER_TIME_TICK 10
static char do_time
[NUM_VALS_PER
];
static struct timeval current_time
, saved_time
;
static struct timezone dummy_zone
;
0xaaaa, 0x5555, 0xaaaa, 0x5555,
0xaaaa, 0x5555, 0xaaaa, 0x5555,
0xaaaa, 0x5555, 0xaaaa, 0x5555,
0xaaaa, 0x5555, 0xaaaa, 0x5555};
* The array stats always has valid info for stats[i], 0 <= i < num_stats.
* For each valid stats[i], stats[i].value[j] is valid for 0 <= j < num_of_val.
* The info for the k-th possible statistic of interest is recorded, if it is
* recorded at all, in stats[possible_stats[k]].
#define USER_CPU_PERCENTAGE 0
#define SYSTEM_CPU_PERCENTAGE 1
#define IDLE_CPU_PERCENTAGE 2
#define COLLISION_PACKETS 8
#define NUM_POSSIBLE_STATS 9
static int possible_stats
[NUM_POSSIBLE_STATS
];
#define WANT_STAT(x) (possible_stats[(x)] != NO_STAT)
#define DEFAULT_BORDER_WIDTH 3
#define DEFAULT_POSITION "=%dx%d-0+0"
static struct statistic stats
[MAX_STATS
];
static struct timeval timeout
= {
static int num_stats
, num_of_val
= 0;
static int graph_x_offset
= 0;
char *font_name
= "6x10";
int background
; /* color of background */
int foreground
; /* color of graph */
int highlight
; /* color of text, scale */
FontInfo
*finfo
; /* font information needed */
#define max(a,b) (a>b ? a:b)
#define FORALLPOSSIBLESTATS(stat)\
for (stat = 0; stat < NUM_POSSIBLE_STATS; stat++)
#define FORALLSTATS(stat) for (stat = 0; stat < num_stats; stat++)
char dr_name
[DK_NDRIVE
][10];
struct forkstat Forkstat
;
#define forkstat s.Forkstat
#define steal(where, var) lseek(mf, where, 0); read(mf, &var, sizeof var);
#define pgtok(a) ((a)*NBPG/1024)
char *options
[NUM_POSSIBLE_STATS
+1] = {
"user", "system", "idle", "free", "disk", "interrupts",
"input", "output", "collision",
short arrow
[]= {0x0000, 0x0020, 0x0070, 0x00f8, 0x01fc, 0x03fe, 0x0070,
0x0070, 0x0070, 0x0070, 0x0070, 0x0070, 0x0070, 0x0000};
short mask
[]= {0x0020, 0x0070, 0x00f8, 0x01fc, 0x03fe, 0x07ff, 0x07ff,
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8};
int Select_mask
, select_mask
= 0;
char *geometry
= NULL
; /* location of window */
int border_width
= DEFAULT_BORDER_WIDTH
;
if ((option
= XGetDefault(argv
[0],"ReverseVideo")) != NULL
)
if (strcmp (option
, "on") == 0)
if ((option
= XGetDefault(argv
[0],"BorderWidth")) != NULL
)
border_width
= atoi(option
);
if ((option
= XGetDefault(argv
[0],"BodyFont")) != NULL
)
if ((border_color
= XGetDefault(argv
[0],"Border")) == NULL
)
border_color
= XGetDefault(argv
[0],"BorderColor");
back_color
= XGetDefault(argv
[0],"Background");
fore_color
= XGetDefault(argv
[0],"Foreground");
high_color
= XGetDefault(argv
[0],"Highlight");
if ((option
= XGetDefault(argv
[0],"Update")) != NULL
)
nintv
= get_namelist("/vmunix", "/dev/kmem");
have_disk
= (total_disk_transfers() ? 1 : 0);
FORALLPOSSIBLESTATS(stat
)
possible_stats
[stat
] = NO_STAT
;
for (i
= 1; i
< argc
; i
++) { /* Parse line */
if (index(argv
[i
], ':') != NULL
) { /* host:display */
strncpy(display
, argv
[i
], sizeof(display
));
if (strcmp(argv
[i
], "-rv") == 0 ||
strcmp(argv
[i
], "-reverse") == 0) { /* black on white */
if (strcmp(argv
[i
], "-fw") == 0 ||
strcmp(argv
[i
], "-forward") == 0) { /* white on black */
if (strcmp(argv
[i
], "-bw") == 0 ||
strcmp(argv
[i
], "-border") == 0) { /* border width */
if (++i
>= argc
) usage();
border_width
= atoi(argv
[i
]);
if (strcmp(argv
[i
], "-fn") == 0 ||
strcmp(argv
[i
], "-font") == 0) { /* host name font */
if (++i
>= argc
) usage();
if (strcmp(argv
[i
], "-bd") == 0 ||
strcmp(argv
[i
], "-color") == 0) { /* border color */
if (++i
>= argc
) usage();
if (strcmp(argv
[i
], "-fg") == 0 ||
strcmp(argv
[i
], "-foreground") == 0) { /* foreground color */
if (++i
>= argc
) usage();
if (strcmp(argv
[i
], "-bg") == 0 ||
strcmp(argv
[i
], "-background") == 0) { /* background color */
if (++i
>= argc
) usage();
if (strcmp(argv
[i
], "-hl") == 0 ||
strcmp(argv
[i
], "-highlight") == 0) { /* highlight color */
if (++i
>= argc
) usage();
if (strcmp(argv
[i
], "-u") == 0 ||
strcmp(argv
[i
], "-update") == 0) { /* update interval */
if (++i
>= argc
) usage();
opt
= getcmd(argv
[i
], options
);
if (opt
>= 0 && opt
< NUM_POSSIBLE_STATS
) {
if (num_stats
== MAX_STATS
) {
"MAX_STATS exceeded, please recompile!\n");
else possible_stats
[opt
] = num_stats
++;
FORALLPOSSIBLESTATS(stat
) {
if ((stat
== DISK_TRANSFERS
) && (have_disk
== 0)) continue;
possible_stats
[stat
] = num_stats
++;
if (num_stats
== MAX_STATS
) break;
have_disk
= 0; /* so max # of packets = 40 */
init_stat(USER_CPU_PERCENTAGE
, 100, "User", " CPU");
init_stat(SYSTEM_CPU_PERCENTAGE
, 100, "System", " CPU");
init_stat(IDLE_CPU_PERCENTAGE
, 100, "Idle", " CPU");
init_stat(FREE_MEM
, pgtok(maxfree
), "Free", " memory");
init_stat(DISK_TRANSFERS
, 40, "Disk", " transfers");
init_stat(INTERRUPTS
, 60, "Interrupts", "");
init_stat(INPUT_PACKETS
, (have_disk
? 20 : 40), "Input", " packets");
init_stat(OUTPUT_PACKETS
, (have_disk
? 20 : 40), "Output", " packets");
init_stat(COLLISION_PACKETS
, 10, "Collision", " packets");
if (border_width
< 0) border_width
= DEFAULT_BORDER_WIDTH
;
timeout
.tv_usec
= (update
- (double)((int)update
)) * 1000000.;
if (!XOpenDisplay (display
)){
fprintf(stderr
, "%s: Can't open display '%s'\n",
argv
[0], XDisplayName(display
));
if ((finfo
= XOpenFont(font_name
)) == NULL
) {
fprintf(stderr
, "Can't load font %s!\n", font_name
);
gethostname(Host
, sizeof (Host
));
s_width
= XStringWidth (stats
[stat
].label
, finfo
, 0, 0);
graph_x_offset
= max(graph_x_offset
, s_width
);
s_width
= XStringWidth (stats
[stat
].label2
, finfo
, 0, 0);
graph_x_offset
= max(graph_x_offset
, s_width
);
if(debug
) fprintf(stderr
, "graph_x_offset=%d\n", graph_x_offset
);
gettimeofday(&saved_time
, &dummy_zone
);
if (border_color
&& DisplayCells() > 2 &&
XParseColor(border_color
, &cdef
) && XGetHardwareColor(&cdef
))
border_pixmap
= XMakeTile(cdef
.pixel
);
else if (border_color
&& strcmp(border_color
, "black") == 0)
border_pixmap
= BlackPixmap
;
else if (border_color
&& strcmp(border_color
, "white") == 0)
border_pixmap
= WhitePixmap
;
border_pixmap
= XMakePixmap (
(Bitmap
) XStoreBitmap (16, 16, gray_bits
),
if (back_color
&& DisplayCells() > 2 &&
XParseColor(back_color
, &cdef
) && XGetHardwareColor(&cdef
)) {
} else if (back_color
&& (strcmp(back_color
, "white") == 0)) {
} else if (back_color
&& (strcmp(back_color
, "black") == 0)) {
if (fore_color
&& DisplayCells() > 2 &&
XParseColor(fore_color
, &cdef
) && XGetHardwareColor(&cdef
)) {
} else if (fore_color
&& (strcmp(fore_color
, "black") == 0)) {
} else if (fore_color
&& (strcmp(fore_color
, "white") == 0)) {
if (high_color
&& DisplayCells() > 2 &&
XParseColor(high_color
, &cdef
) && XGetHardwareColor(&cdef
)) {
win
.bdrwidth
= border_width
;
win
.border
= border_pixmap
;
win
.background
= XMakeTile(background
);
minheight
= (finfo
->height
* 2 + 2) * num_stats
;
minwidth
= graph_x_offset
+ 100;
sprintf(def
, DEFAULT_POSITION
, minwidth
+100,
(finfo
->height
* 3 + 3) * num_stats
);
Win
= XCreate ("Performance Monitor", argv
[0], geometry
, def
, &win
,
cursor
= XCreateCursor (11, 14, arrow
, mask
, 5, 1, 1, 0, GXcopyInverted
);
XDefineCursor (Win
, cursor
);
Select_mask
= 1<<dpyno();
XSelectInput(Win
, KeyPressed
| ExposeWindow
| ExposeCopy
);
select_mask
= Select_mask
;
if(debug
) fprintf(stderr
, "time=[%d,%d]\n",
timeleft
.tv_sec
, timeleft
.tv_usec
);
if ((n
= select(maxplus1
, &select_mask
, NULL
, NULL
, &timeleft
))
fprintf(stderr
,"selected n=%d mask=0x%x, time=[%d,%d]\n",
n
, select_mask
, timeleft
.tv_sec
, timeleft
.tv_usec
);
if (perf_mon_selected (Win
, n
, select_mask
, &timeleft
)
getcmd(to_match
, table
) /* Modified from ucb/lpr/lpc.c */
int found
, index
, nmatches
, longest
;
for (p
= *table
; p
; p
= *(++table
)) {
for (q
= to_match
; *q
== *p
++; q
++)
if (*q
== 0) /* exact match? */
if (!*q
) { /* the to_match was a prefix */
if (q
- to_match
> longest
) {
else if (q
- to_match
== longest
)
init_stat(index
, maxval
, label_1
, label_2
)
index
= possible_stats
[index
];
stats
[index
].max_val
= maxval
;
stats
[index
].label
= label_1
;
stats
[index
].label2
= label_2
;
#define TIMER_EXPIRED(timer) \
(*timer && ((*timer)->tv_sec == 0) && ((*timer)->tv_usec == 0))
int perf_mon_selected(w
, number
, mask
, timer
)
if(number
== 0) { /*timer expired */
int *target
[CPUSTATES
-1], trash
;
for (trash
= 0; trash
< CPUSTATES
-1; trash
++)
if WANT_STAT(USER_CPU_PERCENTAGE
)
&stats
[possible_stats
[USER_CPU_PERCENTAGE
]].value
[num_of_val
];
if WANT_STAT(SYSTEM_CPU_PERCENTAGE
)
&stats
[possible_stats
[SYSTEM_CPU_PERCENTAGE
]].value
[num_of_val
];
if WANT_STAT(IDLE_CPU_PERCENTAGE
)
&stats
[possible_stats
[IDLE_CPU_PERCENTAGE
]].value
[num_of_val
];
stats
[possible_stats
[FREE_MEM
]].value
[num_of_val
] =
if WANT_STAT(DISK_TRANSFERS
)
stats
[possible_stats
[DISK_TRANSFERS
]].value
[num_of_val
] =
stats
[possible_stats
[INTERRUPTS
]].value
[num_of_val
] =
(rate
.v_intr
/nintv
) - hz
;
if WANT_STAT(INPUT_PACKETS
)
stats
[possible_stats
[INPUT_PACKETS
]].value
[num_of_val
] =
packets
.input
- old_packets
.input
;
if WANT_STAT(OUTPUT_PACKETS
)
stats
[possible_stats
[OUTPUT_PACKETS
]].value
[num_of_val
] =
packets
.output
- old_packets
.output
;
if WANT_STAT(COLLISION_PACKETS
)
stats
[possible_stats
[COLLISION_PACKETS
]].value
[num_of_val
] =
packets
.collisions
- old_packets
.collisions
;
gettimeofday(¤t_time
, &dummy_zone
);
if (current_time
.tv_sec
< saved_time
.tv_sec
) {
/* Super-user must have set the clock back */
saved_time
= current_time
;
saved_time
.tv_sec
-= SECS_PER_TIME_TICK
;
if (saved_time
.tv_sec
+SECS_PER_TIME_TICK
<= current_time
.tv_sec
) {
saved_time
= current_time
;
if (mask
& (1 << dpyno())){
XExposeWindowEvent
*exp_event
;
if(!XPending()) return (-1); /* end of file on connection */
if ((key
= mapkey(((XKeyPressedEvent
*)&event
)->detail
)) > 0)
case 'f': /* faster usec timeout */
if (timeout
.tv_usec
>= USEC_INC
)
timeout
.tv_usec
-= USEC_INC
;
if (timeout
.tv_sec
>= SEC_INC
) {
timeout
.tv_sec
-= SEC_INC
;
timeout
.tv_usec
= 1000000-USEC_INC
;
case 's': /* slower usec timeout */
if (timeout
.tv_usec
< 1000000-USEC_INC
)
timeout
.tv_usec
+= USEC_INC
;
case 'F': /* faster sec timeout */
if (timeout
.tv_sec
>= SEC_INC
)
timeout
.tv_sec
-= SEC_INC
;
case 'S': /* slower sec timeout */
timeout
.tv_sec
+= SEC_INC
;
timeout
.tv_sec
= SEC_INC
;
timeout
.tv_usec
= USEC_INC
;
printf("%s\n%s\n%s\n%s\n%s\n%s\n",
"'s' slower usec timeout",
"'f' faster usec timeout",
"'S' slower sec timeout",
"'F' faster sec timeout",
"'R' reset timeout and display",
while (XPending() != 0) {
if (pevent
.type
!= ExposeWindow
) break;
exp_event
= (XExposeWindowEvent
*) &event
;
win
.width
= exp_event
->width
;
win
.height
= exp_event
->height
- 10;
int total_disk_transfers()
register int i
, total_xfers
= 0;
for(i
=0; i
< DK_NDRIVE
; i
++)
total_xfers
+= s
.xfer
[i
];
return(total_xfers
/etime
);
for(i
=0; i
<CPUSTATES
; i
++) {
if (i
== 0) { /* US+NI */
off_t ifnetaddr
= (long)nl
[N_IFNET
].n_value
;
lseek(mf
, (long)nl
[X_CPTIME
].n_value
, 0);
read(mf
, s
.time
, sizeof s
.time
);
lseek(mf
, (long)nl
[X_DKXFER
].n_value
, 0);
read(mf
, s
.xfer
, sizeof s
.xfer
);
steal((long)nl
[X_SUM
].n_value
, rate
);
steal((long)nl
[X_RATE
].n_value
, rate
);
steal((long)nl
[X_TOTAL
].n_value
, total
);
steal((long)nl
[X_SUM
].n_value
, sum
);
steal((long)nl
[X_DEFICIT
].n_value
, deficit
);
for (i
=0; i
< DK_NDRIVE
; i
++) {
for (i
=0; i
< CPUSTATES
; i
++) {
if (nl
[N_IFNET
].n_value
!= 0) {
steal((long)nl
[N_IFNET
].n_value
, ifnetaddr
);
packets
.input
= packets
.output
= packets
.collisions
= 0;
packets
.input
+= ifnet
.if_ipackets
;
packets
.output
+= ifnet
.if_opackets
;
packets
.collisions
+= ifnet
.if_collisions
;
ifnetaddr
= (off_t
) ifnet
.if_next
;
#define YORIGIN_FOR_STAT(num) ((((num)*win.height)/num_stats)+3)
#define YMIDPOINT_FOR_STAT(num) ((((num)*win.height+win.height/2)/num_stats) + 5)
#define Y_FOR_STAT_VAL(stat, num_of_val) \
y_base - min(height_of_stat, ( \
stats[stat].value[num_of_val]-stats[stat].min_val)/( \
stats[stat].max_val-stats[stat].min_val)))
#define First_Point(v, xv, yv) {v->x = xv; v->y = yv;\
v++->flags = VertexDontDraw; }
#define Next_Point(v, xv, yv) {v->x = xv; v->y = yv;\
v++->flags = VertexRelative | VertexDrawLastPoint; }
display_dividers(w
, clear_first
)
register int lwidth
= win
.width
- graph_x_offset
;
if(debug
) fprintf(stderr
, "num_of_val=%d\n", num_of_val
);
register int y_org
= YORIGIN_FOR_STAT(stat
+1);
XPixSet(w
, graph_x_offset
, y_org
-2, lwidth
, 5, background
);
/* Draw the horizontal line and then add the tick marks */
XLine(w
, graph_x_offset
, y_org
, win
.width
, y_org
, 1, 1,
for (i
= 0; i
< num_of_val
; i
++) {
First_Point(vp
, graph_x_offset
+ i
, y_org
- 2);
XDraw(w
, v
, vp
-v
, 1, 1, foreground
, GXcopy
, ~0);
register int height_of_stat
, stat
;
height_of_stat
= YORIGIN_FOR_STAT(1) - YORIGIN_FOR_STAT(0) - 10;
XTextMask (w
, 0, 0, Host
, strlen (Host
), finfo
->id
, highlight
);
register int y_origin_of_stat
= YORIGIN_FOR_STAT(stat
);
XTextMask (w
, 0, YMIDPOINT_FOR_STAT(stat
),
stats
[stat
].label
, strlen (stats
[stat
].label
), finfo
->id
,
XTextMask (w
, 0, YMIDPOINT_FOR_STAT(stat
)+10,
stats
[stat
].label2
, strlen (stats
[stat
].label2
), finfo
->id
,
sprintf(temp
, "%d", stats
[stat
].max_val
);
text_size
= XStringWidth (temp
, finfo
, 0, 0);
XTextMask (w
, graph_x_offset
-5-text_size
, y_origin_of_stat
+5,
temp
, strlen (temp
), finfo
->id
, highlight
);
sprintf(temp
, "%d", stats
[stat
].min_val
);
text_size
= XStringWidth (temp
, finfo
, 0, 0);
XTextMask (w
, graph_x_offset
-5-text_size
,
y_origin_of_stat
-1+height_of_stat
, temp
, strlen (temp
),
if (num_of_val
> 0) FORALLSTATS(stat
)
redisplay_stat_values(w
, height_of_stat
, stat
, num_of_val
);
redisplay_stat_values(w
, height_of_stat
, stat
, stop_plus_one
)
int height_of_stat
, stat
, stop_plus_one
;
int y_base
= YORIGIN_FOR_STAT(stat
+1)-5;
newY
= Y_FOR_STAT_VAL(stat
, 0);
First_Point(vp
, graph_x_offset
, newY
);
for (j
= 1; j
< stop_plus_one
; ) {
register int npts
= 0, oldY
= newY
;
newY
= Y_FOR_STAT_VAL(stat
, j
);
while ((oldY
== newY
) && (j
< stop_plus_one
));
Next_Point(vp
, 1, newY
- oldY
);
XDraw(w
, v
, vp
-v
, 1, 1, foreground
, GXcopy
, ~0);
int stat
, height_of_stat
, redisp
= 0;
height_of_stat
= YORIGIN_FOR_STAT(1) - YORIGIN_FOR_STAT(0) - 10;
int y_base
= YORIGIN_FOR_STAT(stat
+1)-5;
newY
= Y_FOR_STAT_VAL(stat
, num_of_val
);
oldY
= Y_FOR_STAT_VAL(stat
, num_of_val
-1);
XLine(w
, graph_x_offset
+num_of_val
, oldY
,
graph_x_offset
+num_of_val
+1, newY
, 1, 1, foreground
,
if (do_time
[num_of_val
]) {
XLine(w
, graph_x_offset
+num_of_val
, y_base
-2,
graph_x_offset
+num_of_val
, y_base
+2,
1, 1, foreground
, GXcopy
, ~0);
if (++num_of_val
>= NUM_VALS_PER
||
num_of_val
>= win
.width
-graph_x_offset
) {
int num_shift_left
= (win
.width
-graph_x_offset
)/2;
int width
= (win
.width
-graph_x_offset
) - num_shift_left
;
for (j
= num_shift_left
; j
< num_of_val
; j
++)
do_time
[j
-num_shift_left
] = do_time
[j
];
register int ys
= YORIGIN_FOR_STAT(stat
)+5, nmax
= 1, t
;
for (j
= num_shift_left
; j
< num_of_val
; j
++) {
t
= stats
[stat
].value
[j
-num_shift_left
] =
nmax
= nmax
> t
? nmax
: t
;
if (stat
>= FREE_MEM
&& stat
< COLLISION_PACKETS
&& nmax
!= stats
[stat
].max_val
) {
stats
[stat
].max_val
= nmax
;
XMoveArea(w
, graph_x_offset
+num_shift_left
,
ys
, graph_x_offset
, ys
, width
, height_of_stat
+2);
XPixSet(w
, graph_x_offset
+num_shift_left
,
ys
, width
, height_of_stat
+2, background
);
num_of_val
-= num_shift_left
+1;
int get_namelist(kernel_name
, memory_name
)
char *kernel_name
, *memory_name
;
fprintf(stderr
, "no %s namelist\n", kernel_name
);
mf
= open(memory_name
, 0);
fprintf(stderr
, "cannot open %s\n", memory_name
);
steal((long)nl
[X_MAXFREE
].n_value
, maxfree
);
steal((long)nl
[X_BOOTTIME
].n_value
, boottime
);
steal((long)nl
[X_HZ
].n_value
, hz
);
for (i
= 0; i
< DK_NDRIVE
; i
++) {
strcpy(dr_name
[i
], "xx");
if (nintv
<= 0 || nintv
> 60*60*24*365*10) {
"Time makes no sense... namelist must be wrong.\n");
for(i
=0; i
<CPUSTATES
; i
++)
return(s
.time
[row
]*100./t
);
register struct mba_device
*mp
;
char *cp
= (char *) &two_char
;
struct uba_device udev
, *up
;
mp
= (struct mba_device
*) nl
[X_MBDINIT
].n_value
;
up
= (struct uba_device
*) nl
[X_UBDINIT
].n_value
;
fprintf(stderr
, "perfmon: Disk init info not in namelist\n");
if (mdev
.mi_dk
< 0 || mdev
.mi_alive
== 0)
steal(mdev
.mi_driver
, mdrv
);
steal(mdrv
.md_dname
, two_char
);
sprintf(dr_name
[mdev
.mi_dk
], "%c%c", cp
[0], cp
[1]);
dr_unit
[mdev
.mi_dk
] = mdev
.mi_unit
;
if (udev
.ui_dk
< 0 || udev
.ui_alive
== 0)
steal(udev
.ui_driver
, udrv
);
steal(udrv
.ud_dname
, two_char
);
sprintf(dr_name
[udev
.ui_dk
], "%c%c", cp
[0], cp
[1]);
dr_unit
[udev
.ui_dk
] = udev
.ui_unit
;
register struct mb_device
*mp
;
char *cp
= (char *) &two_char
;
mp
= (struct mb_device
*) nl
[X_MBDINIT
].n_value
;
fprintf(stderr
, "vmstat: Disk init info not in namelist\n");
if (mdev
.md_dk
< 0 || mdev
.md_alive
== 0)
steal(mdev
.md_driver
, mdrv
);
steal(mdrv
.mdr_dname
, two_char
);
sprintf(dr_name
[mdev
.md_dk
], "%c%c", cp
[0], cp
[1]);
dr_unit
[mdev
.md_dk
] = mdev
.md_unit
;
register struct iocc_device
*mp
;
char *cp
= (char *) &two_char
;
mp
= (struct iocc_device
*) nl
[X_IOCINIT
].n_value
;
fprintf(stderr
, "vmstat: Disk init info not in namelist\n");
if (mdev
.iod_driver
== 0)
if (mdev
.iod_dk
< 0 || mdev
.iod_alive
== 0)
steal(mdev
.iod_driver
, mdrv
);
steal(mdrv
.idr_dname
, two_char
);
sprintf(dr_name
[mdev
.iod_dk
], "%c%c", cp
[0], cp
[1]);
dr_unit
[mdev
.iod_dk
] = mdev
.iod_unit
;
struct vba_device udev
, *up
;
char *cp
= (char *)&two_char
;
up
= (struct vba_device
*) nl
[X_VBDINIT
].n_value
;
fprintf(stderr
, "vmstat: Disk init info not in namelist\n");
if (udev
.ui_dk
< 0 || udev
.ui_alive
== 0)
steal(udev
.ui_driver
, udrv
);
steal(udrv
.ud_dname
, two_char
);
sprintf(dr_name
[udev
.ui_dk
], "%c%c%d",
cp
[0], cp
[1], udev
.ui_unit
);
"Usage: xperfmon [host:display] option option .....\n");