[PATCH 2/2] drm/amdgpu: improve VM PTE trace points

Alex Deucher alexdeucher at gmail.com
Mon Sep 26 16:56:03 UTC 2016


On Mon, Sep 26, 2016 at 7:47 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Use a separate one for the copy operation and
> log all the interesting parameters.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 20 +++++++++++++++++++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 10 ++++++----
>  2 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> index 0d8d65e..067e5e6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> @@ -247,7 +247,7 @@ DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_mapping,
>             TP_ARGS(mapping)
>  );
>
> -TRACE_EVENT(amdgpu_vm_set_page,
> +TRACE_EVENT(amdgpu_vm_set_ptes,
>             TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,
>                      uint32_t incr, uint32_t flags),
>             TP_ARGS(pe, addr, count, incr, flags),
> @@ -271,6 +271,24 @@ TRACE_EVENT(amdgpu_vm_set_page,
>                       __entry->flags, __entry->count)
>  );
>
> +TRACE_EVENT(amdgpu_vm_copy_ptes,
> +           TP_PROTO(uint64_t pe, uint64_t src, unsigned count),
> +           TP_ARGS(pe, src, count),
> +           TP_STRUCT__entry(
> +                            __field(u64, pe)
> +                            __field(u64, src)
> +                            __field(u32, count)
> +                            ),
> +
> +           TP_fast_assign(
> +                          __entry->pe = pe;
> +                          __entry->src = src;
> +                          __entry->count = count;
> +                          ),
> +           TP_printk("pe=%010Lx, src=%010Lx, count=%u",
> +                     __entry->pe, __entry->src, __entry->count)
> +);
> +
>  TRACE_EVENT(amdgpu_vm_flush,
>             TP_PROTO(uint64_t pd_addr, unsigned ring, unsigned id),
>             TP_ARGS(pd_addr, ring, id),
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index da31189..bc4b22c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -487,7 +487,7 @@ static void amdgpu_vm_do_set_ptes(struct amdgpu_pte_update_params *params,
>                                   unsigned count, uint32_t incr,
>                                   uint32_t flags)
>  {
> -       trace_amdgpu_vm_set_page(pe, addr, count, incr, flags);
> +       trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags);
>
>         if (count < 3) {
>                 amdgpu_vm_write_pte(params->adev, params->ib, pe,
> @@ -516,10 +516,12 @@ static void amdgpu_vm_do_copy_ptes(struct amdgpu_pte_update_params *params,
>                                    unsigned count, uint32_t incr,
>                                    uint32_t flags)
>  {
> -       trace_amdgpu_vm_set_page(pe, addr, count, incr, flags);
> +       uint64_t src = (params->src + (addr >> 12) * 8);
>
> -       amdgpu_vm_copy_pte(params->adev, params->ib, pe,
> -                          (params->src + (addr >> 12) * 8), count);
> +
> +       trace_amdgpu_vm_copy_ptes(pe, src, count);
> +
> +       amdgpu_vm_copy_pte(params->adev, params->ib, pe, src, count);
>  }
>
>  /**
> --
> 2.5.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list