Message ID | 20231010121545.1046793-2-andi.shyti@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add drm_dbg_ratelimited() | expand |
On 10/10/23 08:15, Andi Shyti wrote: > From: Nirmoy Das <nirmoy.das@intel.com> > > Add a function for ratelimitted debug print. > > Signed-off-by: Nirmoy Das <nirmoy.das@intel.com> > 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> > Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> > Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> > Reviewed-by: Sam Ravnborg <sam@ravnborg.org> > Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> > --- > 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 a93a387f8a1a..ad77ac4b6808 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__) > + I guess since this was last sent drm_dbg_driver() was introduced, with drm_dbg() only being grandfathered in since it's already widely used, so it would probably be better to call this drm_dbg_driver_ratelimited() instead. > #define drm_dbg_kms_ratelimited(drm, fmt, ...) \ > __DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__) >
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a93a387f8a1a..ad77ac4b6808 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__)