There is a task to use C to display information about the modules currently loaded. I do this: I read information from the /proc/modules file. But there was a problem with understanding what was in that file. Here is a snippet:

 v4l2_common 15681 1 videobuf2_core, Live 0x0000000000000000 videodev 153793 3 uvcvideo,videobuf2_core,v4l2_common, Live 0x0000000000000000 media 21903 2 uvcvideo,videodev, Live 0x0000000000000000 rfcomm 69509 8 - Live 0x0000000000000000 bnep 19624 2 - Live 0x0000000000000000 bluetooth 446409 22 btusb,rfcomm,bnep, Live 0x0000000000000000 6lowpan_iphc 18702 1 bluetooth, Live 0x0000000000000000 binfmt_misc 17468 1 - Live 0x0000000000000000 acer_wmi 32522 0 - Live 0x0000000000000000 

I believe that the first is the name ( v4l2_common ), the second is the size (15681). But further is not clear.

Can someone explain?

  • Number of links, dependent modules. further xs what is there for the Live m address, take a look at the kernel source, look - Mike
  • I don't quite understand how to do this, where to look - Vladyslav
  • Well, you can stay on the famous. I personally this Live and addresses do not seem important information. And lsmod doesn’t seem important, it doesn’t display it - Mike
  • see linux / kernel / module.c. The penultimate field may be Live / Loading / Unloading. Last are some module flags. flags may be different in different kernel versions. - Mike

1 answer 1

search query line /proc/modules , the first result .

my free translation (the item number is the column number):

  1. module name
  2. the size (in bytes) occupied by the memory module
  3. the number of loaded instances of the module. zero - module unloaded
  4. the list of modules depending on this one (although the link says, as far as I understand, the opposite)
  5. the current state of the module: Live - loaded, Loading - loading and Unloading - unloaded
  6. the current offset in the linux program memory for which the module is loaded
  • Point 3, in fact - the number of dependent modules. Those. how many modules will have to unload if unload this. - Sergey
  • @Sergey, yes, I know that, and I wrote that. but in the above link, as far as I could understand the non-native English, it seems to be written the opposite - “the list of modules on which this module depends ”. - aleksandr barakin
  • This link reads: "This module is currently loaded." And this is complete nonsense. So I would be wary of this source. I watched the outcomes of the kernel, but I could not immediately find this place. So I will not talk about 100% confidence .. - Sergey