drm: Stub out debug prints
Within the display server process, __drm_dbg consumes significant CPU time: 2.40% [kernel] [k] __drm_dbg Instead of compiling in all DRM debug print statements, stub them out to reduce runtime overhead and size. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
0b239017a9
commit
60bb8b3c0a
2 changed files with 20 additions and 0 deletions
|
@ -160,11 +160,13 @@ void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
|
|||
}
|
||||
EXPORT_SYMBOL(__drm_printfn_info);
|
||||
|
||||
#ifdef CONFIG_DRM_DEBUG_PRINT
|
||||
void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
|
||||
{
|
||||
pr_debug("%s %pV", p->prefix, vaf);
|
||||
}
|
||||
EXPORT_SYMBOL(__drm_printfn_debug);
|
||||
#endif
|
||||
|
||||
void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
|
||||
{
|
||||
|
@ -256,6 +258,7 @@ void drm_dev_printk(const struct device *dev, const char *level,
|
|||
}
|
||||
EXPORT_SYMBOL(drm_dev_printk);
|
||||
|
||||
#ifdef CONFIG_DRM_DEBUG_PRINT
|
||||
void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
const char *format, ...)
|
||||
{
|
||||
|
@ -298,6 +301,7 @@ void __drm_dbg(enum drm_debug_category category, const char *format, ...)
|
|||
va_end(args);
|
||||
}
|
||||
EXPORT_SYMBOL(__drm_dbg);
|
||||
#endif
|
||||
|
||||
void __drm_err(const char *format, ...)
|
||||
{
|
||||
|
|
|
@ -85,7 +85,12 @@ void __drm_puts_coredump(struct drm_printer *p, const char *str);
|
|||
void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
|
||||
void __drm_puts_seq_file(struct drm_printer *p, const char *str);
|
||||
void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
|
||||
#ifdef CONFIG_DRM_DEBUG_PRINT
|
||||
void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
|
||||
#else
|
||||
static inline
|
||||
void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf) { }
|
||||
#endif
|
||||
void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
|
||||
|
||||
__printf(2, 3)
|
||||
|
@ -333,9 +338,15 @@ static inline bool drm_debug_enabled(enum drm_debug_category category)
|
|||
__printf(3, 4)
|
||||
void drm_dev_printk(const struct device *dev, const char *level,
|
||||
const char *format, ...);
|
||||
#ifdef CONFIG_DRM_DEBUG_PRINT
|
||||
__printf(3, 4)
|
||||
void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
const char *format, ...);
|
||||
#else
|
||||
static inline __printf(3, 4)
|
||||
void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
const char *format, ...) { }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DRM_DEV_ERROR() - Error output.
|
||||
|
@ -470,8 +481,13 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
|||
* Prefer drm_device based logging over device or prink based logging.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DRM_DEBUG_PRINT
|
||||
__printf(2, 3)
|
||||
void __drm_dbg(enum drm_debug_category category, const char *format, ...);
|
||||
#else
|
||||
static inline __printf(2, 3)
|
||||
void __drm_dbg(enum drm_debug_category category, const char *format, ...) { }
|
||||
#endif
|
||||
__printf(1, 2)
|
||||
void __drm_err(const char *format, ...);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue