[PATCH i-g-t] lib/xe_gt: Assertion related to xe_gt_stats_get_count
priyanka.dandamudi at intel.com
priyanka.dandamudi at intel.com
Tue Jul 29 05:47:03 UTC 2025
From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
Currently, when the specific gt stats file is not found, it fails with
an assertion. Due to this the test using this function also fails.
In general, this lib function is just to count the stats count, test
using this need not fail.So, now the function will warn the failure
when file not found and return -1 as count.
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
---
lib/xe/xe_gt.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/xe/xe_gt.c b/lib/xe/xe_gt.c
index afb757bfa..ed19bec74 100644
--- a/lib/xe/xe_gt.c
+++ b/lib/xe/xe_gt.c
@@ -185,8 +185,11 @@ int xe_gt_stats_get_count(int fd, int gt, const char *stat)
minor(st.st_rdev), gt);
f = fopen(path, "r");
- igt_assert_f(f, "Failed to open /sys/kernel/debug/dri/%d/gt%d/stats",
- minor(st.st_rdev), gt);
+ if (!f) {
+ igt_warn("Failed to open /sys/kernel/debug/dri/%d/gt%d/stats",
+ minor(st.st_rdev), gt);
+ return -1;
+ }
while (fgets(tlb_path, sizeof(tlb_path), f)) {
if (strstr(tlb_path, stat) != NULL) {
--
2.34.1
More information about the igt-dev
mailing list