Re: [PATCH] drm: Print unadorned pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <abrodkin@xxxxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxx>
> Cc: Tobin C. Harding <me@xxxxxxxx>
> Cc: Alex Deucher <alexander.deucher@xxxxxxx>
> Cc: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
> Cc: Chen-Yu Tsai <wens@xxxxxxxx>
> Cc: Christian Gmeiner <christian.gmeiner@xxxxxxxxx>
> Cc: "Christian König" <christian.koenig@xxxxxxx>
> Cc: Cihangir Akturk <cakturk@xxxxxxxxx>
> Cc: CK Hu <ck.hu@xxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: Dave Airlie <airlied@xxxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: "David (ChunMing) Zhou" <David1.Zhou@xxxxxxx>
> Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Gustavo Padovan <gustavo@xxxxxxxxxxx>
> Cc: Harry Wentland <harry.wentland@xxxxxxx>
> Cc: "Heiko Stübner" <heiko@xxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: "Jerry (Fangzhi) Zuo" <Jerry.Zuo@xxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> Cc: "Leo (Sunpeng) Li" <sunpeng.li@xxxxxxx>
> Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> Cc: Matthias Brugger <matthias.bgg@xxxxxxxxx>
> Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>
> Cc: "Michel Dänzer" <michel.daenzer@xxxxxxx>
> Cc: Oded Gabbay <oded.gabbay@xxxxxxxxx>
> Cc: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
> Cc: Rob Clark <robdclark@xxxxxxxxx>
> Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> Cc: Roger He <Hongbo.He@xxxxxxx>
> Cc: Roman Li <Roman.Li@xxxxxxx>
> Cc: Russell King <linux@xxxxxxxxxxxxxxx>
> Cc: Samuel Li <Samuel.Li@xxxxxxx>
> Cc: Sandy Huang <hjc@xxxxxxxxxxxxxx>
> Cc: Sean Paul <seanpaul@xxxxxxxxxxxx>
> Cc: Shirish S <shirish.s@xxxxxxx>
> Cc: Sinclair Yeh <syeh@xxxxxxxxxx>
> Cc: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> Cc: Tom Lendacky <thomas.lendacky@xxxxxxx>
> Cc: Tony Cheng <Tony.Cheng@xxxxxxx>
> Cc: Vincent Abriou <vincent.abriou@xxxxxx>
> Cc: VMware Graphics <linux-graphics-maintainer@xxxxxxxxxx>
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-msm@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-mediatek@xxxxxxxxxxxxxxxxxxx
> Cc: linux-rockchip@xxxxxxxxxxxxxxxxxxx
> Cc: etnaviv@xxxxxxxxxxxxxxxxxxxxx
> Cc: freedreno@xxxxxxxxxxxxxxxxxxxxx
> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
> ---
>  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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux