svn commit: r297023 - head/sbin/kldstat
Ken Merry
ken at freebsd.org
Tue Jul 19 18:21:19 UTC 2016
> On Mar 18, 2016, at 10:49 AM, Julian Elischer <julian at FreeBSD.org> wrote:
>
> Author: julian
> Date: Fri Mar 18 14:49:11 2016
> New Revision: 297023
> URL: https://svnweb.freebsd.org/changeset/base/297023
>
> Log:
> Add the ability to print out ht emodule specific information in likely formats.
> Among other things this gives us the ability to find outthe syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number.
>
> MFC after: 1 week
> Sponsored by: Panzura inc.
>
> Modified:
> head/sbin/kldstat/kldstat.8
> head/sbin/kldstat/kldstat.c
>
> Modified: head/sbin/kldstat/kldstat.8
> ==============================================================================
> --- head/sbin/kldstat/kldstat.8 Fri Mar 18 13:32:37 2016 (r297022)
> +++ head/sbin/kldstat/kldstat.8 Fri Mar 18 14:49:11 2016 (r297023)
> @@ -36,10 +36,12 @@
> .Op Fl h
> .Op Fl q
> .Op Fl v
> +.Op Fl d
> .Op Fl i Ar id
> .Op Fl n Ar filename
> .Nm
> .Op Fl q
> +.Op Fl d
> .Op Fl m Ar modname
> .Sh DESCRIPTION
> The
> @@ -54,6 +56,8 @@ Display the size field in a human-readab
> instead of hex values.
> .It Fl v
> Be more verbose.
> +.It Fl d
> +Show the module specific data (as int, unsigned int and unsigned long)
> .It Fl i Ar id
> Display the status of only the file with this ID.
> .It Fl n Ar filename
>
> Modified: head/sbin/kldstat/kldstat.c
> ==============================================================================
> --- head/sbin/kldstat/kldstat.c Fri Mar 18 13:32:37 2016 (r297022)
> +++ head/sbin/kldstat/kldstat.c Fri Mar 18 14:49:11 2016 (r297023)
> @@ -36,19 +36,28 @@ __FBSDID("$FreeBSD$");
> #include <sys/param.h>
> #include <sys/module.h>
> #include <sys/linker.h>
> +#include <strings.h>
>
> #define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2))
>
> +static int showdata = 0;
> +
> static void
> printmod(int modid)
> {
> struct module_stat stat;
>
> + bzero(&stat, sizeof(stat));
> stat.version = sizeof(struct module_stat);
> if (modstat(modid, &stat) < 0)
> warn("can't stat module id %d", modid);
> else
> - printf("\t\t%2d %s\n", stat.id, stat.name);
> + if (showdata) {
> + printf("\t\t%2d %s (%d, %u, 0x%lx)\n", stat.id, stat.name,
> + stat.data.intval, stat.data.uintval, stat.data.ulongval);
> + } else {
> + printf("\t\t%2d %s\n", stat.id, stat.name);
> + }
> }
>
> static void
> @@ -88,8 +97,8 @@ printfile(int fileid, int verbose, int h
> static void
> usage(void)
> {
> - fprintf(stderr, "usage: kldstat [-h] [-q] [-v] [-i id] [-n filename]\n");
> - fprintf(stderr, " kldstat [-q] [-m modname]\n");
> + fprintf(stderr, "usage: kldstata[-d] [-h] [-q] [-v] [-i id] [-n filename]\n");
> + fprintf(stderr, " kldstat [-d] [-q] [-m modname]\n”);
Looks like there is a typo in the usage.
Ken
More information about the svn-src-head
mailing list