Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "Dong, Zhanjun" <zhanjun.dong@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Harrison, John C" <john.c.harrison@intel.com>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	"Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v7 3/6] drm/xe/guc: Split engine state print between xe_hw_engine vs xe_guc_capture
Date: Wed, 12 Feb 2025 18:50:10 +0000	[thread overview]
Message-ID: <225b51b753b0dc44dfdbdd522ca9c13c90643c1c.camel@intel.com> (raw)
In-Reply-To: <0004aa7f-d6a6-4122-93b7-bae80f60009e@intel.com>

On Tue, 2025-02-11 at 17:48 -0500, Dong, Zhanjun wrote:
> 
> 
> On 2025-02-10 6:32 p.m., Alan Previn wrote:
> > Relocate the xe_engine_snapshot_print function from xe_guc_capture.c
> > into xe_hw_engine.c but split out the GuC-Err-Capture register printing
> > portion out into a separate helper inside xe_guc_capture.c so that
> > we can have a clear separation between printing the general engine info
> > vs GuC-Err-Capture node's register list.
> > 
> >     v7: - Fix function name to respect "xe_hw_engine" name space. (Rodrigo)
> >         - Remove additional newline in engine dump (Jose Souza) +
> >           ensure changes didn't break mesa's aubinator tool (Rodrigo)
> > 
> > Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
> > ---
> >   drivers/gpu/drm/xe/xe_devcoredump.c |  2 +-
> >   drivers/gpu/drm/xe/xe_guc_capture.c | 79 +++++++++++++----------------
> >   drivers/gpu/drm/xe/xe_guc_capture.h |  4 +-
> >   drivers/gpu/drm/xe/xe_hw_engine.c   | 29 ++++++++++-
> >   drivers/gpu/drm/xe/xe_hw_engine.h   |  1 +
> >   5 files changed, 67 insertions(+), 48 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
> > index 006041997550..7a4610d2ea4f 100644
> > --- a/drivers/gpu/drm/xe/xe_devcoredump.c
> > +++ b/drivers/gpu/drm/xe/xe_devcoredump.c
> > @@ -128,7 +128,7 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
> >         drm_puts(&p, "\n**** HW Engines ****\n");
> >         for (i = 0; i < XE_NUM_HW_ENGINES; i++)
> >                 if (ss->hwe[i])
> > -                       xe_engine_snapshot_print(ss->hwe[i], &p);
> > +                       xe_hw_engine_snapshot_print(ss->hwe[i], &p);
> >   
> >         drm_puts(&p, "\n**** VM state ****\n");
> >         xe_vm_snapshot_print(ss->vm, &p);
> > diff --git a/drivers/gpu/drm/xe/xe_guc_capture.c b/drivers/gpu/drm/xe/xe_guc_capture.c
> > index f118e8dd0ecb..76c20ff97864 100644
> > --- a/drivers/gpu/drm/xe/xe_guc_capture.c
> > +++ b/drivers/gpu/drm/xe/xe_guc_capture.c
> > @@ -917,9 +917,10 @@ guc_capture_init_node(struct xe_guc *guc, struct xe_guc_capture_snapshot *node)
> >    * --------------------
> >    *      --> xe_devcoredump_read->
> >    *             L--> xxx_snapshot_print
> > - *                    L--> xe_engine_snapshot_print
> > - *                         Print register lists values saved at
> > - *                         guc->capture->outlist
> > + *                    L--> xe_hw_engine_print --> xe_hw_engine_snapshot_print
> > + *                          L--> xe_guc_capture_snapshot_print
> > + *                               Print register lists values saved in matching
> > + *                               node from guc->capture->outlist
> >    *
> >    */
> >   
> > @@ -1655,22 +1656,16 @@ guc_capture_find_reg(struct gcap_reg_list_info *reginfo, u32 addr, u32 flags)
> >   }
> >   
> >   static void
> > -snapshot_print_by_list_order(struct xe_hw_engine_snapshot *snapshot, struct drm_printer *p,
> > -                            u32 type, const struct __guc_mmio_reg_descr_group *list)
> > +print_noderegs_by_list_order(struct xe_guc *guc, struct gcap_reg_list_info *reginfo,
> > +                            const struct __guc_mmio_reg_descr_group *list, struct drm_printer *p)
> >   {
> > -       struct xe_gt *gt = snapshot->hwe->gt;
> > -       struct xe_guc *guc = &gt->uc.guc;
> > -       struct gcap_reg_list_info *reginfo = NULL;
> > -       u32 i, last_value = 0;
> > +       u32 last_value, i;
> >         bool is_ext, low32_ready = false;
> >   
> >         if (!list || !list->list || list->num_regs == 0)
> >                 return;
> >   
> > -       XE_WARN_ON(!snapshot->matched_node);
> > -
> >         is_ext = list == guc->capture->extlists;
> > -       reginfo = &snapshot->matched_node->reginfo[type];
> >   
> >         /*
> >          * loop through descriptor first and find the register in the node
> > @@ -1740,8 +1735,8 @@ snapshot_print_by_list_order(struct xe_hw_engine_snapshot *snapshot, struct drm_
> >   
> >                                 group = FIELD_GET(GUC_REGSET_STEERING_GROUP, reg_desc->flags);
> >                                 instance = FIELD_GET(GUC_REGSET_STEERING_INSTANCE, reg_desc->flags);
> > -                               dss = xe_gt_mcr_steering_info_to_dss_id(gt, group, instance);
> > -
> > +                               dss = xe_gt_mcr_steering_info_to_dss_id(guc_to_gt(guc), group,
> > +                                                                       instance);
> >                                 drm_printf(p, "\t%s[%u]: 0x%08x\n", reg_desc->regname, dss, value);
> >                         } else {
> >                                 drm_printf(p, "\t%s: 0x%08x\n", reg_desc->regname, value);
> > @@ -1760,13 +1755,18 @@ snapshot_print_by_list_order(struct xe_hw_engine_snapshot *snapshot, struct drm_
> >   }
> >   
> >   /**
> > - * xe_engine_snapshot_print - Print out a given Xe HW Engine snapshot.
> > - * @snapshot: Xe HW Engine snapshot object.
> > + * xe_guc_capture_snapshot_print - Print out a the contents of a provided Guc-Err-Capture node
> > + * @guc : Target GuC for operation.
> > + * @node: GuC Error Capture register dump node.
> >    * @p: drm_printer where it will be printed out.
> >    *
> > - * This function prints out a given Xe HW Engine snapshot object.
> > + * This function prints out a register dump of a GuC-Err-Capture node that was retrieved
> > + * earlier either by GuC-FW reporting or by manual capture depending on how the
> > + * caller (typically xe_hw_engine_snapshot) was invoked and used.
> >    */
> > -void xe_engine_snapshot_print(struct xe_hw_engine_snapshot *snapshot, struct drm_printer *p)
> > +
> > +void xe_guc_capture_snapshot_print(struct xe_guc *guc, struct xe_guc_capture_snapshot *node,
> > +                                  struct drm_printer *p)
> >   {
> >         const char *grptype[GUC_STATE_CAPTURE_GROUP_TYPE_MAX] = {
> >                 "full-capture",
> > @@ -1774,45 +1774,36 @@ void xe_engine_snapshot_print(struct xe_hw_engine_snapshot *snapshot, struct drm
> >         };
> >         int type;
> >         const struct __guc_mmio_reg_descr_group *list;
> > -       enum guc_capture_list_class_type capture_class;
> >         struct xe_gt *gt;
> >   
> > -       if (!snapshot)
> > +       if (!guc)
> >                 return;
> > -
> > -       gt = snapshot->hwe->gt;
> > -
> > -       if (!snapshot->matched_node)
> > +       gt = guc_to_gt(guc);
> > +       if (!node) {
> node was called snapshot befrore.
alan: yes i did - previously snapshot was one-level up of xe_hw_engine that included other things
alongside the matching node from guc-err-capture but with this patch i wanted to streamline this
this helper since it only needs access to the node and nothing else. 
> > +               xe_gt_warn(gt, "GuC Capture printing without node!\n");
> >                 return;
> > +       }
> > +       if (!p) {
> New printer pointer check, good.
> > +               xe_gt_warn(gt, "GuC Capture printing without printer!\n");
> > +               return;
> > +       }
> >   
> > -       xe_gt_assert(gt, snapshot->hwe);
> > -
> > -       capture_class = xe_engine_class_to_guc_capture_class(snapshot->hwe->class);
> > -
> > -       drm_printf(p, "%s (physical), logical instance=%d\n",
> > -                  snapshot->name ? snapshot->name : "",
> > -                  snapshot->logical_instance);
> >         drm_printf(p, "\tCapture_source: %s\n",
> > -                  snapshot->matched_node->source == XE_ENGINE_CAPTURE_SOURCE_GUC ?
> > +                  node->source == XE_ENGINE_CAPTURE_SOURCE_GUC ?
> >                    "GuC" : "Manual");
> > -       drm_printf(p, "\tCoverage: %s\n", grptype[snapshot->matched_node->is_partial]);
> > -       drm_printf(p, "\tForcewake: domain 0x%x, ref %d\n",
> > -                  snapshot->forcewake.domain, snapshot->forcewake.ref);
> > -       drm_printf(p, "\tReserved: %s\n",
> > -                  str_yes_no(snapshot->kernel_reserved));
> > +       drm_printf(p, "\tCoverage: %s\n", grptype[node->is_partial]);
> Yes, I see the printout order was changed:
> vcs0 (physical), logical instance=0
>         Capture_source: GuC
>         Coverage: full-capture
>         Forcewake: domain 0x8, ref 1
>         Reserved: no
>         FORCEWAKE_GT: 0x00000000
> to:
> vcs0 (physical), logical instance=0
>         Forcewake: domain 0x8, ref 1
>         Reserved: no
>         Capture_source: GuC
>         Coverage: full-capture
>         FORCEWAKE_GT: 0x00000000
> The xe_exec_capture igt test can handle this change, as long as it not 
> cause other tools stop working, I'm fine.
> 
> Reviewed-by: Zhanjun Dong <zhanjun.dong@intel.com>

alan: Thanks for the RB and yes - we tested it with mesa tool also.

alan:snip

  reply	other threads:[~2025-02-12 18:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 23:32 [PATCH v7 0/6] Maintenence of devcoredump <-> GuC-Err-Capture plumbing Alan Previn
2025-02-10 23:32 ` [PATCH v7 1/6] drm/xe/guc: Rename __guc_capture_parsed_output Alan Previn
2025-02-10 23:32 ` [PATCH v7 2/6] drm/xe/guc: Don't store capture nodes in xe_devcoredump_snapshot Alan Previn
2025-02-10 23:32 ` [PATCH v7 3/6] drm/xe/guc: Split engine state print between xe_hw_engine vs xe_guc_capture Alan Previn
2025-02-11 22:48   ` Dong, Zhanjun
2025-02-12 18:50     ` Teres Alexis, Alan Previn [this message]
2025-02-10 23:32 ` [PATCH v7 4/6] drm/xe/guc: Move xe_hw_engine_snapshot creation back to xe_hw_engine.c Alan Previn
2025-02-12 17:19   ` Dong, Zhanjun
2025-02-10 23:32 ` [PATCH v7 5/6] drm/xe/xe_hw_engine: Update xe_hw_engine capture for debugfs/gt_reset Alan Previn
2025-02-11 17:34   ` Teres Alexis, Alan Previn
2025-02-12 18:24     ` Dong, Zhanjun
2025-02-10 23:32 ` [PATCH v7 6/6] drm/xe/guc: Update comments on GuC-Err-Capture flows Alan Previn
2025-02-11 23:09   ` Dong, Zhanjun
2025-02-12 18:54     ` Teres Alexis, Alan Previn
2025-02-11  0:38 ` ✓ CI.Patch_applied: success for Maintenence of devcoredump <-> GuC-Err-Capture plumbing Patchwork
2025-02-11  0:38 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-11  0:39 ` ✓ CI.KUnit: success " Patchwork
2025-02-11  0:56 ` ✓ CI.Build: " Patchwork
2025-02-11  0:57 ` ✗ CI.Hooks: failure " Patchwork
2025-02-11  0:58 ` ✗ CI.checksparse: warning " Patchwork
2025-02-11  1:18 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-11 13:01 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-13  0:56   ` Teres Alexis, Alan Previn

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=225b51b753b0dc44dfdbdd522ca9c13c90643c1c.camel@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=john.c.harrison@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --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