summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c5
-rw-r--r--drivers/gpu/drm/xe/xe_pt.c5
-rw-r--r--drivers/gpu/drm/xe/xe_trace.h50
3 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index 1cb4d3a6bc57..4d179357ce65 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -7,6 +7,7 @@
#include "xe_gt_tlb_invalidation.h"
#include "xe_guc.h"
#include "xe_guc_ct.h"
+#include "xe_trace.h"
static struct xe_gt *
guc_to_gt(struct xe_guc *guc)
@@ -82,6 +83,7 @@ static int send_tlb_invalidation(struct xe_guc *guc,
fence->seqno = seqno;
list_add_tail(&fence->link,
&gt->tlb_invalidation.pending_fences);
+ trace_xe_gt_tlb_invalidation_fence_send(fence);
}
action[1] = seqno;
gt->tlb_invalidation.seqno = (gt->tlb_invalidation.seqno + 1) %
@@ -194,7 +196,10 @@ int xe_guc_tlb_invalidation_done_handler(struct xe_guc *guc, u32 *msg, u32 len)
fence = list_first_entry_or_null(&gt->tlb_invalidation.pending_fences,
typeof(*fence), link);
+ if (fence)
+ trace_xe_gt_tlb_invalidation_fence_recv(fence);
if (fence && tlb_invalidation_seqno_past(gt, fence->seqno)) {
+ trace_xe_gt_tlb_invalidation_fence_signal(fence);
list_del(&fence->link);
dma_fence_signal(&fence->base);
dma_fence_put(&fence->base);
diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
index 65a6f54b22a9..b220d1d5cfe3 100644
--- a/drivers/gpu/drm/xe/xe_pt.c
+++ b/drivers/gpu/drm/xe/xe_pt.c
@@ -13,6 +13,7 @@
#include "xe_pt_walk.h"
#include "xe_vm.h"
#include "xe_res_cursor.h"
+#include "xe_trace.h"
#include "xe_ttm_stolen_mgr.h"
struct xe_pt_dir {
@@ -1493,6 +1494,7 @@ static void invalidation_fence_cb(struct dma_fence *fence,
struct invalidation_fence *ifence =
container_of(cb, struct invalidation_fence, cb);
+ trace_xe_gt_tlb_invalidation_fence_cb(&ifence->base);
queue_work(system_wq, &ifence->work);
dma_fence_put(ifence->fence);
}
@@ -1502,6 +1504,7 @@ static void invalidation_fence_work_func(struct work_struct *w)
struct invalidation_fence *ifence =
container_of(w, struct invalidation_fence, work);
+ trace_xe_gt_tlb_invalidation_fence_work_func(&ifence->base);
xe_gt_tlb_invalidation(ifence->gt, &ifence->base);
}
@@ -1511,6 +1514,8 @@ static int invalidation_fence_init(struct xe_gt *gt,
{
int ret;
+ trace_xe_gt_tlb_invalidation_fence_create(&ifence->base);
+
spin_lock_irq(&gt->tlb_invalidation.lock);
dma_fence_init(&ifence->base.base, &invalidation_fence_ops,
&gt->tlb_invalidation.lock,
diff --git a/drivers/gpu/drm/xe/xe_trace.h b/drivers/gpu/drm/xe/xe_trace.h
index d9f921d46b53..b5b0f1bff7ec 100644
--- a/drivers/gpu/drm/xe/xe_trace.h
+++ b/drivers/gpu/drm/xe/xe_trace.h
@@ -16,10 +16,60 @@
#include "xe_engine_types.h"
#include "xe_gpu_scheduler_types.h"
#include "xe_gt_types.h"
+#include "xe_gt_tlb_invalidation_types.h"
#include "xe_guc_engine_types.h"
#include "xe_sched_job.h"
#include "xe_vm_types.h"
+DECLARE_EVENT_CLASS(xe_gt_tlb_invalidation_fence,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence),
+
+ TP_STRUCT__entry(
+ __field(u64, fence)
+ __field(int, seqno)
+ ),
+
+ TP_fast_assign(
+ __entry->fence = (u64)fence;
+ __entry->seqno = fence->seqno;
+ ),
+
+ TP_printk("fence=0x%016llx, seqno=%d",
+ __entry->fence, __entry->seqno)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_create,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence,
+ xe_gt_tlb_invalidation_fence_work_func,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_cb,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_send,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_recv,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_signal,
+ TP_PROTO(struct xe_gt_tlb_invalidation_fence *fence),
+ TP_ARGS(fence)
+);
+
DECLARE_EVENT_CLASS(xe_bo,
TP_PROTO(struct xe_bo *bo),
TP_ARGS(bo),