Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhanjun Dong <zhanjun.dong@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Zhanjun Dong <zhanjun.dong@intel.com>
Subject: [PATCH v7 6/6] drm/xe/guc: Add new debugfs entry for lfd format output
Date: Thu, 28 Aug 2025 13:41:59 -0400	[thread overview]
Message-ID: <20250828174159.1232994-7-zhanjun.dong@intel.com> (raw)
In-Reply-To: <20250828174159.1232994-1-zhanjun.dong@intel.com>

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>
---
 drivers/gpu/drm/xe/xe_guc_debugfs.c |  7 +++++++
 drivers/gpu/drm/xe/xe_guc_log.c     | 18 +++++++++++++++---
 drivers/gpu/drm/xe/xe_guc_log.h     |  1 +
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c
index 0b102ab46c4d..6cbc4240a3bd 100644
--- a/drivers/gpu/drm/xe/xe_guc_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c
@@ -85,6 +85,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);
@@ -121,6 +127,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 },
 };
 
diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
index 589975904153..21c464f2f14c 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.c
+++ b/drivers/gpu/drm/xe/xe_guc_log.c
@@ -568,9 +568,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;
@@ -635,6 +633,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);
diff --git a/drivers/gpu/drm/xe/xe_guc_log.h b/drivers/gpu/drm/xe/xe_guc_log.h
index f1e2b0be90a9..0f6299886010 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.h
+++ b/drivers/gpu/drm/xe/xe_guc_log.h
@@ -40,6 +40,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);
-- 
2.34.1


  parent reply	other threads:[~2025-08-28 17:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 17:41 [PATCH v7 0/6] drm/xe/guc: Add LFD format output for guc log Zhanjun Dong
2025-08-28 17:41 ` [PATCH v7 1/6] drm/xe/guc: Add log init config abi definitions Zhanjun Dong
2025-10-09 11:49   ` Michal Wajdeczko
2025-10-20 23:11   ` Julia Filipchuk
2025-08-28 17:41 ` [PATCH v7 2/6] drm/xe/guc: Add LFD related " Zhanjun Dong
2025-10-20 23:11   ` Julia Filipchuk
2025-08-28 17:41 ` [PATCH v7 3/6] drm/xe/guc: Add GuC log init config in LFD format Zhanjun Dong
2025-10-20 23:44   ` Julia Filipchuk
2025-11-25 18:19     ` Dong, Zhanjun
2025-11-25 19:47       ` Julia Filipchuk
2025-08-28 17:41 ` [PATCH v7 4/6] drm/xe/guc: Add GuC log event buffer output " Zhanjun Dong
2025-10-20 23:36   ` Julia Filipchuk
2025-11-26 23:05     ` Dong, Zhanjun
2025-08-28 17:41 ` [PATCH v7 5/6] drm/xe/guc: Only add GuC crash dump if available Zhanjun Dong
2025-10-20 23:11   ` Julia Filipchuk
2025-11-26 22:59     ` Dong, Zhanjun
2025-08-28 17:41 ` Zhanjun Dong [this message]
2025-10-20 23:12   ` [PATCH v7 6/6] drm/xe/guc: Add new debugfs entry for lfd format output Julia Filipchuk
2025-08-28 19:17 ` ✗ CI.checkpatch: warning for drm/xe/guc: Add LFD format output for guc log (rev7) Patchwork
2025-08-28 19:19 ` ✓ CI.KUnit: success " Patchwork
2025-08-28 19:56 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-29  3:03 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250828174159.1232994-7-zhanjun.dong@intel.com \
    --to=zhanjun.dong@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox