Skip to content

RFC Allow using dyndbg to replace drm_debug_enabled

Jim Cromie dri-devel intel-gfx lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest4 patches 2 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macroinclude/drm/drm_print.h+13 -82 replies
2/4drm: fixup comment spellinginclude/drm/drm_print.h+1 -10 replies
3/4drm: RFC add choice to use dynamic debug in drm-debugdrivers/gpu/drm/Kconfig drivers/gpu/drm/drm_print.c include/drm/drm_print.h+159 -330 replies
4/4i915: map gvt pr_debug categories to bits in parameters/debug_gvtdrivers/gpu/drm/i915/gvt/Makefile drivers/gpu/drm/i915/i915_params.c+80 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/4] Allow using dyndbg to replace drm_debug_enabled

drm_debug_enabled() is called a lot to do unlikely bit-tests to control debug printing; this is a good job for dynamic-debug, IFF it is built with JUMP_LABEL.

Enable the use of dynamic-debug to avoid drm_debug_enabled() overheads, opt in with CONFIG_DRM_USE_DYNAMIC_DEBUG=y.

I have this patchset running bare-metal on an i915 laptop & an amdgpu desktop (both as loadable modules).

I booted the amdgpu box with:

BOOT_IMAGE=(hd2,gpt2)/vmlinuz-5.13.0-dd7-13692-g8def25788f56 \
     root=UUID=mumble ro \
     rootflags=subvol=root00 rhgb \
     dynamic_debug.verbose=3 main.dyndbg=+p \
     amdgpu.debug=1 amdgpu.test=1 \
     "amdgpu.dyndbg=format ^[ +p"

That last line activates ~1700 callsites with a format like '[DML' etc at boot, causing ~76k prdbgs in 409 seconds, before I turned them off with:

echo module amdgpu -p > /proc/dynamic_debug/control

[root@gandalf jimc]# journalctl -b-0 | grep -P '\[(DML|VBLANK|SURFACE|BIOS|BANDWIDTH)' | wc
68708 578503 5054437
[root@gandalf jimc]# journalctl -b-0 | grep -P '\[(DML|VBLANK|SURFACE|BIOS|BANDWIDTH|\w+)' | wc
76298 661176 6028087

IOW, things appear to hold up under some stress.

this is on top of master @ v5.13-13688-gde5540965853

v1 is here:
https://lore.kernel.org/lkml/[email protected]/

Jim Cromie (4):
drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro
drm: fixup comment spelling
drm: RFC add choice to use dynamic debug in drm-debug
i915: map gvt pr_debug categories to bits in parameters/debug_gvt

 drivers/gpu/drm/Kconfig            |  13 ++++
 drivers/gpu/drm/drm_print.c        |  75 +++++++++++++++++-
 drivers/gpu/drm/i915/gvt/Makefile  |   4 +
 drivers/gpu/drm/i915/i915_params.c |  76 ++++++++++++++++++
 include/drm/drm_print.h            | 119 ++++++++++++++++++++---------
 5 files changed, 249 insertions(+), 38 deletions(-)
Signature · 1 line
2.31.1