<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 4:31 PM, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Mon, Dec 05, 2016 at 11:24:44AM +0000, Robert Bragg wrote:<br>
> Forgot to send to dri-devel when I first sent this out...<br>
><br>
> The few times I've looked at using DRM_DEBUG messages, I haven't found<br>
> them very helpful considering how noisy some of the categories are. More<br>
> than once now I've preferred to go in and modify individual files to<br>
> affect what messages I see and re-build.<br>
><br>
> After recently converting some of the i915_perf.c messages to use<br>
> DRM_DEBUG, I thought I'd see if DRM_DEBUG could be updated to have a bit<br>
> more fine grained control than the current category flags.<br>
><br>
> A few things to note with this first iteration:<br>
><br>
> - I haven't looked to see what affect the change has on linked object<br>
> sizes.<br>
><br>
> - It seems like it could be nice if dynamic debug could effectively make<br>
> the drm_debug parameter redundant but dynamic debug doesn't give us a<br>
> way to categorise messages so maybe we'd want to consider including<br>
> categories in messages something like:<br>
><br>
> "[drm][kms] No FB found"<br>
><br>
> This way all kms messages could be enabled via:<br>
> echo "format [kms] +p" > dynamic_debug/control<br>
><br>
> Note with this simple scheme categories would no longer be mutually<br>
> exclusive which could be a nice bonus.<br>
<br>
</span>Really nice idea, and I agree that unifying drm.debug with dynamic debug<br>
in some way would be useful. We could implement your idea by reworking the<br>
existing debug helpers to auto-prepend the right string. That also opens<br>
up the door for much more fine-grained bucketing maybe, only challenge is<br>
that we should document things somewhere.<br></blockquote><div><br></div><div>yup, I don't mind writing some doc updates for this if it looks worthwhile.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span><br>
> Since it would involve changing the output format, I wonder how<br>
> concerned others might be about breaking some userspace (maybe CI test<br>
> runners) that for some reason grep for specific messages?<br>
<br>
</span>I think the only thing we have to keep working (somehow) is drm.debug. The<br>
exact output format doesn't really matter at all. Getting drm.debug to<br>
work when dynamic debugging is enabled probably requires exporting some<br>
functions, so that we can set the right ddebug options from the drm.debug<br>
mod-option write handler. There's special mod-option macros that allow you<br>
to specify write handlers, so that part is ok.<br></blockquote><br>dynamic_debug.h exposes a macro for declaring your own dynamic debug meta data as well as a macro for testing whether the message has been enabled.<br><br>I'm handling compatibility by using those macros so I can still test the drm.drm_debug flags.<br><br>Handling compatibility in terms of running control queries from the kernel would be a bit more tricky since we'd need to export some api from dynamic_debug.c as well as adding a write handler for drm_debug. Also the enabledness of messages is boolean not refcounted so I suppose there could be slightly annoying interactions if mixing both - though that could be documented.<br><div><br></div><div>The only disadvantage I can think of currently for not handling compatibility in terms of running control queries is that the dynamic debug macros can normally avoid evaluating any conditions on the cpu while a message is disabled, based on jump labels/static branches. We were already evaluating a condition for disabled drm debug messages though, so it seems reasonable to continue for now.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The other bit of backwards compat we imo need is that by default we should<br>
still keep drm.debug working, even when dynamic debugging is disabled.<br>
Having a third option that uses no_printk or similar (to get rid of all<br>
the debug strings and dead-code-eliminate all the related output code)<br></blockquote><div><br></div><div>Yeah, I think the current code already handles this, but sorry if it's not clear.<br></div><div><br></div><div>This version is #ifdefed so that if dynamic debug isn't enabled the dynamic debug path reduces to a no_prink<br><br></div><div>I'm considering CONFIG_DYNAMIC_DEBUG being enabled or not and when enabled I check drm_debug and the dynamic debug state, when disabled I'm just checking the drm_debug flags and the dynamic debugs bits boil out.<br></div><div><br></div><div>In my updated patch things we re-jigged a little so pr_debug and dev_dbg are used when CONFIG_DYNAMIC_DEBUG is not enabled, and these internally boil down to no_printk if DEBUG is disabled. Actually we might want to consider if that's the desired behaviour - since DRM_DEBUG wasn't previously affected by DEBUG being defined or not.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="m_9183495006324487767gmail-m_-3198660623992456905h5"><br>
> --- >8 --- (git am --scissors)<br>
><br>
> Dynamic debug messages (ref: Documentation/dynamic-debug-ho<wbr>wto.txt)<br>
> allow fine grained control over which debug messages are enabled with<br>
> runtime control through /sysfs/kernel/debug/dynamic_de<wbr>bug/control<br>
><br>
> This provides more control than the current drm.drm_debug parameter<br>
> which for some use cases is impractical to use given how chatty<br>
> some drm debug categories are.<br>
><br>
> For example all debug messages in i915_drm.c can be enabled with:<br>
> echo "file i915_perf.c +p" > dynamic_debug/control<br>
><br>
> This aims to maintain compatibility with controlling debug messages<br>
> using the drm_debug parameter. The new dynamic debug macros are called<br>
> by default but conditionally calling [dev_]printk if the category flag<br>
> is set (side stepping the dynamic debug condition in that case)<br>
><br>
> This removes the drm_[dev_]printk wrappers considering that the dynamic<br>
> debug macros are only useful if they can track the __FILE__, __func__<br>
> and __LINE__ where they are called. The wrapper didn't seem necessary in<br>
> the DRM_UT_NONE case with no category flag.<br>
><br>
> The output format should be compatible, unless the _DEV macros are<br>
> passed a NULL dev pointer considering how the core.c dev_printk<br>
> implementation adds "(NULL device *)" to the message in that case while<br>
> the drm wrapper would fallback to a plain printk in this case.<br>
> Previously some of non-dev drm debug macros were defined in terms of<br>
> passing NULL to a dev version but that's avoided now due to this<br>
> difference.<br>
><br>
> Signed-off-by: Robert Bragg <<a href="mailto:robert@sixbynine.org" target="_blank">robert@sixbynine.org</a>><br>
> Cc: <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.or<wbr>g</a><br>
> Cc: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch" target="_blank">daniel.vetter@ffwll.ch</a>><br>
> Cc: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>><br>
> ---<br>
> drivers/gpu/drm/drm_drv.c | 47 -------------<br>
> include/drm/drmP.h | 168 +++++++++++++++++++++++++++++-<wbr>----------------<br>
> 2 files changed, 108 insertions(+), 107 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c<br>
> index f74b7d0..25d00aa 100644<br>
> --- a/drivers/gpu/drm/drm_drv.c<br>
> +++ b/drivers/gpu/drm/drm_drv.c<br>
> @@ -65,53 +65,6 @@ static struct idr drm_minors_idr;<br>
><br>
> static struct dentry *drm_debugfs_root;<br>
><br>
> -#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"<br>
> -<br>
> -void drm_dev_printk(const struct device *dev, const char *level,<br>
> - unsigned int category, const char *function_name,<br>
> - const char *prefix, const char *format, ...)<br>
> -{<br>
> - struct va_format vaf;<br>
> - va_list args;<br>
> -<br>
> - if (category != DRM_UT_NONE && !(drm_debug & category))<br>
> - return;<br>
> -<br>
> - va_start(args, format);<br>
> - vaf.fmt = format;<br>
> - <a href="http://vaf.va" rel="noreferrer" target="_blank">vaf.va</a> = &args;<br>
> -<br>
> - if (dev)<br>
> - dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,<br>
> - &vaf);<br>
> - else<br>
> - printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);<br>
> -<br>
> - va_end(args);<br>
> -}<br>
> -EXPORT_SYMBOL(drm_dev_printk)<wbr>;<br>
> -<br>
> -void drm_printk(const char *level, unsigned int category,<br>
> - const char *format, ...)<br>
> -{<br>
> - struct va_format vaf;<br>
> - va_list args;<br>
> -<br>
> - if (category != DRM_UT_NONE && !(drm_debug & category))<br>
> - return;<br>
> -<br>
> - va_start(args, format);<br>
> - vaf.fmt = format;<br>
> - <a href="http://vaf.va" rel="noreferrer" target="_blank">vaf.va</a> = &args;<br>
> -<br>
> - printk("%s" "[" DRM_NAME ":%ps]%s %pV",<br>
> - level, __builtin_return_address(0),<br>
> - strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf);<br>
> -<br>
> - va_end(args);<br>
> -}<br>
> -EXPORT_SYMBOL(drm_printk);<br>
> -<br>
> /*<br>
> * DRM Minors<br>
> * A DRM device can provide several char-dev interfaces on the DRM-Major. Each<br>
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h<br>
> index a9cfd33..680f359 100644<br>
> --- a/include/drm/drmP.h<br>
> +++ b/include/drm/drmP.h<br>
> @@ -58,6 +58,7 @@<br>
> #include <linux/vmalloc.h><br>
> #include <linux/workqueue.h><br>
> #include <linux/dma-fence.h><br>
> +#include <linux/dynamic_debug.h><br>
><br>
> #include <asm/mman.h><br>
> #include <asm/pgalloc.h><br>
> @@ -129,7 +130,6 @@ struct dma_buf_attachment;<br>
> * run-time by echoing the debug value in its sysfs node:<br>
> * # echo 0xf > /sys/module/drm/parameters/deb<wbr>ug<br>
> */<br>
> -#define DRM_UT_NONE 0x00<br>
> #define DRM_UT_CORE 0x01<br>
> #define DRM_UT_DRIVER 0x02<br>
> #define DRM_UT_KMS 0x04<br>
> @@ -146,25 +146,22 @@ struct dma_buf_attachment;<br>
> /** \name Macros to make printk easier */<br>
> /*@{*/<br>
><br>
> -#define _DRM_PRINTK(once, level, fmt, ...) \<br>
> - do { \<br>
> - printk##once(KERN_##level "[" DRM_NAME "] " fmt, \<br>
> - ##__VA_ARGS__); \<br>
> - } while (0)<br>
> +#define _DRM_FMT_PREFIX "[" DRM_NAME "] "<br>
> +#define _DRM_FMT_FUNC_PREFIX "[" DRM_NAME ":%s] "<br>
><br>
> #define DRM_INFO(fmt, ...) \<br>
> - _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__)<br>
> + pr_info(_DRM_FMT_PREFIX fmt, ##__VA_ARGS__)<br>
> #define DRM_NOTE(fmt, ...) \<br>
> - _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__)<br>
> + pr_notice(_DRM_FMT_PREFIX fmt, ##__VA_ARGS__)<br>
> #define DRM_WARN(fmt, ...) \<br>
> - _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__)<br>
> + pr_warn(_DRM_FMT_PREFIX fmt, ##__VA_ARGS__)<br>
><br>
> #define DRM_INFO_ONCE(fmt, ...) \<br>
> - _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__)<br>
> + pr_info_once(_DRM_FMT_PREFIX fmt, ##__VA_ARGS__)<br>
> #define DRM_NOTE_ONCE(fmt, ...) \<br>
> - _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__)<br>
> + pr_notice_once(_DRM_FMT_PREFI<wbr>X fmt, ##__VA_ARGS__)<br>
> #define DRM_WARN_ONCE(fmt, ...) \<br>
> - _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)<br>
> + pr_warn_once(_DRM_FMT_PREFIX fmt, ##__VA_ARGS__)<br>
><br>
> /**<br>
> * Error output.<br>
> @@ -173,10 +170,11 @@ struct dma_buf_attachment;<br>
> * \param arg arguments<br>
> */<br>
> #define DRM_DEV_ERROR(dev, fmt, ...) \<br>
> - drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\<br>
> - fmt, ##__VA_ARGS__)<br>
> + dev_err(dev, _DRM_FMT_FUNC_PREFIX "*ERROR*" fmt, __func__, \<br>
> + ##__VA_ARGS__)<br>
> #define DRM_ERROR(fmt, ...) \<br>
> - drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__)<br>
> + pr_err(_DRM_FMT_FUNC_PREFIX "*ERROR*" fmt, __func__, \<br>
> + ##__VA_ARGS__)<br>
><br>
> /**<br>
> * Rate limited error output. Like DRM_ERROR() but won't flood the log.<br>
> @@ -193,21 +191,14 @@ struct dma_buf_attachment;<br>
> if (__ratelimit(&_rs)) \<br>
> DRM_DEV_ERROR(dev, fmt, ##__VA_ARGS__); \<br>
> })<br>
> -#define DRM_ERROR_RATELIMITED(fmt, ...) \<br>
> - DRM_DEV_ERROR_RATELIMITED(NUL<wbr>L, fmt, ##__VA_ARGS__)<br>
> +#define DRM_ERROR_RATELIMITED(fmt, args...) \<br>
> + DRM_DEV_ERROR_RATELIMITED(NUL<wbr>L, fmt, ##args)<br>
><br>
> -#define DRM_DEV_INFO(dev, fmt, ...) \<br>
> - drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt, \<br>
> - ##__VA_ARGS__)<br>
> +#define DRM_DEV_INFO(dev, fmt, args...) \<br>
> + dev_info(dev, _DRM_FMT_FUNC_PREFIX fmt, __func__, ##args)<br>
><br>
> -#define DRM_DEV_INFO_ONCE(dev, fmt, ...) \<br>
> -({ \<br>
> - static bool __print_once __read_mostly; \<br>
> - if (!__print_once) { \<br>
> - __print_once = true; \<br>
> - DRM_DEV_INFO(dev, fmt, ##__VA_ARGS__); \<br>
> - } \<br>
> -})<br>
> +#define DRM_DEV_INFO_ONCE(dev, fmt, args...) \<br>
> + dev_info_once(dev, _DRM_FMT_FUNC_PREFIX fmt, __func__, ##args)<br>
><br>
> /**<br>
> * Debug output.<br>
> @@ -215,50 +206,104 @@ struct dma_buf_attachment;<br>
> * \param fmt printf() like format string.<br>
> * \param arg arguments<br>
> */<br>
> +<br>
> +#if defined(CONFIG_DYNAMIC_DEBUG)<br>
> +/* We don't use pr_debug and dev_dbg directly since we want to<br>
> + * maintain format compatibility with non-dynamic drm debug messages<br>
> + */<br>
> +#define _DRM_DYNAMIC_DEV_DEBUG(dev, fmt, args...) \<br>
> +({ \<br>
> + DEFINE_DYNAMIC_DEBUG_METADATA<wbr>(descriptor, fmt); \<br>
> + if (DYNAMIC_DEBUG_BRANCH(descript<wbr>or)) \<br>
> + dev_printk(KERN_DEBUG, dev, fmt, ##args); \<br>
> +})<br>
> +#define _DRM_DYNAMIC_DEBUG(fmt, args...) \<br>
> +({ \<br>
> + DEFINE_DYNAMIC_DEBUG_METADATA<wbr>(descriptor, fmt); \<br>
> + if (DYNAMIC_DEBUG_BRANCH(descript<wbr>or)) \<br>
> + printk(KERN_DEBUG fmt, ##args); \<br>
> +})<br>
> +#else<br>
> +#define _DRM_DYNAMIC_DEV_DEBUG(dev, fmt, args...) \<br>
> + no_printk(fmt, ##args)<br>
> +#define _DRM_DYNAMIC_DEBUG(fmt, args...) \<br>
> + no_printk(fmt, ##args)<br>
> +#endif<br>
> +<br>
> +/* The conditional use of pr_debug/dev_dbg here allows us to take<br>
> + * advantage of the kernel's dynamic debug feature by default (ref<br>
> + * Documentation/dynamic-debug-ho<wbr>wto.txt) while maintaining<br>
> + * compatibility with using drm.drm_debug to turn on sets of messages<br>
> + *<br>
> + * Note: pr_debug and dev_dbg can't be called by a wrapper function<br>
> + * otherwise they can't track the __FILE__, __func__ and __LINE__<br>
> + * where they are called.<br>
> + */<br>
> +#define _DRM_DEV_DEBUG(dev, category, fmt, args...) \<br>
> +({ \<br>
> + if (unlikely(drm_debug & category)) { \<br>
> + dev_printk(KERN_DEBUG, dev, _DRM_FMT_FUNC_PREFIX fmt, \<br>
> + __func__, ##args); \<br>
> + } else { \<br>
> + _DRM_DYNAMIC_DEV_DEBUG(dev, _DRM_FMT_FUNC_PREFIX fmt, \<br>
> + __func__, ##args); \<br>
> + } \<br>
> +})<br>
> +#define _DRM_DEBUG(category, fmt, args...) \<br>
> +({ \<br>
> + if (unlikely(drm_debug & category)) { \<br>
> + printk(KERN_DEBUG _DRM_FMT_FUNC_PREFIX fmt, \<br>
> + __func__, ##args); \<br>
> + } else \<br>
> + _DRM_DYNAMIC_DEBUG(_DRM_FMT_F<wbr>UNC_PREFIX fmt, \<br>
> + __func__, ##args); \<br>
> +})<br>
> +<br>
> #define DRM_DEV_DEBUG(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, __func__, "", fmt, \<br>
> - ##args)<br>
> -#define DRM_DEBUG(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_CORE, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_CORE, fmt, ##args)<br>
> +#define DRM_DEBUG(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_CORE, fmt, ##args)<br>
><br>
> #define DRM_DEV_DEBUG_DRIVER(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, __func__, "", \<br>
> - fmt, ##args)<br>
> -#define DRM_DEBUG_DRIVER(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_DRIVER, fmt, ##args)<br>
> +#define DRM_DEBUG_DRIVER(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_DRIVER, fmt, ##args)<br>
><br>
> #define DRM_DEV_DEBUG_KMS(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, __func__, "", fmt, \<br>
> - ##args)<br>
> -#define DRM_DEBUG_KMS(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_KMS, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_KMS, fmt, ##args)<br>
> +#define DRM_DEBUG_KMS(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_KMS, fmt, ##args)<br>
><br>
> #define DRM_DEV_DEBUG_PRIME(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, __func__, "", \<br>
> - fmt, ##args)<br>
> -#define DRM_DEBUG_PRIME(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_PRIME, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_PRIME, fmt, ##args)<br>
> +#define DRM_DEBUG_PRIME(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_PRIME, fmt, ##args)<br>
><br>
> #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, __func__, "", \<br>
> - fmt, ##args)<br>
> -#define DRM_DEBUG_ATOMIC(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_ATOMIC, fmt, ##args)<br>
> +#define DRM_DEBUG_ATOMIC(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_ATOMIC, fmt, ##args)<br>
><br>
> #define DRM_DEV_DEBUG_VBL(dev, fmt, args...) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, __func__, "", fmt, \<br>
> - ##args)<br>
> -#define DRM_DEBUG_VBL(fmt, ...) \<br>
> - drm_printk(KERN_DEBUG, DRM_UT_VBL, fmt, ##__VA_ARGS__)<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_VBL, fmt, ##args)<br>
> +#define DRM_DEBUG_VBL(fmt, args...) \<br>
> + _DRM_DEBUG(DRM_UT_VBL, fmt, ##args)<br>
><br>
> -#define _DRM_DEV_DEFINE_DEBUG_RATELIMI<wbr>TED(dev, level, fmt, args...) \<br>
> +#define _DRM_DEV_DEFINE_DEBUG_RATELIMI<wbr>TED(dev, category, fmt, args...) \<br>
> +({ \<br>
> + static DEFINE_RATELIMIT_STATE(_rs, \<br>
> + DEFAULT_RATELIMIT_INTERVAL, \<br>
> + DEFAULT_RATELIMIT_BURST); \<br>
> + if (__ratelimit(&_rs)) \<br>
> + _DRM_DEV_DEBUG(dev, DRM_UT_ ## category, fmt, ##args); \<br>
> +})<br>
> +#define _DRM_DEFINE_DEBUG_RATELIMITED(<wbr>category, fmt, args...) \<br>
> ({ \<br>
> static DEFINE_RATELIMIT_STATE(_rs, \<br>
> DEFAULT_RATELIMIT_INTERVAL, \<br>
> DEFAULT_RATELIMIT_BURST); \<br>
> if (__ratelimit(&_rs)) \<br>
> - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ ## level, \<br>
> - __func__, "", fmt, ##args); \<br>
> + _DRM_DEBUG(DRM_UT_ ## category, fmt, ##args); \<br>
> })<br>
><br>
> /**<br>
> @@ -268,21 +313,24 @@ struct dma_buf_attachment;<br>
> * \param arg arguments<br>
> */<br>
> #define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, args...) \<br>
> - DEV__DRM_DEFINE_DEBUG_RATELIM<wbr>ITED(dev, CORE, fmt, ##args)<br>
> + _DRM_DEFINE_DEBUG_RATELIMITED<wbr>(dev, CORE, fmt, ##args)<br>
> #define DRM_DEBUG_RATELIMITED(fmt, args...) \<br>
> - DRM_DEV_DEBUG_RATELIMITED(NUL<wbr>L, fmt, ##args)<br>
> + _DRM_DEFINE_DEBUG_RATELIMITED<wbr>(CORE, fmt, ##args)<br>
> +<br>
> #define DRM_DEV_DEBUG_DRIVER_RATELIMIT<wbr>ED(dev, fmt, args...) \<br>
> _DRM_DEV_DEFINE_DEBUG_RATELIM<wbr>ITED(dev, DRIVER, fmt, ##args)<br>
> #define DRM_DEBUG_DRIVER_RATELIMITED(f<wbr>mt, args...) \<br>
> - DRM_DEV_DEBUG_DRIVER_RATELIMI<wbr>TED(NULL, fmt, ##args)<br>
> + _DRM_DEV_DEFINE_DEBUG_RATELIM<wbr>ITED(DRIVER, fmt, ##args)<br>
> +<br>
> #define DRM_DEV_DEBUG_KMS_RATELIMITED(<wbr>dev, fmt, args...) \<br>
> _DRM_DEV_DEFINE_DEBUG_RATELIM<wbr>ITED(dev, KMS, fmt, ##args)<br>
> #define DRM_DEBUG_KMS_RATELIMITED(fmt, args...) \<br>
> - DRM_DEV_DEBUG_KMS_RATELIMITED<wbr>(NULL, fmt, ##args)<br>
> + _DRM_DEFINE_DEBUG_RATELIMITED<wbr>(KMS, fmt, ##args)<br>
> +<br>
> #define DRM_DEV_DEBUG_PRIME_RATELIMITE<wbr>D(dev, fmt, args...) \<br>
> _DRM_DEV_DEFINE_DEBUG_RATELIM<wbr>ITED(dev, PRIME, fmt, ##args)<br>
> #define DRM_DEBUG_PRIME_RATELIMITED(fm<wbr>t, args...) \<br>
> - DRM_DEV_DEBUG_PRIME_RATELIMIT<wbr>ED(NULL, fmt, ##args)<br>
> + _DRM_DEFINE_DEBUG_RATELIMITED<wbr>(PRIME, fmt, ##args)<br>
><br>
> /* Format strings and argument splitters to simplify printing<br>
> * various "complex" objects<br>
<br>
</div></div>Since I brought up some changes for the debug stuff itself, would it make<br>
sense to split that from the general macro rework for all the non-debug<br>
output, and merge that first?<br>
<br>
Another thing to look into: I think it'd be good to move all the print<br>
definitions into drm_print.[hc], since drmP.h is a mess, and drm_drv.c not<br>
really the right place. That would then also allow us to easily document<br>
all the variants, and put something like the intro message for this commit<br>
into the overview DOC: section.<br>
<span class="m_9183495006324487767gmail-m_-3198660623992456905HOEnZb"><font color="#888888">-Daniel<br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
</font></span></blockquote></div><br></div></div>