Is there a standard way to list the parameter values of a loaded Linux module? I'm essentially probing for another answer to this Linux kernel module parameters question, because the module I'm interested in doesn't have a /sys/modules/<module_name>/parameters
interface.
You can do it by using this simple one way command, which uses the /proc/modules and /sys virtual filesystems:
You will obtain an output like this:
Hope this helps.
You can use the command
systool -vm <Module name>
. It comes with thesysfsutils
package on most systems.This is what the output will look like, there is a section
Parameters
:You could use the "modinfo(8)" command to get available load time parameters for a module. For instance:
As for getting the parameters of loaded modules, try combining the modinfo command with a simple "lsmod | awk '{ print $1 }'"
As in:
Would come out ugly as a comment, but I did this check on my system..
To check if modules without parameters in /sys show up as having parameters in modinfo but I couldnt find any.?I am no expert, but the difference here is that modinfo reads the module file itself for the parameters by looking in the .modinfo elf headers, whereas sys is reading these from its runtime variant.
It may be possible to have parameters you can modify at runtime which dont appear as a modinfo parameter value, but since the module format should be pretty fixed I dont imagine its possible for you to pass a option parameter to a module when loading without there being a .modinfo structure for it linked in.
Does your module suggest there are parameters passable with modinfo when you check it that way but there are none in /sys for it? Certainly on my system I was unable to find any examples of this using the command provided above.EDIT: All this is wrong given that if you do actually check what I did, you'll note that
echo mod $mod | grep parm
will never actually result in a answer.If you do the following instead..
You'll find all sorts of modules that dont contain a
parameters
directory in/sys/module/$mod
but have parameters contained inside of their instances at run time.Inversely, you can also do this:
To find examples of modules that do have a parameters value in
/sys/module/$mod/parameters
but dont have a parameter set inmodinfo
.For iwlwifi and other modules I used this:
and I get this output:
So I guess you could try something like:
Let me know if this works for you.
Working off of katriel's work, you can get a (admittedly ugly) one-liner by combining the two of them in a bash loop: