9

On my 3.10 system some of modules listed in /proc/modules are marked (F). I'd like to find the cause of this (F). I am sure modules were not forcefully loaded and were built with the Kernel. Could you, please point what kernel code creates the /proc/modules?

usb_storage 56610 0 - Live 0xffffffffa005d000 (F)

If I unload and reload back this module the (F) goes away.

Nidal
  • 8,956
  • Besides the code (still looking for that bit) the next best resources I've found so far are these 2: http://unixhelp.ed.ac.uk/CGI/man-cgi?proc+5 & http://www.tldp.org/HOWTO/html_single/Module-HOWTO/. This is somewhat useful too: http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-proc-topfiles.html – slm Aug 28 '14 at 00:51
  • Thanks slm. Your third pointer, in the section referring to /proc/modules explains the sixth column which is the memory offset. It says this info is used by profilers - this is my problem. The profiler silently refuses to work when the module is marked (F). – Stephan T. Aug 28 '14 at 01:28

1 Answers1

11

The columns in the output from /proc/modules are as follows.

usb_storage 56610 0    -   Live 0xffffffffa005d000 (F)
  (1)        (2) (3)  (4)  (5)         (6)         (7)

NOTE: I found no mention of what appears to be the 7th column, but I'm labeling it as such since the descriptions for the 6th column (see below) do not cover the information that's being displayed there.

excerpt - http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-proc-topfiles.html

  • The first column contains the name of the module.
  • The second column refers to the memory size of the module, in bytes.
  • The third column lists how many instances of the module are currently loaded. A value of zero represents an unloaded module.
  • The fourth column states if the module depends upon another module to be present in order to function, and lists those other modules.
  • The fifth column lists what load state the module is in: Live, Loading, or Unloading are the only possible values.
  • The sixth column lists the current kernel memory offset for the loaded module. This information can be useful for debugging purposes, or for profiling tools such as oprofile.

I believe the column that's marked with the (F) (i.e. the 7th column) comes from here in this file -panic.c.

/**
 *  print_tainted - return a string to represent the kernel taint state.
 *
 *  'P' - Proprietary module has been loaded.
 *  'F' - Module has been forcibly loaded.
 *  'S' - SMP with CPUs not designed for SMP.
 *  'R' - User forced a module unload.
 *  'M' - System experienced a machine check exception.
 *  'B' - System has hit bad_page.
 *  'U' - Userspace-defined naughtiness.
 *  'D' - Kernel has oopsed before
 *  'A' - ACPI table overridden.
 *  'W' - Taint on warning.
 *  'C' - modules from drivers/staging are loaded.
 *  'I' - Working around severe firmware bug.
 *  'O' - Out-of-tree module has been loaded.
 *  'E' - Unsigned module has been loaded.
 *
 *  The string is overwritten by the next call to print_tainted().
 */

These codes are a representation for the bitmask that's present in the kernel.txt reference documentation as well.

tainted:

 Non-zero if the kernel has been tainted.  Numeric values, which
 can be ORed together:

    1 - A module with a non-GPL license has been loaded, this
        includes modules with no license.
        Set by modutils >= 2.4.9 and module-init-tools.
    2 - A module was force loaded by insmod -f.
        Set by modutils >= 2.4.9 and module-init-tools.
    4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
    8 - A module was forcibly unloaded from the system by rmmod -f.
   16 - A hardware machine check error occurred on the system.
   32 - A bad page was discovered on the system.
   64 - The user has asked that the system be marked "tainted".  This
        could be because they are running software that directly modifies
        the hardware, or for other reasons.
  128 - The system has died.
  256 - The ACPI DSDT has been overridden with one supplied by the user
         instead of using the one provided by the hardware.
  512 - A kernel warning has occurred.
 1024 - A module from drivers/staging was loaded.
 2048 - The system is working around a severe firmware bug.
 4096 - An out-of-tree module has been loaded.
 8192 - An unsigned module has been loaded in a kernel supporting module
        signature.

References

slm
  • 369,824