extern unsigned int flags;
extern unsigned int dm_major;
extern struct sa_dlist *st_iface_list;
+extern struct sa_dlist *st_dev_list;
extern int dlst_iface_idx;
+extern int dlst_dev_idx;
/*
***************************************************************************
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
}
- /* Compute extended statistics values */
- compute_ext_disk_stats(sdc, sdp, itv, &xds);
-
dev_name = NULL;
persist_dev_name = NULL;
}
}
+ if (dlst_dev_idx) {
+ /* A list of devices has been entered on the command line */
+ if (!search_sa_dlist(st_dev_list, dlst_dev_idx, dev_name))
+ /* Device not found */
+ continue;
+ }
+
+ /* Compute extended statistics values */
+ compute_ext_disk_stats(sdc, sdp, itv, &xds);
+
if (sep) {
printf(",\n");
}
extern unsigned int flags;
extern unsigned int dm_major;
extern struct sa_dlist *st_iface_list;
+extern struct sa_dlist *st_dev_list;
extern int dlst_iface_idx;
+extern int dlst_dev_idx;
/*
***************************************************************************
sdc = (struct stats_disk *) ((char *) a->buf[curr] + i * a->msize);
- printf("%s; major; %u; minor; %u; %s",
- timestr, sdc->major, sdc->minor, pfield(a->hdr_line, FIRST));
-
- j = check_disk_reg(a, curr, !curr, i);
- if (j < 0) {
- /* This is a newly registered interface. Previous stats are zero */
- sdp = &sdpzero;
- if (DISPLAY_DEBUG_MODE(flags)) {
- printf(" [%s]", j == -1 ? "NEW" : "BCK");
- }
- }
- else {
- sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
- }
-
dev_name = NULL;
persist_dev_name = NULL;
}
}
+ if (dlst_dev_idx) {
+ /* A list of devices has been entered on the command line */
+ if (!search_sa_dlist(st_dev_list, dlst_dev_idx, dev_name))
+ /* Device not found */
+ continue;
+ }
+
+ printf("%s; major; %u; minor; %u; %s",
+ timestr, sdc->major, sdc->minor, pfield(a->hdr_line, FIRST));
+
+ j = check_disk_reg(a, curr, !curr, i);
+ if (j < 0) {
+ /* This is a newly registered interface. Previous stats are zero */
+ sdp = &sdpzero;
+ if (DISPLAY_DEBUG_MODE(flags)) {
+ printf(" [%s]", j == -1 ? "NEW" : "BCK");
+ }
+ }
+ else {
+ sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
+ }
+
printf("; %s;", dev_name);
printf(" %s", pfield(NULL, 0));
pval(sdp->nr_ios, sdc->nr_ios);
extern unsigned int flags;
extern unsigned int dm_major;
extern struct sa_dlist *st_iface_list;
+extern struct sa_dlist *st_dev_list;
extern int dlst_iface_idx;
+extern int dlst_dev_idx;
/*
***************************************************************************
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
}
- /* Compute extended stats (service time, etc.) */
- compute_ext_disk_stats(sdc, sdp, itv, &xds);
-
dev_name = NULL;
persist_dev_name = NULL;
}
}
+ if (dlst_dev_idx) {
+ /* A list of devices has been entered on the command line */
+ if (!search_sa_dlist(st_dev_list, dlst_dev_idx, dev_name))
+ /* Device not found */
+ continue;
+ }
+
+ /* Compute extended stats (service time, etc.) */
+ compute_ext_disk_stats(sdc, sdp, itv, &xds);
+
render(isdb, pre, PT_NOFLAG,
"%s\ttps", "%s",
cons(sv, dev_name, NULL),
char *args[MAX_ARGV_NR];
/* Devices entered on the command line */
-struct sa_dlist *st_iface_list = NULL;
-int dlst_iface_idx = 0;
+struct sa_dlist *st_iface_list = NULL, *st_dev_list = NULL;
+int dlst_iface_idx = 0, dlst_dev_idx = 0;
extern struct activity *act[];
extern struct report_format *fmt[];
fprintf(stderr, _("Options are:\n"
"[ -C ] [ -c | -d | -g | -j | -p | -r | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ]\n"
"[ -O <opts> [,...] ] [ -P { <cpu> [,...] | ALL } ]\n"
- "[ --iface=<iface_list> ] [ -s [ <hh:mm[:ss]> ] ] [ -e [ <hh:mm[:ss]> ] ]\n"
+ "[ --dev=<dev_list> ] [ --iface=<iface_list> ]\n"
+ "[ -s [ <hh:mm[:ss]> ] ] [ -e [ <hh:mm[:ss]> ] ]\n"
"[ -- <sar_options> ]\n"));
exit(1);
}
}
}
+ else if (!strncmp(argv[opt], "--dev=", 6)) {
+ /* Parse devices entered on the command line */
+ parse_sa_devices(argc, argv, &st_dev_list,
+ &dlst_dev_idx, &opt, 6);
+ }
+
else if (!strncmp(argv[opt], "--iface=", 8)) {
/* Parse devices entered on the command line */
parse_sa_devices(argc, argv, &st_iface_list,
extern unsigned int flags;
extern unsigned int dm_major;
extern struct sa_dlist *st_iface_list;
+extern struct sa_dlist *st_dev_list;
extern int dlst_iface_idx;
+extern int dlst_dev_idx;
unsigned int svg_colors[] = {0x00cc00, 0xff00bf, 0x00ffff, 0xff0000,
0xe85f00, 0x0000ff, 0x006020, 0x7030a0,
}
}
+ if (dlst_dev_idx) {
+ /* A list of devices has been entered on the command line */
+ if (!search_sa_dlist(st_dev_list, dlst_dev_idx, item_name))
+ /* Device not found */
+ continue;
+ }
+
draw_activity_graphs(a->g_nr, g_type,
title, g_title, item_name, group,
spmin + pos, spmax + pos, out + pos, outsize + pos,
extern unsigned int flags;
extern unsigned int dm_major;
extern struct sa_dlist *st_iface_list;
+extern struct sa_dlist *st_dev_list;
extern int dlst_iface_idx;
+extern int dlst_dev_idx;
/*
***************************************************************************
sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
}
- /* Compute extended statistics values */
- compute_ext_disk_stats(sdc, sdp, itv, &xds);
-
dev_name = NULL;
persist_dev_name = NULL;
}
}
+ if (dlst_dev_idx) {
+ /* A list of devices has been entered on the command line */
+ if (!search_sa_dlist(st_dev_list, dlst_dev_idx, dev_name))
+ /* Device not found */
+ continue;
+ }
+
+ /* Compute extended statistics values */
+ compute_ext_disk_stats(sdc, sdp, itv, &xds);
+
xprintf(tab, "<disk-device dev=\"%s\" "
"tps=\"%.2f\" "
"rd_sec=\"%.2f\" "