If I load a kernel module and list the loaded modules with lsmod, I can get the \"use count\" of the module (number of other modules with a reference to the mod
All you get are a list of which modules depend on which other modules (the Used by column in lsmod). You can't write a program to tell why the module was loaded, if it is still needed for anything, or what might break if you unload it and everything that depends on it.