On Wed, Apr 18, 2018 at 12:24:50PM +0300, Alexey Brodkin wrote:
> After commit ad67b74 ("printk: hash addresses printed with %p")
> pointers are being hashed when printed. However, this makes
> debug output completely useless. Switch to %px in order to see the
> unadorned kernel pointers.
>
> This was done with the following one-liner:
> find drivers/gpu/drm -type f -name "*.c" -exec sed -r -i
> '/DRM_DEBUG|KERN_DEBUG|pr_debug/ s/%p\b/%px/g' {} +
>
> Signed-off-by: Alexey Brodkin <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: Tobin C. Harding <[email protected]>
> Cc: Alex Deucher <[email protected]>
> Cc: Andrey Grodzovsky <[email protected]>
> Cc: Arnd Bergmann <[email protected]>
> Cc: Benjamin Gaignard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: Christian Gmeiner <[email protected]>
> Cc: "Christian König" <[email protected]>
> Cc: Cihangir Akturk <[email protected]>
> Cc: CK Hu <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: Dave Airlie <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: "David (ChunMing) Zhou" <[email protected]>
> Cc: Gerd Hoffmann <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Gustavo Padovan <[email protected]>
> Cc: Harry Wentland <[email protected]>
> Cc: "Heiko Stübner" <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Jani Nikula <[email protected]>
> Cc: "Jerry (Fangzhi) Zuo" <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: "Leo (Sunpeng) Li" <[email protected]>
> Cc: Lucas Stach <[email protected]>
> Cc: Maarten Lankhorst <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: "Michel Dänzer" <[email protected]>
> Cc: Oded Gabbay <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Rob Clark <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: Roger He <[email protected]>
> Cc: Roman Li <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: Samuel Li <[email protected]>
> Cc: Sandy Huang <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: Shirish S <[email protected]>
> Cc: Sinclair Yeh <[email protected]>
> Cc: Thomas Hellstrom <[email protected]>
> Cc: Tom Lendacky <[email protected]>
> Cc: Tony Cheng <[email protected]>
> Cc: Vincent Abriou <[email protected]>
> Cc: VMware Graphics <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 14 +++----
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c | 2 +-
> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 10 ++---
> drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 +-
> drivers/gpu/drm/amd/amdkfd/kfd_process.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 18 ++++-----
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 +++----
> .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
> drivers/gpu/drm/armada/armada_gem.c | 12 +++---
> drivers/gpu/drm/drm_atomic.c | 44
> +++++++++++-----------
> drivers/gpu/drm/drm_bufs.c | 8 ++--
> drivers/gpu/drm/drm_dp_mst_topology.c | 4 +-
> drivers/gpu/drm/drm_lease.c | 6 +--
> drivers/gpu/drm/drm_lock.c | 2 +-
> drivers/gpu/drm/drm_scatter.c | 4 +-
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 6 +--
> drivers/gpu/drm/i810/i810_dma.c | 2 +-
> drivers/gpu/drm/i915/i915_perf.c | 2 +-
> drivers/gpu/drm/i915/intel_display.c | 2 +-
> drivers/gpu/drm/i915/intel_guc_ct.c | 4 +-
> drivers/gpu/drm/i915/intel_guc_submission.c | 2 +-
> drivers/gpu/drm/i915/intel_uc_fw.c | 2 +-
> drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +-
> drivers/gpu/drm/mga/mga_warp.c | 2 +-
> drivers/gpu/drm/msm/msm_drv.c | 4 +-
> drivers/gpu/drm/qxl/qxl_cmd.c | 4 +-
> drivers/gpu/drm/qxl/qxl_fb.c | 2 +-
> drivers/gpu/drm/qxl/qxl_ttm.c | 2 +-
> drivers/gpu/drm/radeon/radeon_display.c | 2 +-
> drivers/gpu/drm/radeon/radeon_dp_mst.c | 12 +++---
> drivers/gpu/drm/radeon/radeon_object.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 2 +-
> drivers/gpu/drm/savage/savage_bci.c | 2 +-
> drivers/gpu/drm/sti/sti_gdp.c | 4 +-
> drivers/gpu/drm/sti/sti_mixer.c | 2 +-
> drivers/gpu/drm/sun4i/sun4i_crtc.c | 4 +-
> drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
> drivers/gpu/drm/udl/udl_fb.c | 2 +-
> drivers/gpu/drm/via/via_dma.c | 4 +-
> drivers/gpu/drm/via/via_irq.c | 2 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +-
> 45 files changed, 120 insertions(+), 120 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 1d6e1479da38..32e85fe83152 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -438,7 +438,7 @@ static int add_bo_to_vm(struct amdgpu_device *adev,
> struct kgd_mem *mem,
> if (!bo_va_entry)
> return -ENOMEM;
>
> - pr_debug("\t add VA 0x%llx - 0x%llx to vm %p\n", va,
> + pr_debug("\t add VA 0x%llx - 0x%llx to vm %px\n", va,
> va + bo_size, vm);
>
> /* Add BO to VM internal data structures*/
<snip>
As others have pointed out, please do not do this. Use %pK as needed.
And perhaps revisit some of the "need" for these pointers at all in the
first place...
thanks,
greg k-h
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx