linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/4] Allow using dyndbg to replace drm_debug_enabled
@ 2021-07-11  5:49 Jim Cromie
  2021-07-11  5:49 ` [RFC PATCH v2 1/4] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro Jim Cromie
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jim Cromie @ 2021-07-11  5:49 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Zhenyu Wang, Zhi Wang, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, dri-devel, linux-kernel,
	intel-gvt-dev, intel-gfx
  Cc: jbaron, Jim Cromie

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/20201204035318.332419-1-jim.cromie@gmail.com/

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(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-13  1:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11  5:49 [RFC PATCH v2 0/4] Allow using dyndbg to replace drm_debug_enabled Jim Cromie
2021-07-11  5:49 ` [RFC PATCH v2 1/4] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro Jim Cromie
2021-07-11 16:17   ` Joe Perches
2021-07-13  1:38     ` jim.cromie
2021-07-11  5:50 ` [RFC PATCH v2 2/4] drm: fixup comment spelling Jim Cromie
2021-07-11  5:50 ` [RFC PATCH v2 3/4] drm: RFC add choice to use dynamic debug in drm-debug Jim Cromie
2021-07-11  5:50 ` [RFC PATCH v2 4/4] i915: map gvt pr_debug categories to bits in parameters/debug_gvt Jim Cromie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).