Module Name:    src
Committed By:   christos
Date:           Wed Nov  4 16:04:55 UTC 2015

Modified Files:
        src/sbin/modstat: main.c modstat.8

Log Message:
print flags symbolically.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/modstat/main.c
cvs rdiff -u -r1.16 -r1.17 src/sbin/modstat/modstat.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/modstat/main.c
diff -u src/sbin/modstat/main.c:1.19 src/sbin/modstat/main.c:1.20
--- src/sbin/modstat/main.c:1.19	Tue Nov  3 23:30:42 2015
+++ src/sbin/modstat/main.c	Wed Nov  4 11:04:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.19 2015/11/04 04:30:42 pgoyette Exp $	*/
+/*	$NetBSD: main.c,v 1.20 2015/11/04 16:04:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.19 2015/11/04 04:30:42 pgoyette Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2015/11/04 16:04:55 christos Exp $");
 #endif /* !lint */
 
 #include <sys/module.h>
@@ -65,6 +65,10 @@ static const char *sources[] = {
 };
 const unsigned int source_max = __arraycount(sources);
 
+static const char *modflags[] = {
+	"-", "f", "a", "af"
+};
+
 int
 main(int argc, char **argv)
 {
@@ -175,8 +179,8 @@ main(int argc, char **argv)
 		if (maxnamelen < namelen)
 			maxnamelen = namelen;
 	}
-	printf("%-*s %-8s %-8s %-6s %-5s %-16s %-7s %s \n",
-	    (int)maxnamelen, "NAME", "CLASS", "SOURCE", "FLAGS", "REFS",
+	printf("%-*s %-8s %-8s %-4s %-5s %-16s %-7s %s \n",
+	    (int)maxnamelen, "NAME", "CLASS", "SOURCE", "FLAG", "REFS",
 	    "ADDRESS", "SIZE", "REQUIRES");
 	for (ms = iov.iov_base; len != 0; ms++, len--) {
 		const char *class;
@@ -204,8 +208,9 @@ main(int argc, char **argv)
 		else
 			source = "UNKNOWN";
 
-		printf("%-*s %-8s %-8s 0x%-4x %-5d %-16" PRIx64 " %-7s %s\n",
-		    (int)maxnamelen, ms->ms_name, class, source, ms->ms_flags,
+		printf("%-*s %-8s %-8s %-4s %-5d %-16" PRIx64 " %-7s %s\n",
+		    (int)maxnamelen, ms->ms_name, class, source, 
+		    modflags[ms->ms_flags & (__arraycount(modflags) - 1)],
 		    ms->ms_refcnt, ms->ms_addr, sbuf, ms->ms_required);
 	}
 

Index: src/sbin/modstat/modstat.8
diff -u src/sbin/modstat/modstat.8:1.16 src/sbin/modstat/modstat.8:1.17
--- src/sbin/modstat/modstat.8:1.16	Tue Nov  3 23:30:42 2015
+++ src/sbin/modstat/modstat.8	Wed Nov  4 11:04:55 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: modstat.8,v 1.16 2015/11/04 04:30:42 pgoyette Exp $
+.\" $NetBSD: modstat.8,v 1.17 2015/11/04 16:04:55 christos Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -89,11 +89,18 @@ indicates that the module was loaded dur
 indicates that the module was loaded from the file system.
 .It Li SIZE
 Size of the module in bytes.
-.It Li FLAGS
-The module's flags.
-See
-.Xr modctl 2
-for details.
+.It Li FLAG
+The module flags:
+.Bl -tag -width a -offset indent -compact
+.It Dv a
+Module is auto-loaded.
+.It Dv f
+Required the
+.Xr modctl 8
+flag
+.Fl f
+(force) to be loaded.
+.El
 .It Li REFS
 Number of references held on the module.
 Disabled builtin modules will show a count of \-1 here.

Reply via email to