diff mbox series

[v2,1/2] drm/i915/gt: Create per-tile debugfs files

Message ID 20230301110258.2140955-2-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Some debugfs refactoring and improvements | expand

Commit Message

Andi Shyti March 1, 2023, 11:02 a.m. UTC
To support multi-GT configurations, we need to generate
independent debug files for each GT.

To achieve this create a separate directory for each GT under the
debugfs directory. For instance, in a system with two tiles, the
debugfs structure would look like this:

/sys/kernel/debug/dri
                  └── 0
                      ├── gt0
                      │   ├── drpc
                      │   ├── engines
                      │   ├── forcewake
                      │   ├── frequency
                      │   └── rps_boost
                      └── gt1
                      :   ├── drpc
                      :   ├── engines
                      :   ├── forcewake
                          ├── frequency
                          └── rps_boost

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
 drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
 4 files changed, 11 insertions(+), 2 deletions(-)

Comments

Sripada, Radhakrishna March 1, 2023, 9:32 p.m. UTC | #1
> -----Original Message-----
> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Andi
> Shyti
> Sent: Wednesday, March 1, 2023 3:03 AM
> To: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>; Andi Shyti
> <andi@etezian.org>; Patelczyk, Maciej <maciej.patelczyk@intel.com>; Andi
> Shyti <andi.shyti@linux.intel.com>; Wajdeczko, Michal
> <Michal.Wajdeczko@intel.com>
> Subject: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> 
> To support multi-GT configurations, we need to generate
> independent debug files for each GT.
> 
> To achieve this create a separate directory for each GT under the
> debugfs directory. For instance, in a system with two tiles, the
> debugfs structure would look like this:
> 
> /sys/kernel/debug/dri
>                   └── 0
>                       ├── gt0
>                       │   ├── drpc
>                       │   ├── engines
>                       │   ├── forcewake
>                       │   ├── frequency
>                       │   └── rps_boost
>                       └── gt1
>                       :   ├── drpc
>                       :   ├── engines
>                       :   ├── forcewake
>                           ├── frequency
>                           └── rps_boost
> 
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

LGTM,
Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
>  drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
>  4 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> index 5fc2df01aa0df..4dc23b8d3aa2d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> @@ -83,11 +83,13 @@ static void gt_debugfs_register(struct intel_gt *gt,
> struct dentry *root)
>  void intel_gt_debugfs_register(struct intel_gt *gt)
>  {
>  	struct dentry *root;
> +	char gtname[4];
> 
>  	if (!gt->i915->drm.primary->debugfs_root)
>  		return;
> 
> -	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
> +	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> +	root = debugfs_create_dir(gtname, gt->i915->drm.primary-
> >debugfs_root);
>  	if (IS_ERR(root))
>  		return;
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index bb4dfe707a7d0..e46aac1a41e6d 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -42,6 +42,8 @@ struct intel_guc {
>  	/** @capture: the error-state-capture module's data and objects */
>  	struct intel_guc_state_capture *capture;
> 
> +	struct dentry *dbgfs_node;
> +
>  	/** @sched_engine: Global engine used to submit requests to GuC */
>  	struct i915_sched_engine *sched_engine;
>  	/**
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index 195db8c9d4200..55bc8b55fbc05 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -542,8 +542,11 @@ static int guc_log_relay_create(struct intel_guc_log
> *log)
>  	 */
>  	n_subbufs = 8;
> 
> +	if (!guc->dbgfs_node)
> +		return -ENOENT;
> +
>  	guc_log_relay_chan = relay_open("guc_log",
> -					i915->drm.primary->debugfs_root,
> +					guc->dbgfs_node,
>  					subbuf_size, n_subbufs,
>  					&relay_callbacks, i915);
>  	if (!guc_log_relay_chan) {
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> index 284d6fbc2d08c..2f93cc4e408a8 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct
> dentry *gt_root)
>  	if (IS_ERR(root))
>  		return;
> 
> +	uc->guc.dbgfs_node = root;
> +
>  	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
> 
>  	intel_guc_debugfs_register(&uc->guc, root);
> --
> 2.39.1
Sripada, Radhakrishna March 1, 2023, 9:35 p.m. UTC | #2
I am not sure if Tiles is appropriate usage here. Since MTL does not have the concept of tiles.
Shouldn't we be using gt instead of tile in our usage?

With s/tile/gt/g,
Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> 

> -----Original Message-----
> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Andi
> Shyti
> Sent: Wednesday, March 1, 2023 3:03 AM
> To: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>; Andi Shyti
> <andi@etezian.org>; Patelczyk, Maciej <maciej.patelczyk@intel.com>; Andi
> Shyti <andi.shyti@linux.intel.com>; Wajdeczko, Michal
> <Michal.Wajdeczko@intel.com>
> Subject: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> 
> To support multi-GT configurations, we need to generate
> independent debug files for each GT.
> 
> To achieve this create a separate directory for each GT under the
> debugfs directory. For instance, in a system with two tiles, the
> debugfs structure would look like this:
> 
> /sys/kernel/debug/dri
>                   └── 0
>                       ├── gt0
>                       │   ├── drpc
>                       │   ├── engines
>                       │   ├── forcewake
>                       │   ├── frequency
>                       │   └── rps_boost
>                       └── gt1
>                       :   ├── drpc
>                       :   ├── engines
>                       :   ├── forcewake
>                           ├── frequency
>                           └── rps_boost
> 
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
>  drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
>  4 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> index 5fc2df01aa0df..4dc23b8d3aa2d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> @@ -83,11 +83,13 @@ static void gt_debugfs_register(struct intel_gt *gt,
> struct dentry *root)
>  void intel_gt_debugfs_register(struct intel_gt *gt)
>  {
>  	struct dentry *root;
> +	char gtname[4];
> 
>  	if (!gt->i915->drm.primary->debugfs_root)
>  		return;
> 
> -	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
> +	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> +	root = debugfs_create_dir(gtname, gt->i915->drm.primary-
> >debugfs_root);
>  	if (IS_ERR(root))
>  		return;
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index bb4dfe707a7d0..e46aac1a41e6d 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -42,6 +42,8 @@ struct intel_guc {
>  	/** @capture: the error-state-capture module's data and objects */
>  	struct intel_guc_state_capture *capture;
> 
> +	struct dentry *dbgfs_node;
> +
>  	/** @sched_engine: Global engine used to submit requests to GuC */
>  	struct i915_sched_engine *sched_engine;
>  	/**
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index 195db8c9d4200..55bc8b55fbc05 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -542,8 +542,11 @@ static int guc_log_relay_create(struct intel_guc_log
> *log)
>  	 */
>  	n_subbufs = 8;
> 
> +	if (!guc->dbgfs_node)
> +		return -ENOENT;
> +
>  	guc_log_relay_chan = relay_open("guc_log",
> -					i915->drm.primary->debugfs_root,
> +					guc->dbgfs_node,
>  					subbuf_size, n_subbufs,
>  					&relay_callbacks, i915);
>  	if (!guc_log_relay_chan) {
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> index 284d6fbc2d08c..2f93cc4e408a8 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct
> dentry *gt_root)
>  	if (IS_ERR(root))
>  		return;
> 
> +	uc->guc.dbgfs_node = root;
> +
>  	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
> 
>  	intel_guc_debugfs_register(&uc->guc, root);
> --
> 2.39.1
Andi Shyti March 1, 2023, 10:04 p.m. UTC | #3
> I am not sure if Tiles is appropriate usage here. Since MTL does not have the concept of tiles.
> Shouldn't we be using gt instead of tile in our usage?
> 
> With s/tile/gt/g,
> Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> 

yes, GT is preferred to tile, generally. Thanks for the review, I
will change the commit log according to your comment.

Thanks!
Andi

> > -----Original Message-----
> > From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Andi
> > Shyti
> > Sent: Wednesday, March 1, 2023 3:03 AM
> > To: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>; Andi Shyti
> > <andi@etezian.org>; Patelczyk, Maciej <maciej.patelczyk@intel.com>; Andi
> > Shyti <andi.shyti@linux.intel.com>; Wajdeczko, Michal
> > <Michal.Wajdeczko@intel.com>
> > Subject: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> > 
> > To support multi-GT configurations, we need to generate
> > independent debug files for each GT.
> > 
> > To achieve this create a separate directory for each GT under the
> > debugfs directory. For instance, in a system with two tiles, the
> > debugfs structure would look like this:
> > 
> > /sys/kernel/debug/dri
> >                   └── 0
> >                       ├── gt0
> >                       │   ├── drpc
> >                       │   ├── engines
> >                       │   ├── forcewake
> >                       │   ├── frequency
> >                       │   └── rps_boost
> >                       └── gt1
> >                       :   ├── drpc
> >                       :   ├── engines
> >                       :   ├── forcewake
> >                           ├── frequency
> >                           └── rps_boost
> > 
> > Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
> >  drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
> >  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
> >  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
> >  4 files changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > index 5fc2df01aa0df..4dc23b8d3aa2d 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > @@ -83,11 +83,13 @@ static void gt_debugfs_register(struct intel_gt *gt,
> > struct dentry *root)
> >  void intel_gt_debugfs_register(struct intel_gt *gt)
> >  {
> >  	struct dentry *root;
> > +	char gtname[4];
> > 
> >  	if (!gt->i915->drm.primary->debugfs_root)
> >  		return;
> > 
> > -	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
> > +	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> > +	root = debugfs_create_dir(gtname, gt->i915->drm.primary-
> > >debugfs_root);
> >  	if (IS_ERR(root))
> >  		return;
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > index bb4dfe707a7d0..e46aac1a41e6d 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > @@ -42,6 +42,8 @@ struct intel_guc {
> >  	/** @capture: the error-state-capture module's data and objects */
> >  	struct intel_guc_state_capture *capture;
> > 
> > +	struct dentry *dbgfs_node;
> > +
> >  	/** @sched_engine: Global engine used to submit requests to GuC */
> >  	struct i915_sched_engine *sched_engine;
> >  	/**
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > index 195db8c9d4200..55bc8b55fbc05 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > @@ -542,8 +542,11 @@ static int guc_log_relay_create(struct intel_guc_log
> > *log)
> >  	 */
> >  	n_subbufs = 8;
> > 
> > +	if (!guc->dbgfs_node)
> > +		return -ENOENT;
> > +
> >  	guc_log_relay_chan = relay_open("guc_log",
> > -					i915->drm.primary->debugfs_root,
> > +					guc->dbgfs_node,
> >  					subbuf_size, n_subbufs,
> >  					&relay_callbacks, i915);
> >  	if (!guc_log_relay_chan) {
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > index 284d6fbc2d08c..2f93cc4e408a8 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct
> > dentry *gt_root)
> >  	if (IS_ERR(root))
> >  		return;
> > 
> > +	uc->guc.dbgfs_node = root;
> > +
> >  	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
> > 
> >  	intel_guc_debugfs_register(&uc->guc, root);
> > --
> > 2.39.1
>
Andi Shyti March 4, 2023, 3:24 a.m. UTC | #4
On Wed, Mar 01, 2023 at 09:35:33PM +0000, Sripada, Radhakrishna wrote:
> I am not sure if Tiles is appropriate usage here. Since MTL does not have the concept of tiles.
> Shouldn't we be using gt instead of tile in our usage?
> 
> With s/tile/gt/g,
> Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> 

Just one question... you reviewed twice Patch number 1. Did you
mean to review patch 1 and patch 2?

Thanks,
Andi

> 
> > -----Original Message-----
> > From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Andi
> > Shyti
> > Sent: Wednesday, March 1, 2023 3:03 AM
> > To: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>; Andi Shyti
> > <andi@etezian.org>; Patelczyk, Maciej <maciej.patelczyk@intel.com>; Andi
> > Shyti <andi.shyti@linux.intel.com>; Wajdeczko, Michal
> > <Michal.Wajdeczko@intel.com>
> > Subject: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> > 
> > To support multi-GT configurations, we need to generate
> > independent debug files for each GT.
> > 
> > To achieve this create a separate directory for each GT under the
> > debugfs directory. For instance, in a system with two tiles, the
> > debugfs structure would look like this:
> > 
> > /sys/kernel/debug/dri
> >                   └── 0
> >                       ├── gt0
> >                       │   ├── drpc
> >                       │   ├── engines
> >                       │   ├── forcewake
> >                       │   ├── frequency
> >                       │   └── rps_boost
> >                       └── gt1
> >                       :   ├── drpc
> >                       :   ├── engines
> >                       :   ├── forcewake
> >                           ├── frequency
> >                           └── rps_boost
> > 
> > Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
> >  drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
> >  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
> >  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
> >  4 files changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > index 5fc2df01aa0df..4dc23b8d3aa2d 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > @@ -83,11 +83,13 @@ static void gt_debugfs_register(struct intel_gt *gt,
> > struct dentry *root)
> >  void intel_gt_debugfs_register(struct intel_gt *gt)
> >  {
> >  	struct dentry *root;
> > +	char gtname[4];
> > 
> >  	if (!gt->i915->drm.primary->debugfs_root)
> >  		return;
> > 
> > -	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
> > +	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> > +	root = debugfs_create_dir(gtname, gt->i915->drm.primary-
> > >debugfs_root);
> >  	if (IS_ERR(root))
> >  		return;
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > index bb4dfe707a7d0..e46aac1a41e6d 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > @@ -42,6 +42,8 @@ struct intel_guc {
> >  	/** @capture: the error-state-capture module's data and objects */
> >  	struct intel_guc_state_capture *capture;
> > 
> > +	struct dentry *dbgfs_node;
> > +
> >  	/** @sched_engine: Global engine used to submit requests to GuC */
> >  	struct i915_sched_engine *sched_engine;
> >  	/**
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > index 195db8c9d4200..55bc8b55fbc05 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > @@ -542,8 +542,11 @@ static int guc_log_relay_create(struct intel_guc_log
> > *log)
> >  	 */
> >  	n_subbufs = 8;
> > 
> > +	if (!guc->dbgfs_node)
> > +		return -ENOENT;
> > +
> >  	guc_log_relay_chan = relay_open("guc_log",
> > -					i915->drm.primary->debugfs_root,
> > +					guc->dbgfs_node,
> >  					subbuf_size, n_subbufs,
> >  					&relay_callbacks, i915);
> >  	if (!guc_log_relay_chan) {
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > index 284d6fbc2d08c..2f93cc4e408a8 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct
> > dentry *gt_root)
> >  	if (IS_ERR(root))
> >  		return;
> > 
> > +	uc->guc.dbgfs_node = root;
> > +
> >  	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
> > 
> >  	intel_guc_debugfs_register(&uc->guc, root);
> > --
> > 2.39.1
>
Sripada, Radhakrishna March 6, 2023, 3:10 p.m. UTC | #5
> -----Original Message-----
> From: Andi Shyti <andi.shyti@linux.intel.com>
> Sent: Friday, March 3, 2023 7:24 PM
> To: Sripada, Radhakrishna <radhakrishna.sripada@intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>; intel-gfx@lists.freedesktop.org; dri-
> devel@lists.freedesktop.org; Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>;
> Andi Shyti <andi@etezian.org>; Patelczyk, Maciej
> <maciej.patelczyk@intel.com>; Wajdeczko, Michal
> <Michal.Wajdeczko@intel.com>
> Subject: Re: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> 
> On Wed, Mar 01, 2023 at 09:35:33PM +0000, Sripada, Radhakrishna wrote:
> > I am not sure if Tiles is appropriate usage here. Since MTL does not have the
> concept of tiles.
> > Shouldn't we be using gt instead of tile in our usage?
> >
> > With s/tile/gt/g,
> > Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
> 
> Just one question... you reviewed twice Patch number 1. Did you
> mean to review patch 1 and patch 2?

This was for Patch1 itself. I did not include s/tile/gt/g during the first time I gave r-b
hence added that with new r-b.

-RK
> 
> Thanks,
> Andi
> 
> >
> > > -----Original Message-----
> > > From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of
> Andi
> > > Shyti
> > > Sent: Wednesday, March 1, 2023 3:03 AM
> > > To: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>; Andi Shyti
> > > <andi@etezian.org>; Patelczyk, Maciej <maciej.patelczyk@intel.com>; Andi
> > > Shyti <andi.shyti@linux.intel.com>; Wajdeczko, Michal
> > > <Michal.Wajdeczko@intel.com>
> > > Subject: [PATCH v2 1/2] drm/i915/gt: Create per-tile debugfs files
> > >
> > > To support multi-GT configurations, we need to generate
> > > independent debug files for each GT.
> > >
> > > To achieve this create a separate directory for each GT under the
> > > debugfs directory. For instance, in a system with two tiles, the
> > > debugfs structure would look like this:
> > >
> > > /sys/kernel/debug/dri
> > >                   └── 0
> > >                       ├── gt0
> > >                       │   ├── drpc
> > >                       │   ├── engines
> > >                       │   ├── forcewake
> > >                       │   ├── frequency
> > >                       │   └── rps_boost
> > >                       └── gt1
> > >                       :   ├── drpc
> > >                       :   ├── engines
> > >                       :   ├── forcewake
> > >                           ├── frequency
> > >                           └── rps_boost
> > >
> > > Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    | 4 +++-
> > >  drivers/gpu/drm/i915/gt/uc/intel_guc.h        | 2 ++
> > >  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 5 ++++-
> > >  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
> > >  4 files changed, 11 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > > index 5fc2df01aa0df..4dc23b8d3aa2d 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> > > @@ -83,11 +83,13 @@ static void gt_debugfs_register(struct intel_gt *gt,
> > > struct dentry *root)
> > >  void intel_gt_debugfs_register(struct intel_gt *gt)
> > >  {
> > >  	struct dentry *root;
> > > +	char gtname[4];
> > >
> > >  	if (!gt->i915->drm.primary->debugfs_root)
> > >  		return;
> > >
> > > -	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
> > > +	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> > > +	root = debugfs_create_dir(gtname, gt->i915->drm.primary-
> > > >debugfs_root);
> > >  	if (IS_ERR(root))
> > >  		return;
> > >
> > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > > b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > > index bb4dfe707a7d0..e46aac1a41e6d 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > > @@ -42,6 +42,8 @@ struct intel_guc {
> > >  	/** @capture: the error-state-capture module's data and objects */
> > >  	struct intel_guc_state_capture *capture;
> > >
> > > +	struct dentry *dbgfs_node;
> > > +
> > >  	/** @sched_engine: Global engine used to submit requests to GuC */
> > >  	struct i915_sched_engine *sched_engine;
> > >  	/**
> > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > index 195db8c9d4200..55bc8b55fbc05 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > @@ -542,8 +542,11 @@ static int guc_log_relay_create(struct intel_guc_log
> > > *log)
> > >  	 */
> > >  	n_subbufs = 8;
> > >
> > > +	if (!guc->dbgfs_node)
> > > +		return -ENOENT;
> > > +
> > >  	guc_log_relay_chan = relay_open("guc_log",
> > > -					i915->drm.primary->debugfs_root,
> > > +					guc->dbgfs_node,
> > >  					subbuf_size, n_subbufs,
> > >  					&relay_callbacks, i915);
> > >  	if (!guc_log_relay_chan) {
> > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > > b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > > index 284d6fbc2d08c..2f93cc4e408a8 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> > > @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc,
> struct
> > > dentry *gt_root)
> > >  	if (IS_ERR(root))
> > >  		return;
> > >
> > > +	uc->guc.dbgfs_node = root;
> > > +
> > >  	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
> > >
> > >  	intel_guc_debugfs_register(&uc->guc, root);
> > > --
> > > 2.39.1
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
index 5fc2df01aa0df..4dc23b8d3aa2d 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
@@ -83,11 +83,13 @@  static void gt_debugfs_register(struct intel_gt *gt, struct dentry *root)
 void intel_gt_debugfs_register(struct intel_gt *gt)
 {
 	struct dentry *root;
+	char gtname[4];
 
 	if (!gt->i915->drm.primary->debugfs_root)
 		return;
 
-	root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
+	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
+	root = debugfs_create_dir(gtname, gt->i915->drm.primary->debugfs_root);
 	if (IS_ERR(root))
 		return;
 
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index bb4dfe707a7d0..e46aac1a41e6d 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -42,6 +42,8 @@  struct intel_guc {
 	/** @capture: the error-state-capture module's data and objects */
 	struct intel_guc_state_capture *capture;
 
+	struct dentry *dbgfs_node;
+
 	/** @sched_engine: Global engine used to submit requests to GuC */
 	struct i915_sched_engine *sched_engine;
 	/**
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
index 195db8c9d4200..55bc8b55fbc05 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -542,8 +542,11 @@  static int guc_log_relay_create(struct intel_guc_log *log)
 	 */
 	n_subbufs = 8;
 
+	if (!guc->dbgfs_node)
+		return -ENOENT;
+
 	guc_log_relay_chan = relay_open("guc_log",
-					i915->drm.primary->debugfs_root,
+					guc->dbgfs_node,
 					subbuf_size, n_subbufs,
 					&relay_callbacks, i915);
 	if (!guc_log_relay_chan) {
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
index 284d6fbc2d08c..2f93cc4e408a8 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
@@ -54,6 +54,8 @@  void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
 	if (IS_ERR(root))
 		return;
 
+	uc->guc.dbgfs_node = root;
+
 	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
 
 	intel_guc_debugfs_register(&uc->guc, root);