]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/guc: Add new debugfs entry for lfd format output
authorZhanjun Dong <zhanjun.dong@intel.com>
Thu, 27 Nov 2025 17:07:59 +0000 (12:07 -0500)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Thu, 4 Dec 2025 21:43:37 +0000 (13:43 -0800)
Add new debugfs entry "guc_log_lfd", prepared for output guc log
in LFD(Log Format Descriptors) format.

Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: Julia Filipchuk <julia.filipchuk@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20251127170759.2620994-7-zhanjun.dong@intel.com
drivers/gpu/drm/xe/xe_guc_debugfs.c
drivers/gpu/drm/xe/xe_guc_log.c
drivers/gpu/drm/xe/xe_guc_log.h

index efaca259d3e85e9d85153057a1668270b44acf33..23827e87450f1660ed687b71a79631af6c624aae 100644 (file)
@@ -81,6 +81,12 @@ static int guc_log(struct xe_guc *guc, struct drm_printer *p)
        return 0;
 }
 
+static int guc_log_lfd(struct xe_guc *guc, struct drm_printer *p)
+{
+       xe_guc_log_print_lfd(&guc->log, p);
+       return 0;
+}
+
 static int guc_log_dmesg(struct xe_guc *guc, struct drm_printer *p)
 {
        xe_guc_log_print_dmesg(&guc->log);
@@ -117,6 +123,7 @@ static const struct drm_info_list slpc_debugfs_list[] = {
 /* everything else should be added here */
 static const struct drm_info_list pf_only_debugfs_list[] = {
        { "guc_log", .show = guc_debugfs_show, .data = guc_log },
+       { "guc_log_lfd", .show = guc_debugfs_show, .data = guc_log_lfd },
        { "guc_log_dmesg", .show = guc_debugfs_show, .data = guc_log_dmesg },
 };
 
index 40c9e812e9d5213a197d4f9539d745d2e0e5f4d1..d7473b9673bb93a240634536d82338c233b129ca 100644 (file)
@@ -542,9 +542,7 @@ xe_guc_log_add_crash_dump(struct drm_printer *p, struct xe_guc_log_snapshot *sna
        return size;
 }
 
-void
-xe_guc_log_snapshot_print_lfd(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p);
-void
+static void
 xe_guc_log_snapshot_print_lfd(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p)
 {
        struct guc_lfd_file_header header;
@@ -609,6 +607,20 @@ void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p)
        xe_guc_log_snapshot_free(snapshot);
 }
 
+/**
+ * xe_guc_log_print_lfd - dump a copy of the GuC log in LFD format
+ * @log: GuC log structure
+ * @p: the printer object to output to
+ */
+void xe_guc_log_print_lfd(struct xe_guc_log *log, struct drm_printer *p)
+{
+       struct xe_guc_log_snapshot *snapshot;
+
+       snapshot = xe_guc_log_snapshot_capture(log, false);
+       xe_guc_log_snapshot_print_lfd(snapshot, p);
+       xe_guc_log_snapshot_free(snapshot);
+}
+
 int xe_guc_log_init(struct xe_guc_log *log)
 {
        struct xe_device *xe = log_to_xe(log);
index 0bd5e89d75e0aa98f6ef7e8c8a89c40b99b556a3..1b05bb60c1c7f10dd5adb38ab5aba5b639c6c523 100644 (file)
@@ -52,6 +52,7 @@ struct xe_device;
 
 int xe_guc_log_init(struct xe_guc_log *log);
 void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p);
+void xe_guc_log_print_lfd(struct xe_guc_log *log, struct drm_printer *p);
 void xe_guc_log_print_dmesg(struct xe_guc_log *log);
 struct xe_guc_log_snapshot *xe_guc_log_snapshot_capture(struct xe_guc_log *log, bool atomic);
 void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p);