[OpenWrt-Devel] Logging from Ath9k Code

Michal michal.cieslakiewicz at wp.pl
Mon Feb 1 15:12:25 EST 2016


On Mon, 1 Feb 2016 23:23:11 +0530
Nimantha Baranasuriya <nimanthab at gmail.com> wrote:

> Hi Michal,
> 
> Thanks a lot for the info. So if I use ath_info(), the strings will
> get written to a log irrespective of whether I have switched on
> debugging or not, correct? 
>

Correct, it is not affected by debugging options in any way. It's
ath9k's version of generic printk function.

>
> Can I also please know to which log file
> ath_info() would write to and where it is located in the file system?
> 

It is kernel log itself - that you can 'dmesg' or even 'logread'.

Cheers
Michal

> 
> > On 1 Feb 2016, at 11:05 PM, Michal <michal.cieslakiewicz at wp.pl>
> > wrote:
> > 
> > On Mon, 1 Feb 2016 19:58:39 +0530
> > Nimantha Baranasuriya <nimanthab at gmail.com> wrote:
> >   
> >> Hi,
> >> 
> >> I am trying to log the values of some variables in the ath9k driver
> >> code in runtime. There are logging statements like ath_dbg(common,
> >> QUEUE, "qnum: %d, txq_depth:%d\n") but I can't find where these
> >> logs get written. I added printk statements to the code as well but
> >> nothing gets written to dmesg. Can someone please help me to get
> >> this resolved? Basically, my requirement is that I need to write
> >> to any log file like syslog or dmesg from the driver code. Any
> >> tips on getting this done would be very helpful.
> >> 
> >> Thank you in advance,
> >> Nimantha  
> > 
> > Hello Nimantha,
> > 
> > ath_dbg(), defined in drivers/net/wireless/ath/ath.h, works only if
> > ath9k driver debugging is on (CPTCFG_ATH_DEBUG is defined).
> > Otherwise it is an empty function and it is exactly how it works in
> > standard build. I recommend to use similar functions defined there
> > that put information in logs regardless of debug flags, for example
> > ath_info().
> > 
> > Have fun!
> > 
> > Regards
> > Michal  
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list