Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Nov 2011 21:11:58 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Adarsh Joshi <adarsh.joshi@qlogic.com>
Cc:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   Re: Is it possible to change the log level of a device driver at runtime?
Message-ID:  <20111104041157.GG25601@funkthat.com>
In-Reply-To: <5E4F49720D0BAD499EE1F01232234BA873C6F1A540@AVEXMB1.qlogic.org>
References:  <5E4F49720D0BAD499EE1F01232234BA873C6F1A523@AVEXMB1.qlogic.org> <20111103183637.GD25601@funkthat.com> <5E4F49720D0BAD499EE1F01232234BA873C6F1A540@AVEXMB1.qlogic.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Adarsh Joshi wrote this message on Thu, Nov 03, 2011 at 11:42 -0700:
> The driver is not yet in the tree.
> 
> I am trying to implement the change of debug level at run time. Can you kindly explain how do I do it? ( by setting the sysctl as you mentioned)

There are two different ways...  If you want it to apply to all
instances of your driver, take a look at the SYSCTL(9) manpage...
You'll probably want to use SYSCTL_INT...

If you want it to be on a per device basis, you can use
device_get_sysctl_ctx to get the sysctl context for your driver, and
use SYSCTL_ADD_xxx w/ that context...

If you need to have it set at boot time, include a TUNABLE_INT...

Hope this helps!  And take a look at how other drivers do it... A
driver like sys/dev/e1000/if_em.c has some good examples...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111104041157.GG25601>