From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>,
Jonathan Cavitt <jonathan.cavitt@intel.com>,
ashutosh.dixit@intel.com
Subject: Re: [PATCH 3/5] drm/xe: Add xe_gt_dbg_printer
Date: Thu, 5 Dec 2024 20:51:27 +0100 [thread overview]
Message-ID: <2264e95d-18a0-4877-a2e4-02a4f91ebaa0@intel.com> (raw)
In-Reply-To: <20241205182240.3463027-4-lucas.demarchi@intel.com>
On 05.12.2024 19:22, Lucas De Marchi wrote:
> Like the info/err, add a printer for dbg messages.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_printk.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
> index 5dc71394372d6..1f27d9f75bae1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_printk.h
> +++ b/drivers/gpu/drm/xe/xe_gt_printk.h
> @@ -60,6 +60,13 @@ static inline void __xe_gt_printfn_info(struct drm_printer *p, struct va_format
> xe_gt_info(gt, "%pV", vaf);
> }
>
> +static inline void __xe_gt_printfn_dbg(struct drm_printer *p, struct va_format *vaf)
> +{
> + struct xe_gt *gt = p->arg;
> +
> + xe_gt_dbg(gt, "%pV", vaf);
I'm afraid it's not that easy as drm_dbg() will likely use this function
as context so all outputs will look the same like:
[drm:__xe_gt_printfn_dbg [xe]] ...
see my old attempt to add new dbg printer that should work as expected
[1] https://patchwork.freedesktop.org/series/134630/
> +}
> +
> /**
> * xe_gt_err_printer - Construct a &drm_printer that outputs to xe_gt_err()
> * @gt: the &xe_gt pointer to use in xe_gt_err()
> @@ -90,4 +97,19 @@ static inline struct drm_printer xe_gt_info_printer(struct xe_gt *gt)
> return p;
> }
>
> +/**
> + * xe_gt_dbg_printer - Construct a &drm_printer that outputs to xe_gt_dbg()
> + * @gt: the &xe_gt pointer to use in xe_gt_dbg()
> + *
> + * Return: The &drm_printer object.
> + */
> +static inline struct drm_printer xe_gt_dbg_printer(struct xe_gt *gt)
> +{
> + struct drm_printer p = {
> + .printfn = __xe_gt_printfn_dbg,
> + .arg = gt,
> + };
> + return p;
> +}
> +
> #endif
next prev parent reply other threads:[~2024-12-05 19:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 18:22 [PATCH 0/5] reg_sr/whitelist fixes and refactors Lucas De Marchi
2024-12-05 18:22 ` [PATCH 1/5] drm/xe/reg_sr: Remove register pool Lucas De Marchi
2024-12-05 18:37 ` Matt Roper
2024-12-05 18:43 ` Lucas De Marchi
2024-12-05 18:22 ` [PATCH 2/5] drm/xe/reg_sr: Write all whitelist slots Lucas De Marchi
2024-12-05 19:25 ` Matt Roper
2024-12-06 5:03 ` Lucas De Marchi
2024-12-05 22:51 ` John Harrison
2024-12-06 5:02 ` Lucas De Marchi
2024-12-05 18:22 ` [PATCH 3/5] drm/xe: Add xe_gt_dbg_printer Lucas De Marchi
2024-12-05 19:27 ` Matt Roper
2024-12-05 19:51 ` Michal Wajdeczko [this message]
2024-12-05 18:22 ` [PATCH 4/5] drmxe/reg_sr: Convert whitelist to gt logging Lucas De Marchi
2024-12-05 19:27 ` Matt Roper
2024-12-05 18:22 ` [PATCH 5/5] drm/xe: Apply whitelist to engine save-restore Lucas De Marchi
2024-12-05 20:42 ` Matt Roper
2024-12-06 5:06 ` Lucas De Marchi
2024-12-09 21:13 ` Lucas De Marchi
2024-12-05 23:14 ` John Harrison
2024-12-09 21:53 ` Lucas De Marchi
2024-12-05 18:32 ` ✓ CI.Patch_applied: success for reg_sr/whitelist fixes and refactors Patchwork
2024-12-05 18:32 ` ✗ CI.checkpatch: warning " Patchwork
2024-12-05 18:34 ` ✓ CI.KUnit: success " Patchwork
2024-12-05 19:06 ` ✓ CI.Build: " Patchwork
2024-12-05 19:08 ` ✓ CI.Hooks: " Patchwork
2024-12-05 19:10 ` ✓ CI.checksparse: " Patchwork
2024-12-05 19:30 ` ✗ Xe.CI.BAT: failure " Patchwork
2024-12-05 20:32 ` ✗ Xe.CI.Full: " 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=2264e95d-18a0-4877-a2e4-02a4f91ebaa0@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@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