diff mbox series

[1/2] drm/print: Add drm_dbg_ratelimited

Message ID 20230117115350.1071-1-nirmoy.das@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/print: Add drm_dbg_ratelimited | expand

Commit Message

Nirmoy Das Jan. 17, 2023, 11:53 a.m. UTC
Add a function for ratelimitted debug print.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 include/drm/drm_print.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andrzej Hajda Jan. 17, 2023, 11:58 a.m. UTC | #1
On 17.01.2023 12:53, Nirmoy Das wrote:
> Add a function for ratelimitted debug print.
> 
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej
> ---
>   include/drm/drm_print.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a44fb7ef257f..1d839f507319 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...);
>   		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
>   })
>   
> +#define drm_dbg_ratelimited(drm, fmt, ...) \
> +	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
> +
>   #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
>   	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)
>
Andi Shyti Jan. 17, 2023, 1:55 p.m. UTC | #2
Hi,

can any of the DRM maintainers please check and eventually ack
this patch?

On Tue, Jan 17, 2023 at 12:53:49PM +0100, Nirmoy Das wrote:
> Add a function for ratelimitted debug print.
> 
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Thanks,
Andi

> ---
>  include/drm/drm_print.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a44fb7ef257f..1d839f507319 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...);
>  		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
>  })
>  
> +#define drm_dbg_ratelimited(drm, fmt, ...) \
> +	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
> +
>  #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
>  	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)
>  
> -- 
> 2.39.0
Sam Ravnborg Jan. 17, 2023, 2:49 p.m. UTC | #3
Hi Nirmoy

On Tue, Jan 17, 2023 at 12:53:49PM +0100, Nirmoy Das wrote:
> Add a function for ratelimitted debug print.
> 
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

Thanks for adding this.
The patch as-is is:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

It would have been nice to start adding kernel-doc to the
non-deprecated logging functions. But as everyone else is missing this,
it is OK that we miss it here.

A couple of nice follow-up patches would be to introduce a KMS variant
and replace the only user of DRM_DEBUG_KMS_RATELIMITED with the new
variant and remove the old one.

And maybe even update the remaining *ERROR_RATELIMITED users to a new
variant - and drop the deprecated ones.

	Sam

> ---
>  include/drm/drm_print.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a44fb7ef257f..1d839f507319 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...);
>  		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
>  })
>  
> +#define drm_dbg_ratelimited(drm, fmt, ...) \
> +	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
> +
>  #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
>  	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)
>  
> -- 
> 2.39.0
Nirmoy Das Jan. 17, 2023, 3:03 p.m. UTC | #4
Hi Sam,

On 1/17/2023 3:49 PM, Sam Ravnborg wrote:
> Hi Nirmoy
>
> On Tue, Jan 17, 2023 at 12:53:49PM +0100, Nirmoy Das wrote:
>> Add a function for ratelimitted debug print.
>>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Maxime Ripard <mripard@kernel.org>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: David Airlie <airlied@gmail.com>
>> Cc: Daniel Vetter <daniel@ffwll.ch>
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> Thanks for adding this.
> The patch as-is is:
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
>
> It would have been nice to start adding kernel-doc to the
> non-deprecated logging functions. But as everyone else is missing this,
> it is OK that we miss it here.
>
> A couple of nice follow-up patches would be to introduce a KMS variant
> and replace the only user of DRM_DEBUG_KMS_RATELIMITED with the new
> variant and remove the old one.
>
> And maybe even update the remaining *ERROR_RATELIMITED users to a new
> variant - and drop the deprecated ones.


Thanks for reviewing this. I can definitely work on your suggested 
follow-up patches.

Nirmoy

>
> 	Sam
>
>> ---
>>   include/drm/drm_print.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index a44fb7ef257f..1d839f507319 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...);
>>   		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
>>   })
>>   
>> +#define drm_dbg_ratelimited(drm, fmt, ...) \
>> +	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
>> +
>>   #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
>>   	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)
>>   
>> -- 
>> 2.39.0
Andi Shyti Feb. 10, 2023, 11:46 a.m. UTC | #5
Hi,

> can any of the DRM maintainers please check and eventually ack
> this patch?

I renew my request for an ack from any of the drm maintainers.
This patch has been already reviewd.

If it's OK I can take it into the drm-intel-gt-next branch.

Thanks,
Andi

> On Tue, Jan 17, 2023 at 12:53:49PM +0100, Nirmoy Das wrote:
> > Add a function for ratelimitted debug print.
> > 
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: David Airlie <airlied@gmail.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> > Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> 
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
> 
> Thanks,
> Andi
> 
> > ---
> >  include/drm/drm_print.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> > index a44fb7ef257f..1d839f507319 100644
> > --- a/include/drm/drm_print.h
> > +++ b/include/drm/drm_print.h
> > @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...);
> >  		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
> >  })
> >  
> > +#define drm_dbg_ratelimited(drm, fmt, ...) \
> > +	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
> > +
> >  #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
> >  	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)
> >  
> > -- 
> > 2.39.0
diff mbox series

Patch

diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index a44fb7ef257f..1d839f507319 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -602,6 +602,9 @@  void __drm_err(const char *format, ...);
 		drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__);	\
 })
 
+#define drm_dbg_ratelimited(drm, fmt, ...) \
+	__DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__)
+
 #define drm_dbg_kms_ratelimited(drm, fmt, ...) \
 	__DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__)