lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Jul 2014 13:24:35 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Michalis Pappas <mpappas@...tmail.fm>
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: conditionally compile debug code

On Wed, Jul 09, 2014 at 08:52:07PM +0100, Michalis Pappas wrote:
> On 07/09/2014 07:51 PM, Greg KH wrote:
> > On Tue, Jul 01, 2014 at 02:00:15PM +0100, Michalis Pappas wrote:
> >> Signed-off-by: Michalis Pappas <mpappas@...tmail.fm>
> >> ---
> >>  drivers/staging/gdm72xx/gdm_qos.c   | 2 ++
> >>  drivers/staging/gdm72xx/gdm_sdio.c  | 7 +++++++
> >>  drivers/staging/gdm72xx/gdm_usb.c   | 7 +++++++
> >>  drivers/staging/gdm72xx/gdm_wimax.c | 6 ++++++
> >>  drivers/staging/gdm72xx/gdm_wimax.h | 2 ++
> >>  5 files changed, 24 insertions(+)
> >>
> >> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
> >> index b08c8e1..7900981 100644
> >> --- a/drivers/staging/gdm72xx/gdm_qos.c
> >> +++ b/drivers/staging/gdm72xx/gdm_qos.c
> >> @@ -88,7 +88,9 @@ static void free_qos_entry_list(struct list_head *free_list)
> >>  		total_free++;
> >>  	}
> >>  
> >> +	#if defined(GDM72xx_DEBUG)
> >>  	pr_debug("%s: total_free_cnt=%d\n", __func__, total_free);
> >> +	#endif
> > 
> > Ick, no, never put #ifdef in .c code if you can help it.  For stuff like
> > this, just rely on the dynamic debug core and use the pr_debug and
> > dev_dbg() calls, like the driver is doing, so all should be fine.
> >
> 
> But how about those cases where debug code consists of more than a
> simple call to pr_debug() / dev_dbg()?

Then that code is wrong :)

> For instance consider dump_eth_packet(), defined in gdm_wimax.c. This
> function is called every time a packet is received or transmitted, and
> calls other helper functions too (get_protocol_name(),
> get_ip_protocol_name(), get_port_name()).
> 
> Doesn't all this debug logic provide an overhead to the tx / rx functions?

Yes, so much so it doesn't make sense to even have that type of
function, right?

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ