Linux Media Controller development
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>, unlisted-recipients:;
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH] rc-core: don't use dynamic_pr_debug for IR_dprintk()
Date: Sat, 26 Jul 2014 14:08:04 +0300	[thread overview]
Message-ID: <53D38C14.40501@iki.fi> (raw)
In-Reply-To: <1406341536-14418-1-git-send-email-m.chehab@samsung.com>



On 07/26/2014 05:25 AM, Mauro Carvalho Chehab wrote:
> The hole point of IR_dprintk() is that, once a level is
> given at debug parameter, all enabled IR parsers will show their
> debug messages.
>
> While converting it to dynamic_printk might be a good idea,
> right now it just makes very hard to debug the drivers, as
> one needs to both pass debug=1 or debug=2 to rc-core and
> to use the dynamic printk to enable all the desired lines.

Did you know you could enable debugs as whole module too? Also per 
function or source file, not only per line you seems to use.

That is basic command to enable all debugs for module rc-core
modprobe rc-core; echo -n 'module rc-core +p' > 
/sys/kernel/debug/dynamic_debug/control

Look also other flags than '+p' from documentation
Documentation/dynamic-debug-howto.txt


> That doesn't make sense!
>
> So, revert to the old way, as a single line is changed,
> and the debug parameter will now work as expected.
>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>   include/media/rc-core.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/media/rc-core.h b/include/media/rc-core.h
> index 3047837db1cc..2c7fbca40b69 100644
> --- a/include/media/rc-core.h
> +++ b/include/media/rc-core.h
> @@ -26,7 +26,7 @@ extern int rc_core_debug;
>   #define IR_dprintk(level, fmt, ...)				\
>   do {								\
>   	if (rc_core_debug >= level)				\
> -		pr_debug("%s: " fmt, __func__, ##__VA_ARGS__);	\
> +		printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);	\
>   } while (0)
>
>   enum rc_driver_type {
>

-- 
http://palosaari.fi/

  reply	other threads:[~2014-07-26 11:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26  2:25 [PATCH] rc-core: don't use dynamic_pr_debug for IR_dprintk() Mauro Carvalho Chehab
2014-07-26 11:08 ` Antti Palosaari [this message]
2014-07-26 13:34   ` Mauro Carvalho Chehab

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=53D38C14.40501@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=mchehab@infradead.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