]> Git Repo - linux.git/commitdiff
drm/xe: Add stats for tlb invalidation count
authorNirmoy Das <[email protected]>
Sat, 10 Aug 2024 19:15:19 +0000 (21:15 +0200)
committerNirmoy Das <[email protected]>
Mon, 12 Aug 2024 17:08:53 +0000 (19:08 +0200)
Add stats for tlb invalidation count which can be viewed with per GT
stat debugfs file.

Example output:
cat /sys/kernel/debug/dri/0/gt0/stats
tlb_inval_count: 22

v2: fix #include order(Tejas)

Cc: Lucas De Marchi <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: Michal Wajdeczko <[email protected]>
Cc: Sai Gowtham Ch <[email protected]>
Reviewed-by: Tejas Upadhyay <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Nirmoy Das <[email protected]>
drivers/gpu/drm/xe/xe_gt_stats.c
drivers/gpu/drm/xe/xe_gt_stats.h
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c

index a054cd52329cbf721f00d62a61220a06a55c3cc0..c7364a5aef8fa34dd97b3d464affdd45910d1a34 100644 (file)
@@ -27,6 +27,7 @@ void xe_gt_stats_incr(struct xe_gt *gt, const enum xe_gt_stats_id id, int incr)
 }
 
 static const char *const stat_description[__XE_GT_STATS_NUM_IDS] = {
+       "tlb_inval_count",
 };
 
 /**
index 1be71ce533db1d6a9c14be5614b56ece4f5168ab..91d944f6c4e4361d14b6c44ebd9f4daed1900e7b 100644 (file)
@@ -10,6 +10,7 @@ struct xe_gt;
 struct drm_printer;
 
 enum xe_gt_stats_id {
+       XE_GT_STATS_ID_TLB_INVAL,
        /* must be the last entry */
        __XE_GT_STATS_NUM_IDS,
 };
index 87cb76a8718c998683fc772a125ab353d43bbaeb..cca9cf536f769326e2993d9c66236a36f3fe9ba6 100644 (file)
@@ -12,6 +12,7 @@
 #include "xe_gt_printk.h"
 #include "xe_guc.h"
 #include "xe_guc_ct.h"
+#include "xe_gt_stats.h"
 #include "xe_mmio.h"
 #include "xe_pm.h"
 #include "xe_sriov.h"
@@ -213,6 +214,7 @@ static int send_tlb_invalidation(struct xe_guc *guc,
                        gt->tlb_invalidation.seqno = 1;
        }
        mutex_unlock(&guc->ct.lock);
+       xe_gt_stats_incr(gt, XE_GT_STATS_ID_TLB_INVAL, 1);
 
        return ret;
 }
This page took 0.076332 seconds and 4 git commands to generate.