Skip to content

Commit

Permalink
drm/xe/trace: Extract bo, vm, vma traces
Browse files Browse the repository at this point in the history
xe_trace.h is starting to get over crowded. Move the traces
related to bo, vm, vma's to its own file.

v2: Update year in License(Gustavo)

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607182943.3572524-2-radhakrishna.sripada@intel.com
  • Loading branch information
Radhakrishna Sripada authored and Matt Roper committed Jun 12, 2024
1 parent 89aa02e commit e46d3f8
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 216 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/xe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ xe-y += xe_bb.o \
xe_tile.o \
xe_tile_sysfs.o \
xe_trace.o \
xe_trace_bo.o \
xe_ttm_sys_mgr.o \
xe_ttm_stolen_mgr.o \
xe_ttm_vram_mgr.o \
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "xe_pm.h"
#include "xe_preempt_fence.h"
#include "xe_res_cursor.h"
#include "xe_trace.h"
#include "xe_trace_bo.h"
#include "xe_ttm_stolen_mgr.h"
#include "xe_vm.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_gt_pagefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "xe_guc.h"
#include "xe_guc_ct.h"
#include "xe_migrate.h"
#include "xe_trace.h"
#include "xe_trace_bo.h"
#include "xe_vm.h"

struct pagefault {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "xe_res_cursor.h"
#include "xe_sched_job.h"
#include "xe_sync.h"
#include "xe_trace.h"
#include "xe_trace_bo.h"
#include "xe_vm.h"

/**
Expand Down
212 changes: 0 additions & 212 deletions drivers/gpu/drm/xe/xe_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <linux/tracepoint.h>
#include <linux/types.h>

#include "xe_bo.h"
#include "xe_bo_types.h"
#include "xe_exec_queue_types.h"
#include "xe_gpu_scheduler_types.h"
#include "xe_gt_tlb_invalidation_types.h"
Expand Down Expand Up @@ -76,58 +74,6 @@ DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_timeout,
TP_ARGS(fence)
);

DECLARE_EVENT_CLASS(xe_bo,
TP_PROTO(struct xe_bo *bo),
TP_ARGS(bo),

TP_STRUCT__entry(
__field(size_t, size)
__field(u32, flags)
__field(struct xe_vm *, vm)
),

TP_fast_assign(
__entry->size = bo->size;
__entry->flags = bo->flags;
__entry->vm = bo->vm;
),

TP_printk("size=%zu, flags=0x%02x, vm=%p",
__entry->size, __entry->flags, __entry->vm)
);

DEFINE_EVENT(xe_bo, xe_bo_cpu_fault,
TP_PROTO(struct xe_bo *bo),
TP_ARGS(bo)
);

TRACE_EVENT(xe_bo_move,
TP_PROTO(struct xe_bo *bo, uint32_t new_placement, uint32_t old_placement,
bool move_lacks_source),
TP_ARGS(bo, new_placement, old_placement, move_lacks_source),
TP_STRUCT__entry(
__field(struct xe_bo *, bo)
__field(size_t, size)
__field(u32, new_placement)
__field(u32, old_placement)
__array(char, device_id, 12)
__field(bool, move_lacks_source)
),

TP_fast_assign(
__entry->bo = bo;
__entry->size = bo->size;
__entry->new_placement = new_placement;
__entry->old_placement = old_placement;
strscpy(__entry->device_id, dev_name(xe_bo_device(__entry->bo)->drm.dev), 12);
__entry->move_lacks_source = move_lacks_source;
),
TP_printk("move_lacks_source:%s, migrate object %p [size %zu] from %s to %s device_id:%s",
__entry->move_lacks_source ? "yes" : "no", __entry->bo, __entry->size,
xe_mem_type_to_name[__entry->old_placement],
xe_mem_type_to_name[__entry->new_placement], __entry->device_id)
);

DECLARE_EVENT_CLASS(xe_exec_queue,
TP_PROTO(struct xe_exec_queue *q),
TP_ARGS(q),
Expand Down Expand Up @@ -386,164 +332,6 @@ DEFINE_EVENT(xe_hw_fence, xe_hw_fence_free,
TP_ARGS(fence)
);

DECLARE_EVENT_CLASS(xe_vma,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma),

TP_STRUCT__entry(
__field(struct xe_vma *, vma)
__field(u32, asid)
__field(u64, start)
__field(u64, end)
__field(u64, ptr)
),

TP_fast_assign(
__entry->vma = vma;
__entry->asid = xe_vma_vm(vma)->usm.asid;
__entry->start = xe_vma_start(vma);
__entry->end = xe_vma_end(vma) - 1;
__entry->ptr = xe_vma_userptr(vma);
),

TP_printk("vma=%p, asid=0x%05x, start=0x%012llx, end=0x%012llx, userptr=0x%012llx,",
__entry->vma, __entry->asid, __entry->start,
__entry->end, __entry->ptr)
)

DEFINE_EVENT(xe_vma, xe_vma_flush,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_pagefault,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_acc,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_fail,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_bind,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_pf_bind,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_unbind,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_userptr_rebind_worker,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_userptr_rebind_exec,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_rebind_worker,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_rebind_exec,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_userptr_invalidate,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_invalidate,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_evict,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DEFINE_EVENT(xe_vma, xe_vma_userptr_invalidate_complete,
TP_PROTO(struct xe_vma *vma),
TP_ARGS(vma)
);

DECLARE_EVENT_CLASS(xe_vm,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm),

TP_STRUCT__entry(
__field(struct xe_vm *, vm)
__field(u32, asid)
),

TP_fast_assign(
__entry->vm = vm;
__entry->asid = vm->usm.asid;
),

TP_printk("vm=%p, asid=0x%05x", __entry->vm,
__entry->asid)
);

DEFINE_EVENT(xe_vm, xe_vm_kill,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_create,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_free,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_cpu_bind,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_restart,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_rebind_worker_enter,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_rebind_worker_retry,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

DEFINE_EVENT(xe_vm, xe_vm_rebind_worker_exit,
TP_PROTO(struct xe_vm *vm),
TP_ARGS(vm)
);

/* GuC */
DECLARE_EVENT_CLASS(xe_guc_ct_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/xe/xe_trace_bo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright © 2024 Intel Corporation
*/

#ifndef __CHECKER__
#define CREATE_TRACE_POINTS
#include "xe_trace_bo.h"
#endif
Loading

0 comments on commit e46d3f8

Please sign in to comment.