linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Joe Perches <joe@perches.com>, Jason Baron <jbaron@akamai.com>
Cc: Vikash Garodia <vgarodia@codeaurora.org>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Make dynamic debug infrastructure more flexible
Date: Fri, 22 May 2020 01:39:56 +0300	[thread overview]
Message-ID: <bb5ff55f-dd97-5367-8f64-673e420103d7@linaro.org> (raw)
In-Reply-To: <5bb4b918aec3c77038122588ee642ae4aa2a09b0.camel@perches.com>

Hi Joe, Jason,

On 5/21/20 11:06 PM, Joe Perches wrote:
> On Thu, 2020-05-21 at 09:08 -0700, Joe Perches wrote:
>> On Thu, 2020-05-21 at 16:28 +0300, Stanimir Varbanov wrote:
>>> Here we introduce few debug macros with levels (low, medium and
>>> high) and debug macro for firmware. Enabling the particular level
>>> will be done by dynamic debug.
>>
>> I'd rather make the logging level facility generic in
>> dynamic debug than prefix all formats with what could
>> be non-specific content.

I like the idea. To be honest I researched the dynamic debug for such
level debugging facility but found it will be too complex to implement.
I guess now when you catch me it will be better to add it in dyndbg ;) .

>>
>> From a long time ago:
>>
>> https://groups.google.com/forum/#!msg/linux.kernel/VlWbno-ZAFw/k_fFadhNHXcJ
> 
> Hey Jason.
> 
> I believe there are 6 bits left in the unsigned int
> use for the line number and flags in struct _ddebug
> 
> Assuming the use of a mechanism like
> 
> 	pr_debug_level(level, fmt, ...)
> 
> would you be OK with something like this to enable a
> level or bitmask test of dynamic debug logging output?
> 
> where the output is controlled by something like
> 
> echo 'file <filename> level <n> +p' > <debugfs>/dynamic_debug/control

I guess for bitmask it should be?

echo 'file <> bitmask <0xn> +p' >  $CONTROL

> 
> to enable dynamic debug output only at level <n> or higher
> or maybe match a bitmap of <n>
> 
> (modulo all the rest of the code necessary to use it?)
> ---
>  include/linux/dynamic_debug.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index abcd5fde30eb..616dbb2b5921 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -38,6 +38,8 @@ struct _ddebug {
>  #define _DPRINTK_FLAGS_DEFAULT 0
>  #endif
>  	unsigned int flags:8;
> +	unsigned int level:5;
> +	unsigned int level_is_bitmask:1;
>  #ifdef CONFIG_JUMP_LABEL
>  	union {
>  		struct static_key_true dd_key_true;
> 
> 

-- 
regards,
Stan

  parent reply	other threads:[~2020-05-21 22:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 13:28 [PATCH v2 0/3] Venus dynamic debug Stanimir Varbanov
2020-05-21 13:28 ` [PATCH v2 1/3] venus: Add debugfs interface to set firmware log level Stanimir Varbanov
2020-05-21 13:28 ` [PATCH v2 2/3] venus: Make debug infrastructure more flexible Stanimir Varbanov
2020-05-21 16:08   ` Joe Perches
2020-05-21 20:06     ` [RFC] Make dynamic " Joe Perches
2020-05-21 21:10       ` Jason Baron
2020-05-21 22:39       ` Stanimir Varbanov [this message]
2020-05-21 13:28 ` [PATCH v2 3/3] venus: Add a debugfs file for SSR trigger Stanimir Varbanov

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=bb5ff55f-dd97-5367-8f64-673e420103d7@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=jbaron@akamai.com \
    --cc=joe@perches.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=vgarodia@codeaurora.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;
as well as URLs for NNTP newsgroup(s).