Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

modinfo(8)

Name

modinfo - display information about loaded kernel modules

Synopsis

/usr/sbin/modinfo [-aw] [-c | [-i module] [-pP] 
[-o field[,...]]]

Description

The modinfo utility displays information about the loaded modules. The format of the information is as follows:

ID LOADADDR SIZE INFO REV NAMEDESC

where ID is the decimal module Id, LOADADDR is the starting text address in hexadecimal for privileged users but '--' for unprivileged users. SIZE is the size of text, data, and bss in hexadecimal bytes, INFO is module specific information, REV is the revision of the loadable modules system, and NAMEDESC is the filename and description of the module.

The module specific information is the block and character major numbers for drivers, the system call number for system calls, and unspecified for other module types.

Options

The following options are supported:

–c

Displays the number of times the module was loaded and the module's current state. This option includes –a and cannot be used with –i, –o , –p, or –P.

–i module

Displays information about the specified module only. If 'module' starts with a digit then it is interpreted as a decimal module Id, otherwise it is interpreted as a module name. A decimal module Id may change across a reboot.

–o field[,...]

A case-insensitive, comma-separated list of output fields to display. The field name must be one of the fields listed below, or the special value all to display all fields. The following fields are supported: id, loadaddr, size, info, rev, path, name, desc, namedesc, loadcnt, state, all. For a loaded module, 'path' is the actual path that the kernel used when loading the module is displayed. For a module that is not loaded the path that the kernel would use to load the module is derived. Output may not match the binding which occurs if software is added or removed from the system. Such changes may cause a different path to be used when the module is next loaded. If modinfo(8) is unable to determine where the module would be loaded from, it prints a question mark in front of the path. This option implicitly includes –w.

–p

Displays using a stable machine-parsable format. The –o option is required with this option. See "Parsable Output Format" below.

–P

Only displays the path and header information. It's a alias for '-p -o path'.

–a

Displays information for all modules, including ones not currently loaded.

–w

Do not truncate module information at 80 characters.

Parseable Output Format

If more then one fields are inputed, output format is one or more lines of colon (:) delimited fields. Output includes only those fields requested by means of the –o option, in the order requested, When you request multiple fields, any literal colon characters are escaped by a backslash (\) before being output. Similarly, literal backslash characters are also escaped (\\). This escape format is parsable by using shell read(1) functions with the environment variable set as IFS=:.

Note that escaping is not done when you request only a single field.

Examples

Example 1 Displaying the Status of a Module

The following example displays the status of module 3:

example% modinfo -i 3
 
ID  LOADADDR         SIZE   INFO REV NAMEDESC
3   fffffffffbdcf000 7410   1    1   specfs (filesystem for specfs)
example% modinfo -i specfs
 
ID  LOADADDR         SIZE   INFO REV NAMEDESC
3   fffffffffbdcf000 7410   1    1   specfs (filesystem for specfs)
Example 2 Displaying the Status of Kernel Modules

The following example displays the status of some kernel modules:

example% modinfo

ID  LOADADDR         SIZE   INFO REV NAMEDESC
0   fffffffffb800000 3b3cb4 --   0   unix () 
1   fffffffffb9f8208 43e068 --   0   genunix ()
3   fffffffffbdcf000 7410   1    1   specfs (filesystem for specfs)
4   fffffffffbdd6370 5d80   3    1   fifofs (filesystem for fifo)
5   fffffffff80b4000 267c8  53   1   dtrace (Dynamic Tracing)
6   fffffffffbddc038 9608   16   1   devfs (devices filesystem)
7   fffffffffbde53f0 21830  17   1   dev (/dev filesystem)
8   fffffffffbe064e8 8078   --   1   dls (Data-Link Services)
9   fffffffffbe0e248 4c908  --   1   mac (MAC Services)
10  fffffffffbe59968 25c20  5    1   procfs (filesystem for proc)
Example 3 Using the –c Option

Using the modinfo command with the –c option displays the number of instances of the module loaded and the module's current state.

example% modinfo -c
   
ID  LOADCNT NAME                    STATE
0   1       unix                    LOADED/INSTALLED
1   1       genunix                 LOADED/INSTALLED
2   0       cl_bootstrap            UNLOADED/UNINSTALLED
3   1       specfs                  LOADED/INSTALLED
4   1       fifofs                  LOADED/INSTALLED
5   1       dtrace                  LOADED/INSTALLED
6   1       devfs                   LOADED/INSTALLED
7   1       dev                     LOADED/INSTALLED
8   1       dls                     LOADED/INSTALLED
9   1       mac                     LOADED/INSTALLED
10  1       procfs                  LOADED/INSTALLED
11  0       lbl_edition             UNLOADED/UNINSTALLED
Example 4 Using the –o and –p Options

Using the modinfo command with the –o and –p option displays user-specified fields and in machine-parsable format.

example% modinfo -o id,desc,path -i specfs
ID  DESC                            PATH
3   filesystem for specfs           /kernel/fs/amd64/specfs
example% modinfo -o id,desc,path -i specfs -p
3:filesystem for specfs:/kernel/fs/amd64/specfs

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

See Also

attributes(7), modload(8), modunload(8)