public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* modinfo <modulename> question
@ 2007-09-05 16:34 Justin Piszcz
  2007-09-05 17:09 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Justin Piszcz @ 2007-09-05 16:34 UTC (permalink / raw)
  To: linux-kernel

Is there anyway to get/see what parameters were passed to a kernel module? 
Running modinfo -p <module> will show the defaults, but for example, st, 
the scsi tape driver, is there a way to see what it is currently using? I 
know in dmesg it shows this when you load it initially (but if say dmesg 
has been cleared or the buffer was filled up)?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
  2007-09-05 16:34 modinfo <modulename> question Justin Piszcz
@ 2007-09-05 17:09 ` Randy Dunlap
  2007-09-05 17:17 ` Andreas Schwab
  2007-09-05 19:55 ` Chris Snook
  2 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2007-09-05 17:09 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: linux-kernel

On Wed, 5 Sep 2007 12:34:13 -0400 (EDT) Justin Piszcz wrote:

> Is there anyway to get/see what parameters were passed to a kernel module? 
> Running modinfo -p <module> will show the defaults, but for example, st, 
> the scsi tape driver, is there a way to see what it is currently using? I 
> know in dmesg it shows this when you load it initially (but if say dmesg 
> has been cleared or the buffer was filled up)?

If a "module" (whether built as a loadable module or builtin to the
kernel image) uses module_param() with a permission (or mode) field
that allows reading that parameter, then the parameter will show up
in /sys/module/<module>/parameters/<parameter>.

E.g., drivers/scsi/sg has these parameters listed and are readable
by anyone:

-rw-r--r-- 1 root root 4096 Sep  5 10:07 allow_dio
-rw-r--r-- 1 root root 4096 Sep  5 10:07 def_reserved_size
-rw-r--r-- 1 root root 4096 Sep  5 10:07 scatter_elem_sz

However, the st driver uses 0 for permission (mode), so none of its
parameters is visible.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
  2007-09-05 16:34 modinfo <modulename> question Justin Piszcz
  2007-09-05 17:09 ` Randy Dunlap
@ 2007-09-05 17:17 ` Andreas Schwab
  2007-09-05 17:31   ` Justin Piszcz
  2007-09-05 19:55 ` Chris Snook
  2 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2007-09-05 17:17 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: linux-kernel

Justin Piszcz <jpiszcz@lucidpixels.com> writes:

> Is there anyway to get/see what parameters were passed to a kernel module?

/sys/module/<module>/parameters

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
  2007-09-05 17:17 ` Andreas Schwab
@ 2007-09-05 17:31   ` Justin Piszcz
  2007-09-06 12:03     ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Justin Piszcz @ 2007-09-05 17:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 515 bytes --]



On Wed, 5 Sep 2007, Andreas Schwab wrote:

> Justin Piszcz <jpiszcz@lucidpixels.com> writes:
>
>> Is there anyway to get/see what parameters were passed to a kernel module?
>
> /sys/module/<module>/parameters
>
> Andreas.
>
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>

And under 2.4?

Justin.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
       [not found] <9065c-7jN-17@gated-at.bofh.it>
@ 2007-09-05 18:02 ` Bodo Eggert
  0 siblings, 0 replies; 7+ messages in thread
From: Bodo Eggert @ 2007-09-05 18:02 UTC (permalink / raw)
  To: Justin Piszcz, linux-kernel

Justin Piszcz <jpiszcz@lucidpixels.com> wrote:

> Is there anyway to get/see what parameters were passed to a kernel module?
> Running modinfo -p <module> will show the defaults, but for example, st,
> the scsi tape driver, is there a way to see what it is currently using?

/sys/modules/$NAME/parameters (if it's using the new API)
-- 
It is still called paranoia when they really are out to get you.

Friß, Spammer: uMwxkC@h.7eggert.dyndns.org vTfI21zo@tjJ.7eggert.dyndns.org
 Ugj@SN6Crmm.7eggert.dyndns.org 8nFizbkCwk@-dTgS.7eggert.dyndns.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
  2007-09-05 16:34 modinfo <modulename> question Justin Piszcz
  2007-09-05 17:09 ` Randy Dunlap
  2007-09-05 17:17 ` Andreas Schwab
@ 2007-09-05 19:55 ` Chris Snook
  2 siblings, 0 replies; 7+ messages in thread
From: Chris Snook @ 2007-09-05 19:55 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: linux-kernel

Justin Piszcz wrote:
> Is there anyway to get/see what parameters were passed to a kernel 
> module? Running modinfo -p <module> will show the defaults, but for 
> example, st, the scsi tape driver, is there a way to see what it is 
> currently using? I know in dmesg it shows this when you load it 
> initially (but if say dmesg has been cleared or the buffer was filled up)?

/sys/module/$MODULENAME/parameters/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modinfo <modulename> question
  2007-09-05 17:31   ` Justin Piszcz
@ 2007-09-06 12:03     ` Jan Engelhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2007-09-06 12:03 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: Andreas Schwab, linux-kernel


On Sep 5 2007 13:31, Justin Piszcz wrote:
>>
>> > Is there anyway to get/see what parameters were passed to a kernel 
>> > module?

Not really. Even if a module has parameters exported, they may carry 
default values (and hence, don't fulfill the word "passed", as would be 
the case with `modprobe foo` without {{any extra params} union {params 
in /etc/modprobe*}})

>> /sys/module/<module>/parameters
>
> And under 2.4?

/proc/<module-specific-place>. Generally, even less.



	Jan
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-09-06 12:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-05 16:34 modinfo <modulename> question Justin Piszcz
2007-09-05 17:09 ` Randy Dunlap
2007-09-05 17:17 ` Andreas Schwab
2007-09-05 17:31   ` Justin Piszcz
2007-09-06 12:03     ` Jan Engelhardt
2007-09-05 19:55 ` Chris Snook
     [not found] <9065c-7jN-17@gated-at.bofh.it>
2007-09-05 18:02 ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox