From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Zhanjun Dong <zhanjun.dong@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 2/4] drm/xe/guc: Add new debugfs entry for lfd format output
Date: Fri, 11 Apr 2025 17:34:11 +0200 [thread overview]
Message-ID: <95d22c4d-73b5-47d8-b619-ed466ee0741b@intel.com> (raw)
In-Reply-To: <20250410155853.574830-3-zhanjun.dong@intel.com>
On 10.04.2025 17:58, Zhanjun Dong wrote:
> 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 | 14 ++++++++++++
> drivers/gpu/drm/xe/xe_guc_log.c | 34 +++++++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_guc_log.h | 1 +
> 3 files changed, 49 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c
> index c569ff456e74..6449c9a69b8a 100644
> --- a/drivers/gpu/drm/xe/xe_guc_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c
> @@ -48,6 +48,19 @@ static int guc_log(struct seq_file *m, void *data)
> return 0;
> }
>
> +static int guc_log_lfd(struct seq_file *m, void *data)
this needs to be rebased due to commit e15826bb3c2c ("drm/xe/guc:
Refactor GuC debugfs initialization")
and placed in the pf_only[]
> +{
> + struct xe_guc *guc = node_to_guc(m->private);
> + struct xe_device *xe = guc_to_xe(guc);
> + struct drm_printer p = drm_seq_file_printer(m);
> +
> + xe_pm_runtime_get(xe);
> + xe_guc_log_print_lfd(&guc->log, &p);
> + xe_pm_runtime_put(xe);
> +
> + return 0;
> +}
> +
> static int guc_log_dmesg(struct seq_file *m, void *data)
> {
> struct xe_guc *guc = node_to_guc(m->private);
> @@ -89,6 +102,7 @@ static int guc_pc(struct seq_file *m, void *data)
> static const struct drm_info_list debugfs_list[] = {
> {"guc_info", guc_info, 0},
> {"guc_log", guc_log, 0},
> + {"guc_log_lfd", guc_log_lfd, 0},
> {"guc_log_dmesg", guc_log_dmesg, 0},
> {"guc_ctb", guc_ctb, 0},
> {"guc_pc", guc_pc, 0},
> diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
> index 38039c411387..df849a0ee7e5 100644
> --- a/drivers/gpu/drm/xe/xe_guc_log.c
> +++ b/drivers/gpu/drm/xe/xe_guc_log.c
> @@ -216,6 +216,26 @@ void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_
> }
> }
>
> +static void
> +xe_guc_log_snapshot_print_lfd(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p,
> + struct xe_guc_log *log)
> +{
> + size_t remain;
> + int i;
> +
> + if (!snapshot)
> + return;
> +
> + remain = snapshot->size;
> + for (i = 0; i < snapshot->num_chunks; i++) {
> + size_t size = min(GUC_LOG_CHUNK_SIZE, remain);
> +
> + /* To be add: Output snapshot in LFD format */
what's the point in adding debugfs entry without implementation?
add required function(s) and only *then* extend debugfs
> +
> + remain -= size;
> + }
> +}
> +
> /**
> * xe_guc_log_print_dmesg - dump a copy of the GuC log to dmesg
> * @log: GuC log structure
> @@ -251,6 +271,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 to some useful location
s/to some useful location/to the drm_printer
> + * @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, log);
> + 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 5b896f5fafaf..37ff4d11e6cf 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);
next prev parent reply other threads:[~2025-04-11 15:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 15:58 [PATCH v3 0/4] drm/xe/guc: Add LFD format output for guc log Zhanjun Dong
2025-04-10 15:58 ` [PATCH v3 1/4] drm/xe/guc: Add LFD related abi definitions Zhanjun Dong
2025-04-10 17:50 ` Cavitt, Jonathan
2025-04-10 22:20 ` Dong, Zhanjun
2025-04-10 22:29 ` Cavitt, Jonathan
2025-04-11 15:28 ` Michal Wajdeczko
2025-04-11 21:58 ` Dong, Zhanjun
2025-04-10 15:58 ` [PATCH v3 2/4] drm/xe/guc: Add new debugfs entry for lfd format output Zhanjun Dong
2025-04-10 17:50 ` Cavitt, Jonathan
2025-04-10 22:45 ` Dong, Zhanjun
2025-04-11 15:34 ` Michal Wajdeczko [this message]
2025-04-11 22:40 ` Dong, Zhanjun
2025-04-10 15:58 ` [PATCH v3 3/4] drm/xe/guc: Add GuC log LFD format support Zhanjun Dong
2025-04-10 17:52 ` Cavitt, Jonathan
2025-04-11 16:14 ` Michal Wajdeczko
2025-04-11 22:58 ` Dong, Zhanjun
2025-04-10 15:58 ` [PATCH v3 4/4] drm/xe/guc: Only add GuC crash dump if available Zhanjun Dong
2025-04-10 17:52 ` Cavitt, Jonathan
2025-04-10 16:03 ` ✓ CI.Patch_applied: success for drm/xe/guc: Add LFD format output for guc log (rev3) Patchwork
2025-04-10 16:04 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-10 16:05 ` ✓ CI.KUnit: success " Patchwork
2025-04-10 16:13 ` ✓ CI.Build: " Patchwork
2025-04-10 16:15 ` ✓ CI.Hooks: " Patchwork
2025-04-10 16:17 ` ✓ CI.checksparse: " Patchwork
2025-04-10 16:53 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-10 21:00 ` ✗ 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=95d22c4d-73b5-47d8-b619-ed466ee0741b@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=zhanjun.dong@intel.com \
/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