[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220107052942.1349447-12-jim.cromie@gmail.com>
Date: Thu, 6 Jan 2022 22:29:34 -0700
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, gregkh@...uxfoundation.org,
linux@...musvillemoes.dk, rostedt@...dmis.org,
mathieu.desnoyers@...icios.com, daniel.vetter@...ll.ch,
seanpaul@...omium.org, robdclark@...il.com,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: quic_saipraka@...cinc.com, will@...nel.org,
catalin.marinas@....com, quic_psodagud@...cinc.com, maz@...nel.org,
arnd@...db.de, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, mingo@...hat.com,
jim.cromie@...il.com
Subject: [PATCH v11 11/19] drm_print: wrap drm_dev_dbg in _dynamic_func_call_no_desc
make drm_dev_dbg() macro CONFIG_DRM_USE_DYNAMIC_DEBUG dependent:
=N direct forwarding: drm_dev_dbg -> __drm_dev_dbg()
=Y wrap __drm_dev_dbg in _dynamic_func_call_no_desc().
This adds the metadata which creates a /proc/dynamic_debug/control
entry for each callsite, and exposes it for selective enablement.
NB: include header in header so wrapper is available
proof of function:
bash-5.1# grep 'ring test' /proc/dynamic_debug/control
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:453 [amdgpu]amdgpu_ring_test_helper =xf "ring test on %s succeeded\012"
less
452 else
453 DRM_DEV_DEBUG(adev->dev, "ring test on %s succeeded\n",
454 ring->name);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c lines 417-454/458 byte 12536/12575 100% (press RETURN)
new prdbg callsite counts:
bash-5.1# drms_load
[ 20.533990] dyndbg: 1 debug prints in module drm
[ 20.535637] ACPI: bus type drm_connector registered
[ 20.624951] dyndbg: 2 debug prints in module ttm
[ 20.627853] dyndbg: 8 debug prints in module video
[ 20.922442] dyndbg: 127 debug prints in module i915
[ 20.984159] AMD-Vi: AMD IOMMUv2 functionality not available on this system - This is not a bug.
[ 21.310216] dyndbg: 2196 debug prints in module amdgpu
[ 21.324537] [drm] amdgpu kernel modesetting enabled.
[ 21.325092] amdgpu: CRAT table not found
[ 21.325512] amdgpu: Virtual CRAT table created for CPU
[ 21.326009] amdgpu: Topology: Add CPU node
[ 21.401137] dyndbg: 3 debug prints in module wmi
[ 21.532540] dyndbg: 3 debug prints in module nouveau
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
include/drm/drm_print.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index f8fa5af11310..1eef315a0a65 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -383,8 +383,14 @@ void __drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
} \
})
+#if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG)
#define drm_dev_dbg(dev, eCat, fmt, ...) \
__drm_dev_dbg(dev, eCat, fmt, ##__VA_ARGS__)
+#else
+#define drm_dev_dbg(dev, eCat, fmt, ...) \
+ _dynamic_func_call_no_desc(fmt, __drm_dev_dbg, \
+ dev, eCat, fmt, ##__VA_ARGS__)
+#endif
/**
* DRM_DEV_DEBUG() - Debug output for generic drm code
--
2.33.1
Powered by blists - more mailing lists