From: Michalis Pappas <mpappas@fastmail.fm>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: conditionally compile debug code
Date: Wed, 09 Jul 2014 20:52:07 +0100 [thread overview]
Message-ID: <53BD9D67.8090806@fastmail.fm> (raw)
In-Reply-To: <20140709185142.GA13271@kroah.com>
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@fastmail.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()?
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?
next prev parent reply other threads:[~2014-07-09 19:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 13:00 [PATCH] staging: gdm72xx: remove unused code Michalis Pappas
2014-07-01 13:00 ` [PATCH] staging: gdm72xx: conditionally compile debug code Michalis Pappas
[not found] ` <CAC5Y2nPGyByqLEM1Go6Pxpb6MhiJy2Fvu=eEz6ak24gMhayk=A@mail.gmail.com>
2014-07-01 16:40 ` Michalis Pappas
[not found] ` <CAC5Y2nOvJ2=u7-T53kHd50AfQ7Mo_U4qvD_=si9=NSr_q0w3NA@mail.gmail.com>
2014-07-03 17:27 ` Michalis Pappas
2014-07-09 18:51 ` Greg KH
2014-07-09 19:52 ` Michalis Pappas [this message]
2014-07-09 20:24 ` Greg KH
2014-07-16 20:40 ` Michalis Pappas
2014-07-16 20:50 ` Greg KH
2014-07-16 22:03 ` Michalis Pappas
2014-07-16 22:10 ` Greg KH
2014-07-16 22:46 ` Joe Perches
2014-07-16 22:57 ` Greg KH
2014-07-17 0:19 ` Joe Perches
2014-07-01 13:00 ` [PATCH] staging: gdm72xx: move T_CAPABILITY bit definitions to hci.h Michalis Pappas
2014-07-01 15:37 ` Ben Chan
2014-07-01 16:25 ` Michalis Pappas
2014-07-02 10:18 ` [PATCH V2] staging: gdm72xx: move T_CAPABILITY " Michalis Pappas
2014-07-09 10:26 ` Dan Carpenter
2014-07-09 18:24 ` Michalis Pappas
2014-07-09 18:31 ` [PATCH v3] " Michalis Pappas
2014-07-09 18:57 ` Greg KH
2014-07-09 19:21 ` [PATCH v4] " Michalis Pappas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53BD9D67.8090806@fastmail.fm \
--to=mpappas@fastmail.fm \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox