o Don't print devices that aren't attached unless run with the newly
minted -v flag. o Print devices that don't return a name as 'unknown' in -v mode. # Yea! Now I wont think I have 10 different ISA network adapters in my # laptop.
This commit is contained in:
parent
43832002d3
commit
7f156483af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103663
@ -35,7 +35,7 @@
|
|||||||
.Nd print information about system device configuration
|
.Nd print information about system device configuration
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl ru
|
.Op Fl ruv
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
@ -56,6 +56,10 @@ but sorts by resource type rather than by device, allowing to review the
|
|||||||
set of system resources by usage and available resources.
|
set of system resources by usage and available resources.
|
||||||
I.e., it lists all
|
I.e., it lists all
|
||||||
the IRQ consumers together.
|
the IRQ consumers together.
|
||||||
|
.It Fl v
|
||||||
|
Display all devices in the driver tree, not just those that are attached or
|
||||||
|
busy.
|
||||||
|
Without this flag, only those devices that have attached are reported.
|
||||||
.El
|
.El
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr systat 1 ,
|
.Xr systat 1 ,
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "devinfo.h"
|
#include "devinfo.h"
|
||||||
|
|
||||||
int rflag;
|
int rflag;
|
||||||
|
int vflag;
|
||||||
|
|
||||||
static void print_resource(struct devinfo_res *);
|
static void print_resource(struct devinfo_res *);
|
||||||
static int print_device_matching_resource(struct devinfo_res *, void *);
|
static int print_device_matching_resource(struct devinfo_res *, void *);
|
||||||
@ -136,11 +137,11 @@ print_device(struct devinfo_dev *dev, void *arg)
|
|||||||
struct indent_arg ia;
|
struct indent_arg ia;
|
||||||
int i, indent;
|
int i, indent;
|
||||||
|
|
||||||
if (dev->dd_name[0] != 0) {
|
if (vflag || (dev->dd_name[0] != 0 && dev->dd_state >= DIS_ATTACHED)) {
|
||||||
indent = (int)(intptr_t)arg;
|
indent = (int)(intptr_t)arg;
|
||||||
for (i = 0; i < indent; i++)
|
for (i = 0; i < indent; i++)
|
||||||
printf(" ");
|
printf(" ");
|
||||||
printf("%s\n", dev->dd_name);
|
printf("%s\n", dev->dd_name[0] ? dev->dd_name : "unknown");
|
||||||
if (rflag) {
|
if (rflag) {
|
||||||
ia.indent = indent + 4;
|
ia.indent = indent + 4;
|
||||||
ia.arg = dev;
|
ia.arg = dev;
|
||||||
@ -191,7 +192,7 @@ main(int argc, char *argv[])
|
|||||||
int c, uflag;
|
int c, uflag;
|
||||||
|
|
||||||
uflag = 0;
|
uflag = 0;
|
||||||
while ((c = getopt(argc, argv, "ru")) != -1) {
|
while ((c = getopt(argc, argv, "ruv")) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'r':
|
case 'r':
|
||||||
rflag++;
|
rflag++;
|
||||||
@ -199,8 +200,11 @@ main(int argc, char *argv[])
|
|||||||
case 'u':
|
case 'u':
|
||||||
uflag++;
|
uflag++;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
vflag++;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
errx(1, "usage: %s [-ru]", argv[0]);
|
errx(1, "usage: %s [-ruv]", argv[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user