DRM logging tidy
Subsystems (3)
Tvrtko Ursulin
maintainercover DRM logging tidy
From: Tvrtko Ursulin <[email protected]>
I wasn't here at the beginnings of DRM so I might have gotten this wrong, however the existance of DRM_NAME suggested to me that the intention was to allow individual drivers to override it and get appropriate prefixes in their log messages.
I can't see that any driver is using it like that but I still thought it would be neat to do that. That way we could have our log messages look more obviously ours. For example after this series we have:
[i915] Memory usable by graphics device = 4096M
[i915] VT-d active for gfx access
[i915] Replacing VGA console driver
[i915] ACPI BIOS requests an excessive sleep of 20000 ms, using 1500 ms instead [i915] Finished loading DMC firmware i915/skl_dmc_ver1_26.bin (v1.26) [i915] Disabling framebuffer compression (FBC) to prevent screen flicker with VT-d enabled [i915] GuC firmware load skipped
[i915] Initialized i915 1.6.0 20161205 for 0000:00:02.0 on minor 0
[i915] DRM_I915_DEBUG enabled
[i915] DRM_I915_DEBUG_GEM enabled
[i915] RC6 on
Previously all that was prefixed with "[drm]" which was OK but I think the above is even better.
Also to consider is that recent drm_printk work has removed (it hardcoded) DRM_NAME from DRM_ERROR and DRM_DEBUG macros, while leaving it with the rest (DRM_INFO, NOTE and WARNING) creating a bit of a inconsistency.
This series also makes all the logging macros use drm_printk, but also makes DRM_NAME passed in from the macro wrappers in all cases. So drivers can override it regardless of the log level.
And finally, the series also removes a bit of redundant data from the debug messages effectively converting this:
[drm:edp_panel_off [i915]] Wait for panel power off time
Into this:
[edp_panel_off [i915]] Wait for panel power off time
Which still has all the data in it.
Tvrtko Ursulin (5):
drm/i915: Give our log messages our name
drm: Respect driver set DRM_NAME in drm_printk
drm: Respect driver set DRM_NAME in drm_dev_printk
drm: Use drm_printk for all logging macros
drm: Do not log driver prefix in debug messages
drivers/gpu/drm/drm_drv.c | 39 +++++++++++------ drivers/gpu/drm/i915/i915_drv.c | 3 +- include/drm/drmP.h | 94 ++++++++++++++++++++++++----------------- include/drm/drm_drv.h | 11 ++--- include/uapi/drm/i915_drm.h | 3 ++ 5 files changed, 92 insertions(+), 58 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerRFC 1/5 drm/i915: Give our log messages our name
From: Tvrtko Ursulin <[email protected]>
Define DRM_NAME to i915 so that the log messages we output change from:
[drm] RC6 on
to:
[i915] RC6 on
Since I wasn't around in the beginning of DRM I wonder whether that was the intended purpose of DRM_NAME or if it was something else.
Today it looks a bit messy with it being used by both macros and core DRM helpers, like drm_dev_printk and drm_printk, meaning that this change only affects some and not all log messages.
Following patches will try to correct that as well.
--- include/uapi/drm/i915_drm.h | 3 +++ 1 file changed, 3 insertions(+)
include/uapi/drm/i915_drm.h +3 -0
@@ -29,6 +29,9 @@#include "drm.h" +#undef DRM_NAME +#define DRM_NAME "i915" +#if defined(__cplusplus)extern "C" {#endif
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerRFC 2/5 drm: Respect driver set DRM_NAME in drm_printk
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Instead of logging with the DRM core name, pass in the name explicitly in order to allow individual drivers to have all their log messages prefixed with their own name.
For instance i915, instead of:
[drm:edp_panel_off [i915]] Wait for panel power off time
would now log debug messages as:
[i915:edp_panel_off [i915]] Wait for panel power off time
--- drivers/gpu/drm/drm_drv.c | 6 +++--- include/drm/drmP.h | 14 +++++++------- include/drm/drm_drv.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/gpu/drm/drm_drv.c +3 -3
@@ -92,7 +92,7 @@ void drm_dev_printk(const struct device *dev, const char *level,EXPORT_SYMBOL (drm_dev_printk);void drm_printk (const char *level,unsigned int category, -const char *format, ...) +const char *driver,const char *format, ...) {struct va_format vaf;va_list args;
@@ -104,8 +104,8 @@ void drm_printk(const char *level, unsigned int category, vaf.fmt = format; vaf.va = &args; -printk ("%s" "[" DRM_NAME ":%ps]%s %pV" , - level,__builtin_return_address (0 ), +printk ("%s[%s:%ps]%s %pV" , + level, driver,__builtin_return_address (0 ),strcmp (level,KERN_ERR ) ==0 ?" *ERROR*" :"" , &vaf);va_end (args);
include/drm/drmP.h +7 -7
@@ -176,7 +176,7 @@ struct dma_buf_attachment;drm_dev_printk (dev,KERN_ERR ,DRM_UT_NONE , __func__," *ERROR*" ,\ fmt, ##__VA_ARGS__)#define DRM_ERROR (fmt, ...) \ - drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__) + drm_printk(KERN_ERR, DRM_UT_NONE, DRM_NAME, fmt, ##__VA_ARGS__)/** * Rate limited error output. Like DRM_ERROR() but won't flood the log.
@@ -219,37 +219,37 @@ struct dma_buf_attachment; drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, __func__, "", fmt, \ ##args) #define DRM_DEBUG(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_CORE, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_CORE, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DRIVER(dev, fmt, args...) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, __func__, "", \ fmt, ##args) #define DRM_DEBUG_DRIVER(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_DRIVER, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_KMS(dev, fmt, args...) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, __func__, "", fmt, \ ##args) #define DRM_DEBUG_KMS(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_KMS, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_KMS, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_PRIME(dev, fmt, args...) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, __func__, "", \ fmt, ##args) #define DRM_DEBUG_PRIME(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_PRIME, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, args...) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, __func__, "", \ fmt, ##args) #define DRM_DEBUG_ATOMIC(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_ATOMIC, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_VBL(dev, fmt, args...) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, __func__, "", fmt, \ ##args) #define DRM_DEBUG_VBL(fmt, ...) \ - drm_printk(KERN_DEBUG, DRM_UT_VBL, fmt, ##__VA_ARGS__) + drm_printk(KERN_DEBUG, DRM_UT_VBL, DRM_NAME, fmt, ##__VA_ARGS__) #define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, level, fmt, args...) \ ({ \
include/drm/drm_drv.h +2 -2
@@ -411,9 +411,9 @@ extern __printf(6, 7)void drm_dev_printk (const struct device *dev,const char *level,unsigned int category,const char *function_name,const char *prefix,const char *format, ...); -extern __printf(3, 4) +extern __printf(4, 5) void drm_printk(const char *level, unsigned int category, - const char *format, ...); + const char *driver, const char *format, ...); extern unsigned int drm_debug; int drm_dev_init(struct drm_device *dev,
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerRFC 3/5 drm: Respect driver set DRM_NAME in drm_dev_printk
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Same as the previous patch did for drm_printk, allow for the logging macros to pass in the driver set DRM_NAME.
--- drivers/gpu/drm/drm_drv.c | 14 +++++++------- drivers/gpu/drm/i915/i915_drv.c | 3 ++- include/drm/drmP.h | 36 ++++++++++++++++++------------------ include/drm/drm_drv.h | 7 ++++--- 4 files changed, 31 insertions(+), 29 deletions(-)
drivers/gpu/drm/drm_drv.c +7 -7
@@ -65,11 +65,10 @@ static struct idr drm_minors_idr;static struct dentry *drm_debugfs_root; -#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV" -void drm_dev_printk (const struct device *dev,const char *level, -unsigned int category,const char *function_name, -const char *prefix,const char *format, ...) +unsigned int category,const char *driver, +const char *function_name,const char *prefix, +const char *format, ...) {struct va_format vaf;va_list args;
@@ -82,10 +81,11 @@ void drm_dev_printk(const struct device *dev, const char *level, vaf.va = &args;if (dev) -dev_printk (level, dev,DRM_PRINTK_FMT , function_name, prefix, - &vaf); +dev_printk (level, dev,"[%s:%ps]%s %pV" , + driver, function_name, prefix, &vaf);else -printk ("%s" DRM_PRINTK_FMT , level, function_name, prefix, &vaf); +printk ("%s[%s:%ps]%s %pV" , + level, driver, function_name, prefix, &vaf);va_end (args); }
drivers/gpu/drm/i915/i915_drv.c +2 -1
@@ -101,7 +101,8 @@ i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...) vaf.fmt = fmt; vaf.va = &args; -drm_dev_printk (kdev, level,DRM_UT_DRIVER , __func__,"" , fmt, &vaf); +drm_dev_printk (kdev, level,DRM_UT_DRIVER ,DRM_NAME , __func__,"" , + fmt, &vaf);va_end (args);
include/drm/drmP.h +18 -18
@@ -173,8 +173,8 @@ struct dma_buf_attachment;* \param arg arguments */ #define DRM_DEV_ERROR (dev, fmt, ...) \ - drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\ - fmt, ##__VA_ARGS__) + drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, DRM_NAME, __func__, \ + " *ERROR*", fmt, ##__VA_ARGS__)#define DRM_ERROR (fmt, ...) \ drm_printk(KERN_ERR, DRM_UT_NONE, DRM_NAME, fmt, ##__VA_ARGS__)
@@ -197,8 +197,8 @@ struct dma_buf_attachment; DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__)#define DRM_DEV_INFO (dev, fmt, ...) \ - drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt, \ - ##__VA_ARGS__) + drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, DRM_NAME, __func__, \ + "", fmt, ##__VA_ARGS__)#define DRM_DEV_INFO_ONCE (dev, fmt, ...) \ ({ \
@@ -216,38 +216,38 @@ struct dma_buf_attachment;* \param arg arguments */ #define DRM_DEV_DEBUG(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, __func__, "", fmt, \ - ##args) + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, DRM_NAME, __func__,\ + "", fmt, ##args)#define DRM_DEBUG (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_CORE, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DRIVER(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, __func__, "", \ - fmt, ##args) + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, DRM_NAME, \ + __func__, "", fmt, ##args)#define DRM_DEBUG_DRIVER (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_DRIVER, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_KMS(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, __func__, "", fmt, \ - ##args) -#define DRM_DEBUG_KMS (fmt, ...) \ + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, DRM_NAME, __func__, \ + "", fmt, ##args) +#define DRM_DEBUG_KMS (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_KMS, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_PRIME(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, __func__, "", \ - fmt, ##args) + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, DRM_NAME, \ + __func__, "", fmt, ##args)#define DRM_DEBUG_PRIME (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_PRIME, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, __func__, "", \ - fmt, ##args) + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, DRM_NAME, \ + __func__, "", fmt, ##args)#define DRM_DEBUG_ATOMIC (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_ATOMIC, DRM_NAME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_VBL(dev, fmt, args...) \ - drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, __func__, "", fmt, \ - ##args) + drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, DRM_NAME, __func__, \ + "", fmt, ##args)#define DRM_DEBUG_VBL (fmt, ...) \ drm_printk(KERN_DEBUG, DRM_UT_VBL, DRM_NAME, fmt, ##__VA_ARGS__)
@@ -258,7 +258,7 @@ struct dma_buf_attachment; DEFAULT_RATELIMIT_BURST); \ if (__ratelimit(&_rs)) \ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ ## level, \ - __func__, "", fmt, ##args); \ + DRM_NAME, __func__, "", fmt, ##args); \ })/**
include/drm/drm_drv.h +4 -3
@@ -407,10 +407,11 @@ struct drm_driver {struct list_head legacy_dev_list; }; -extern __printf(6, 7) +extern __printf(7, 8) void drm_dev_printk(const struct device *dev, const char *level, - unsigned int category, const char *function_name, - const char *prefix, const char *format, ...); + unsigned int category, const char *driver, + const char *function_name, const char *prefix, + const char *format, ...); extern __printf(4, 5) void drm_printk(const char *level, unsigned int category, const char *driver, const char *format, ...);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerRFC 4/5 drm: Use drm_printk for all logging macros
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Eliminate _DRM_PRINTK macro and use drm_printk for all log levels.
This required drm_printk to vary the verbosity level of the logged metadata depending on the log level.
--- drivers/gpu/drm/drm_drv.c | 31 ++++++++++++++++++++++--------- include/drm/drmP.h | 44 ++++++++++++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 23 deletions(-)
drivers/gpu/drm/drm_drv.c +22 -9
@@ -80,12 +80,21 @@ void drm_dev_printk(const struct device *dev, const char *level, vaf.fmt = format; vaf.va = &args; -if (dev) -dev_printk (level, dev,"[%s:%ps]%s %pV" , - driver, function_name, prefix, &vaf); -else -printk ("%s[%s:%ps]%s %pV" , - level, driver, function_name, prefix, &vaf); +if (level[1 ] !=KERN_DEBUG [1 ]) { +if (dev) +dev_printk (level, dev,"[%s]%s %pV" , + driver, prefix, &vaf); +else +printk ("%s[%s]%s %pV" , + level, driver, prefix, &vaf); + }else { +if (dev) +dev_printk (level, dev,"[%s:%ps]%s %pV" , + driver, function_name, prefix, &vaf); +else +printk ("%s[%s:%ps]%s %pV" , + level, driver, function_name, prefix, &vaf); + }va_end (args); }
@@ -104,9 +113,13 @@ void drm_printk(const char *level, unsigned int category, vaf.fmt = format; vaf.va = &args; -printk ("%s[%s:%ps]%s %pV" , - level, driver,__builtin_return_address (0 ), -strcmp (level,KERN_ERR ) ==0 ?" *ERROR*" :"" , &vaf); +if (level[1 ] !=KERN_DEBUG [1 ]) +printk ("%s[%s]%s %pV" , + level, driver, +strcmp (level,KERN_ERR ) ==0 ?" *ERROR*" :"" , &vaf); +else +printk ("%s[%s:%ps] %pV" , + level, driver,__builtin_return_address (0 ), &vaf);va_end (args); }
include/drm/drmP.h +30 -14
55 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerRFC 5/5 drm: Do not log driver prefix in debug messages
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Driver prefix is a bit redundant in debug messages. If we choose not to log it we change debug messages which used to look like this:
[i915:edp_panel_off [i915]] Wait for panel power off time
to this:
[edp_panel_off [i915]] Wait for panel power off time
--- drivers/gpu/drm/drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_drv.c +2 -2
@@ -118,8 +118,8 @@ void drm_printk(const char *level, unsigned int category, level, driver, strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf); else - printk("%s[%s:%ps] %pV", - level, driver, __builtin_return_address(0), &vaf); + printk("%s[%ps] %pV", + level, __builtin_return_address(0), &vaf);va_end (args); }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC 5/5] drm: Do not log driver prefix in debug messages
Hi Tvrtko,
2016-12-06 Tvrtko Ursulin <[email protected]>:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
Driver prefix is a bit redundant in debug messages. If we choose not to log it we change debug messages which used to look like this:
[i915:edp_panel_off [i915]] Wait for panel power off time
to this:
[
edp_panel_off[i915]] Wait for panel power off time
Why not remove the second mention to the driver's name instead.
[i915:edp_panel_off] looks more logic to me.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC 5/5] drm: Do not log driver prefix in debug messages
Hi,
Quoted 11 lines · Gustavo Padovan
Hi Tvrtko,
2016-12-06 Tvrtko Ursulin <[email protected]>:
Quoted 7 lines
From: Tvrtko Ursulin <[email protected]>
Driver prefix is a bit redundant in debug messages. If we choose not to log it we change debug messages which used to look like this:
[i915:edp_panel_off [i915]] Wait for panel power off time
Quoted 7 lines
Quoted 3 lines
to this:
[
edp_panel_off[i915]] Wait for panel power off timeWhy not remove the second mention to the driver's name instead.
[i915:edp_panel_off] looks more logic to me.
Would possibly be more readable yes, but the whole string comes from %ps AFAICS so I don't think we could split it.
Regards,
Tvrtko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✗ Fi.CI.BAT: failure for DRM logging tidy
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: DRM logging tidy
URL : https://patchwork.freedesktop.org/series/16439/
State : failure
== Summary ==
CC [M] drivers/gpu/drm/i915/intel_renderstate_gen6.o CC [M] drivers/gpu/drm/i915/i915_guc_submission.o CC [M] drivers/gpu/drm/i915/intel_renderstate_gen7.o LD drivers/mmc/built-in.o CC [M] drivers/gpu/drm/i915/intel_renderstate_gen8.o CC [M] drivers/gpu/drm/i915/intel_audio.o CC [M] drivers/gpu/drm/i915/intel_renderstate_gen9.o cc1: all warnings being treated as errors LD drivers/pnp/pnpacpi/built-in.o LD kernel/built-in.o GEN lib/crc32table.h CC [M] drivers/gpu/drm/i915/intel_atomic.o CC [M] drivers/gpu/drm/i915/intel_atomic_plane.o CC [M] drivers/gpu/drm/i915/intel_bios.o LD drivers/pnp/built-in.o scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/i915_drv.o' failed make[4]: *** [drivers/gpu/drm/i915/i915_drv.o] Error 1 make[4]: *** Waiting for unfinished jobs.... CC lib/crc32.o CC [M] drivers/gpu/drm/i915/intel_color.o CC [M] drivers/gpu/drm/i915/intel_dpio_phy.o CC [M] drivers/gpu/drm/i915/intel_display.o LD [M] drivers/misc/mei/mei-me.o LD [M] drivers/net/ethernet/intel/igbvf/igbvf.o LD drivers/misc/built-in.o LD drivers/usb/storage/usb-storage.o LD drivers/usb/storage/built-in.o LD [M] drivers/usb/serial/usbserial.o LD drivers/acpi/acpica/acpi.o LD drivers/iommu/built-in.o LD [M] sound/pci/hda/snd-hda-codec-generic.o LD drivers/pci/pcie/aer/aerdriver.o LD drivers/spi/built-in.o LD sound/pci/built-in.o LD drivers/pci/pcie/aer/built-in.o LD drivers/pci/pcie/built-in.o LD drivers/acpi/acpica/built-in.o LD drivers/thermal/thermal_sys.o LD drivers/tty/serial/8250/8250.o LD drivers/gpu/drm/drm.o LD drivers/acpi/built-in.o LD sound/built-in.o LD drivers/thermal/built-in.o LD drivers/video/fbdev/core/fb.o LD net/ipv6/ipv6.o LD drivers/video/fbdev/core/built-in.o LD [M] drivers/net/ethernet/intel/e1000/e1000.o LD lib/raid6/raid6_pq.o LD drivers/usb/gadget/libcomposite.o LD drivers/video/fbdev/built-in.o LD lib/raid6/built-in.o LD net/ipv6/built-in.o LD drivers/scsi/scsi_mod.o LD drivers/pci/built-in.o LD drivers/tty/serial/8250/8250_base.o LD drivers/tty/serial/8250/built-in.o LD drivers/tty/serial/built-in.o LD drivers/usb/gadget/udc/udc-core.o LD fs/btrfs/btrfs.o LD drivers/usb/gadget/udc/built-in.o LD drivers/usb/gadget/built-in.o LD fs/btrfs/built-in.o LD net/ipv4/built-in.o LD drivers/video/console/built-in.o LD drivers/video/built-in.o CC arch/x86/kernel/cpu/capflags.o LD [M] drivers/net/ethernet/intel/igb/igb.o LD drivers/usb/core/usbcore.o LD arch/x86/kernel/cpu/built-in.o LD arch/x86/kernel/built-in.o LD drivers/usb/core/built-in.o LD drivers/scsi/sd_mod.o LD drivers/scsi/built-in.o LD arch/x86/built-in.o LD drivers/md/md-mod.o LD drivers/md/built-in.o AR lib/lib.a EXPORTS lib/lib-ksyms.o LD lib/built-in.o LD drivers/usb/host/xhci-hcd.o LD net/core/built-in.o LD net/built-in.o LD drivers/tty/vt/built-in.o LD drivers/tty/built-in.o LD drivers/usb/host/built-in.o LD drivers/usb/built-in.o LD fs/ext4/ext4.o LD fs/ext4/built-in.o LD fs/built-in.o LD [M] drivers/net/ethernet/intel/e1000e/e1000e.o LD drivers/net/ethernet/built-in.o LD drivers/net/built-in.o
scripts/Makefile.build:544: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2 scripts/Makefile.build:544: recipe for target 'drivers/gpu/drm' failed make[2]: *** [drivers/gpu/drm] Error 2 scripts/Makefile.build:544: recipe for target 'drivers/gpu' failed make[1]: *** [drivers/gpu] Error 2
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 27 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
I wasn't here at the beginnings of DRM so I might have gotten this wrong, however the existance of
DRM_NAMEsuggested to me that the intention was to allow individual drivers to override it and get appropriate prefixes in their
log messages.I can't see that any driver is using it like that but I still thought it would
be neat to do that. That way we could have our log messages look more obviously ours. For example after this series we have:[i915] Memory usable by graphics device = 4096M
[i915] VT-d active for gfx access
[i915] Replacing VGA console driver
[i915] ACPI BIOS requests an excessive sleep of 20000 ms, using 1500 ms
instead
[i915] Finished loading DMC firmware i915/skl_dmc_ver1_26.bin (v1.26) [i915] Disabling framebuffer compression (FBC) to prevent screen flicker
with VT-d enabled
[i915] GuC firmware load skipped
[i915] Initialized i915 1.6.0 20161205 for 0000:00:02.0 on minor 0 [i915]DRM_I915_DEBUGenabled
[i915]DRM_I915_DEBUG_GEMenabled
[i915] RC6 on
Quoted 8 lines
Previously all that was prefixed with "[drm]" which was OK but I think the above is even better.
Also to consider is that recent
drm_printkwork has removed (it hardcoded)DRM_NAMEfromDRM_ERRORandDRM_DEBUGmacros, while leaving it with the rest
(DRM_INFO, NOTE and WARNING) creating a bit of a inconsistency.
I wonder if I can maybe fold some of this idea into my related DRM_DEBUG [RFC] sent out recently:
https://lists.freedesktop.org/archives/dri-devel/2016-December/126094.html
Instead of using DRM_NAME, I've experimented with updating my changes adding support for dynamic debug to add a prefix based on module_name(THIS_MODULE) for a similar result
One thing to consider here is that with the addition of dynamic debug support this prefix arguably becomes redundant because the dynamic_debug/control interface lets you choose to add a module name or function prefix to messages, e.g. like:
echo "module i915 +mfp" > dynamic_debug/control
I've ignored the redundancy because my change still allows enabling messages with the drm.drm_debug parameter and in that case the prefix is still useful.
Br,
- Robert
Quoted 30 lines
This series also makes all the logging macros use
drm_printk, but also makesDRM_NAMEpassed in from the macro wrappers in all cases. So drivers can override it regardless of the log level.And finally, the series also removes a bit of redundant data from the debug messages effectively converting this:
[drm:edp_panel_off [i915]] Wait for panel power off time
Into this:
[
edp_panel_off[i915]] Wait for panel power off timeWhich still has all the data in it.
Tvrtko Ursulin (5):
drm/i915: Give our log messages our name
drm: Respect driver setDRM_NAMEindrm_printk
drm: Respect driver setDRM_NAMEindrm_dev_printk
drm: Usedrm_printkfor all logging macros
drm: Do not log driver prefix in debug messagesdrivers/gpu/drm/drm_drv.c | 39 +++++++++++------ drivers/gpu/drm/i915/i915_drv.c | 3 +- include/drm/drmP.h | 94 ++++++++++++++++++++++++------ ----------- include/drm/drm_drv.h | 11 ++--- include/uapi/drm/i915_drm.h | 3 ++ 5 files changed, 92 insertions(+), 58 deletions(-)
Quoted 8 lines
--
2.7.4_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx