Skip to contentSkip to conversation

debugfs support for pt base for each vm

PATCH In review Sunil Khatri 5 participants 8 messages Jun 13, 2025 – Jun 23, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover debugfs support for pt base for each vm

root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/clients
             command  tgid dev master a   uid      magic                                                             name client-id
      systemd-logind  1056   0   y    y     0          0                                                          <unset>     5
            Xwayland  1733 128   n    n   120          0                                                          <unset>     8
     mutter-x11-fram  2048 128   n    n   120          0                                                          <unset>     9
            ibus-x11  2071 128   n    n   120          0                                                          <unset>    10
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client
client-1/  client-10/ client-2/  client-5/  client-8/  client-9/  clients
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1/pt_base
81febf3000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-5/pt_base
81febe9000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-8/pt_base
81febdc000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-9/pt_base
81febb2000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-10/pt_base
81febaf000

Sunil Khatri (2):
drm: add debugfs support per client-id
amdgpu: add debugfs file for pt-base per client-id

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++-
 drivers/gpu/drm/drm_file.c              | 13 +++++++++++++
 include/drm/drm_file.h                  |  7 +++++++
 5 files changed, 37 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 drm: add debugfs support per client-id

add support to add a directory for each client-id
per drm node based on drm-file.

---
 drivers/gpu/drm/drm_file.c | 11 +++++++++++
 include/drm/drm_file.h     |  7 +++++++
 2 files changed, 18 insertions(+)
drivers/gpu/drm/drm_file.c +11 -0
index 06ba6dcbf5ae..7a055fe7d4d5 100644
@@ -39,6 +39,7 @@
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/vga_switcheroo.h>
+#include <linux/debugfs.h>
 
 #include <drm/drm_client_event.h>
 #include <drm/drm_drv.h>
@@ -133,6 +134,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
 	struct drm_device *dev = minor->dev;
 	struct drm_file *file;
 	int ret;
+	char *dir_name;
 
 	file = kzalloc(sizeof(*file), GFP_KERNEL);
 	if (!file)
@@ -143,6 +145,12 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
 	rcu_assign_pointer(file->pid, get_pid(task_tgid(current)));
 	file->minor = minor;
 
+	dir_name = kasprintf(GFP_KERNEL, "client-%llu", file->client_id);
+	if (!dir_name)
+		return ERR_PTR(-ENOMEM);
+
+	file->debugfs_client = debugfs_create_dir(dir_name, minor->debugfs_root);
+
 	/* for compatibility root is always authenticated */
 	file->authenticated = capable(CAP_SYS_ADMIN);
 
@@ -237,6 +245,9 @@ void drm_file_free(struct drm_file *file)
 
 	drm_events_release(file);
 
+	debugfs_remove_recursive(file->debugfs_client);
+	file->debugfs_client = NULL;
+
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
 		drm_fb_release(file);
 		drm_property_destroy_user_blobs(dev, file);
include/drm/drm_file.h +7 -0
index 5c3b2aa3e69d..eab7546aad79 100644
@@ -400,6 +400,13 @@ struct drm_file {
 	 * @client_name_lock: Protects @client_name.
 	 */
 	struct mutex client_name_lock;
+
+	/**
+	 * @debugfs_client:
+	 *
+	 * debugfs directory for each client under a drm node.
+	 */
+	struct dentry *debugfs_client;
 };
 
 /**
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 amdgpu: add debugfs file for pt-base per client-id

In reply to Sunil Khatri

Each drm node is associated with a unique client-id. Adding root page table base address of the VM under the client-id node in debugfs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++-
 3 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -1
index d2ce7d86dbc8..aa912168fd68 100644
@@ -1395,7 +1395,7 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 	if (r)
 		goto error_pasid;
 
-	r = amdgpu_vm_init(adev, &fpriv->vm, fpriv->xcp_id);
+	r = amdgpu_vm_init(adev, &fpriv->vm, fpriv->xcp_id, file_priv);
 	if (r)
 		goto error_pasid;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +13 -1
index 3911c78f8282..33415ecc6819 100644
@@ -2520,6 +2520,17 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
 	get_task_comm(vm->task_info->process_name, current->group_leader);
 }
 
+#if defined(CONFIG_DEBUG_FS)
+static int amdgpu_pt_base_show(void *data, u64 *val)
+{
+	struct amdgpu_vm *vm = (struct amdgpu_vm *)data;
+	*val = amdgpu_bo_gpu_offset(vm->root.bo);
+	return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(amdgpu_pt_base_fops, amdgpu_pt_base_show, NULL, "%llx\n");
+#endif
+
 /**
  * amdgpu_vm_init - initialize a vm instance
  *
@@ -2533,7 +2544,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
  * 0 for success, error for failure.
  */
 int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
-		   int32_t xcp_id)
+		   int32_t xcp_id, struct drm_file *file)
 {
 	struct amdgpu_bo *root_bo;
 	struct amdgpu_bo_vm *root;
@@ -2609,6 +2620,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 	if (r)
 		DRM_DEBUG("Failed to create task info for VM\n");
 
+	debugfs_create_file("pt_base", 0444, file->debugfs_client, vm, &amdgpu_pt_base_fops);
 	amdgpu_bo_unreserve(vm->root.bo);
 	amdgpu_bo_unref(&root_bo);
 
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +3 -1
index f3ad687125ad..555afaf867c4 100644
@@ -487,7 +487,9 @@ int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 			u32 pasid);
 
 long amdgpu_vm_wait_idle(struct amdgpu_vm *vm, long timeout);
-int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, int32_t xcp_id);
+int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, int32_t xcp_id,
+		   struct drm_file *file);
+
 int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm);
 void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm);
 int amdgpu_vm_lock_pd(struct amdgpu_vm *vm, struct drm_exec *exec,
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v1 2/2] amdgpu: add debugfs file for pt-base per client-id

kernel test robot noticed the following build errors:

Hi Sunil,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-exynos/exynos-drm-next]
[also build test ERROR on linus/master drm/drm-next v6.16-rc1 next-20250613]
[cannot apply to drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Sunil-Khatri/drm-add-debugfs-support-per-client-id/20250613-151800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
patch link:    https://lore.kernel.org/r/20250613071537.701563-3-sunil.khatri%40amd.com
patch subject: [PATCH v1 2/2] amdgpu: add debugfs file for pt-base per client-id
config: arm64-randconfig-003-20250614 (https://download.01.org/0day-ci/archive/20250614/[email protected]/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250614/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2622:66: error: use of undeclared identifier 'amdgpu_pt_base_fops'; did you mean 'amdgpu_dmabuf_ops'?
    2622 |         debugfs_create_file("pt_base", 0444, file->debugfs_client, vm, &amdgpu_pt_base_fops);
         |                                                                         ^~~~~~~~~~~~~~~~~~~
         |                                                                         amdgpu_dmabuf_ops
   drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h:35:33: note: 'amdgpu_dmabuf_ops' declared here
      35 | extern const struct dma_buf_ops amdgpu_dmabuf_ops;
         |                                 ^

1 error generated.

vim +2622 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

2532
2533 /**
2534 * amdgpu_vm_init - initialize a vm instance
2535 *
2536 * @adev: amdgpu_device pointer
2537 * @vm: requested vm
2538 * @xcp_id: GPU partition selection id
2539 *
2540 * Init @vm fields.
2541 *
2542 * Returns:
2543 * 0 for success, error for failure.
2544 */
2545 int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
2546 int32_t xcp_id, struct drm_file *file)
2547 {
2548 struct amdgpu_bo *root_bo;
2549 struct amdgpu_bo_vm *root;
2550 int r, i;
2551
2552 vm->va = RB_ROOT_CACHED;
2553 for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
2554 vm->reserved_vmid[i] = NULL;
2555 INIT_LIST_HEAD(&vm->evicted);
2556 INIT_LIST_HEAD(&vm->evicted_user);
2557 INIT_LIST_HEAD(&vm->relocated);
2558 INIT_LIST_HEAD(&vm->moved);
2559 INIT_LIST_HEAD(&vm->idle);
2560 INIT_LIST_HEAD(&vm->invalidated);
2561 spin_lock_init(&vm->status_lock);
2562 INIT_LIST_HEAD(&vm->freed);
2563 INIT_LIST_HEAD(&vm->done);
2564 INIT_KFIFO(vm->faults);
2565
2566 r = amdgpu_vm_init_entities(adev, vm);
2567 if (r)
2568 return r;
2569
2570 ttm_lru_bulk_move_init(&vm->lru_bulk_move);
2571
2572 vm->is_compute_context = false;
2573
2574 vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
2575 AMDGPU_VM_USE_CPU_FOR_GFX);
2576
2577 DRM_DEBUG_DRIVER("VM update mode is %s\n",
2578 vm->use_cpu_for_update ? "CPU" : "SDMA");
2579 WARN_ONCE((vm->use_cpu_for_update &&
2580 !amdgpu_gmc_vram_full_visible(&adev->gmc)),
2581 "CPU update of VM recommended only for large BAR system\n");
2582
2583 if (vm->use_cpu_for_update)
2584 vm->update_funcs = &amdgpu_vm_cpu_funcs;
2585 else
2586 vm->update_funcs = &amdgpu_vm_sdma_funcs;
2587
2588 vm->last_update = dma_fence_get_stub();
2589 vm->last_unlocked = dma_fence_get_stub();
2590 vm->last_tlb_flush = dma_fence_get_stub();
2591 vm->generation = amdgpu_vm_generation(adev, NULL);
2592
2593 mutex_init(&vm->eviction_lock);
2594 vm->evicting = false;
2595 vm->tlb_fence_context = dma_fence_context_alloc(1);
2596
2597 r = amdgpu_vm_pt_create(adev, vm, adev->vm_manager.root_level,
2598 false, &root, xcp_id);
2599 if (r)
2600 goto error_free_delayed;
2601
2602 root_bo = amdgpu_bo_ref(&root->bo);
2603 r = amdgpu_bo_reserve(root_bo, true);
2604 if (r) {
2605 amdgpu_bo_unref(&root_bo);
2606 goto error_free_delayed;
2607 }
2608
2609 amdgpu_vm_bo_base_init(&vm->root, vm, root_bo);
2610 r = dma_resv_reserve_fences(root_bo->tbo.base.resv, 1);
2611 if (r)
2612 goto error_free_root;
2613
2614 r = amdgpu_vm_pt_clear(adev, vm, root, false);
2615 if (r)
2616 goto error_free_root;
2617
2618 r = amdgpu_vm_create_task_info(vm);
2619 if (r)
2620 DRM_DEBUG("Failed to create task info for VM\n");
2621

> 2622		debugfs_create_file("pt_base", 0444, file->debugfs_client, vm, &amdgpu_pt_base_fops);

2623 amdgpu_bo_unreserve(vm->root.bo);
2624 amdgpu_bo_unref(&root_bo);
2625
2626 return 0;
2627
2628 error_free_root:
2629 amdgpu_vm_pt_free_root(adev, vm);
2630 amdgpu_bo_unreserve(vm->root.bo);
2631 amdgpu_bo_unref(&root_bo);
2632
2633 error_free_delayed:
2634 dma_fence_put(vm->last_tlb_flush);
2635 dma_fence_put(vm->last_unlocked);
2636 ttm_lru_bulk_move_fini(&adev->mman.bdev, &vm->lru_bulk_move);
2637 amdgpu_vm_fini_entities(vm);
2638
2639 return r;
2640 }
2641

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#4 lore raw
In reply to Sunil Khatri
Quoted 14 lines · Sunil Khatri
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/clients
             command  tgid dev master a   uid      magic                                                             name client-id
      systemd-logind  1056   0   y    y     0          0                                                          <unset>     5
            Xwayland  1733 128   n    n   120          0                                                          <unset>     8
     mutter-x11-fram  2048 128   n    n   120          0                                                          <unset>     9
            ibus-x11  2071 128   n    n   120          0                                                          <unset>    10
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client
client-1/  client-10/ client-2/  client-5/  client-8/  client-9/  clients
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1/pt_base
81febf3000
Quoted 8 lines
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-5/pt_base
81febe9000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-8/pt_base
81febdc000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-9/pt_base
81febb2000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-10/pt_base
81febaf000

First of all move the client-* directories one directory up.

You put the directory under the debugfs directory of the device, but the idea here is that we can lockup the client device independent.

If we want to know which device a client belongs to we can easily add a symlink from the client subdirectory to the device (probably a good idea).

Regards,
Christian.

Quoted 13 lines

Sunil Khatri (2):
drm: add debugfs support per client-id
amdgpu: add debugfs file for pt-base per client-id

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++-
 drivers/gpu/drm/drm_file.c              | 13 +++++++++++++
 include/drm/drm_file.h                  |  7 +++++++
 5 files changed, 37 insertions(+), 3 deletions(-)
#5 lore raw
Quoted 24 lines · Christian König
Quoted 14 lines · Sunil Khatri
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/clients
              command  tgid dev master a   uid      magic                                                             name client-id
       systemd-logind  1056   0   y    y     0          0                                                          <unset>     5
             Xwayland  1733 128   n    n   120          0                                                          <unset>     8
      mutter-x11-fram  2048 128   n    n   120          0                                                          <unset>     9
             ibus-x11  2071 128   n    n   120          0                                                          <unset>    10
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client
client-1/  client-10/ client-2/  client-5/  client-8/  client-9/  clients
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1/pt_base
81febf3000
Quoted 8 lines
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-5/pt_base
81febe9000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-8/pt_base
81febdc000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-9/pt_base
81febb2000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-10/pt_base
81febaf000
Quoted 1 line

First of all move the client-* directories one directory up.

Isn't it better to have the clients under the corresponding device only in that case user dont have to find which device they belong to and we dont have to create a symlink too back to the device.
Infact /sys/kernel/debug/dri/0/clients is also drm device specific. If we keep it outside then in case of multi gpu from different vendors, it will be all mixed up and i am not sure if client-ids are per device. if yes, then there is possibility of duplicates over override.

Regards
Sunil

Quoted 20 lines

You put the directory under the debugfs directory of the device, but the idea here is that we can lockup the client device independent.

If we want to know which device a client belongs to we can easily add a symlink from the client subdirectory to the device (probably a good idea).

Regards,
Christian.

Quoted 12 lines

Sunil Khatri (2):
drm: add debugfs support per client-id
amdgpu: add debugfs file for pt-base per client-id

  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++-
  drivers/gpu/drm/drm_file.c              | 13 +++++++++++++
  include/drm/drm_file.h                  |  7 +++++++
  5 files changed, 37 insertions(+), 3 deletions(-)
#6 lore raw
In reply to Sunil Khatri
Quoted 8 lines · Sunil Khatri
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/clients
              command  tgid dev master a   uid      magic                                                             name client-id
       systemd-logind  1056   0   y    y     0          0                                                          <unset>     5
             Xwayland  1733 128   n    n   120          0                                                          <unset>     8
      mutter-x11-fram  2048 128   n    n   120          0                                                          <unset>     9
             ibus-x11  2071 128   n    n   120          0                                                          <unset>    10
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client
client-1/  client-10/ client-2/  client-5/  client-8/  client-9/  clients

How about making clients a directory? Ie. in your example:

# ls -1 /sys/kernel/debug/dri/0/clients/
1
5
8
9
10
# cat /sys/kernel/debug/dri/0/clients/1/pt_base
81febf3000

Regards,

Tvrtko

Quoted 27 lines
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1/pt_base
81febf3000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-5/pt_base
81febe9000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-8/pt_base
81febdc000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-9/pt_base
81febb2000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-10/pt_base
81febaf000

Sunil Khatri (2):
drm: add debugfs support per client-id
amdgpu: add debugfs file for pt-base per client-id

  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++-
  drivers/gpu/drm/drm_file.c              | 13 +++++++++++++
  include/drm/drm_file.h                  |  7 +++++++
  5 files changed, 37 insertions(+), 3 deletions(-)
#7 lore raw
Quoted 11 lines · Tvrtko Ursulin
Quoted 8 lines · Sunil Khatri
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/clients
              command  tgid dev master a   uid magic name client-id
       systemd-logind  1056   0   y    y     0 0 <unset>     5
             Xwayland  1733 128   n    n   120 0 <unset>     8
      mutter-x11-fram  2048 128   n    n   120 0 <unset>     9
             ibus-x11  2071 128   n    n   120 0 <unset>    10
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client
client-1/  client-10/ client-2/  client-5/  client-8/ client-9/  clients
Quoted 1 line

How about making clients a directory? Ie. in your example:

This has been updated. Could you please review the V4 patchset and may be soon there will be a v5. There are some changes already so request to please have a look on v4/v5.

Regards
Sunil Khatri

Quoted 43 lines
# ls -1 /sys/kernel/debug/dri/0/clients/
1
5
8
9
10
# cat /sys/kernel/debug/dri/0/clients/1/pt_base
81febf3000

Regards,

Tvrtko

Quoted 27 lines
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1
client-1/  client-10/
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-1/pt_base
81febf3000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-5/pt_base
81febe9000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-8/pt_base
81febdc000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-9/pt_base
81febb2000
root@amd-X570-AORUS-ELITE:~# cat /sys/kernel/debug/dri/0/client-10/pt_base
81febaf000

Sunil Khatri (2):
   drm: add debugfs support per client-id
   amdgpu: add debugfs file for pt-base per client-id

  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 14 +++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  4 +++- drivers/gpu/drm/drm_file.c              | 13 +++++++++++++ include/drm/drm_file.h                  |  7 +++++++

  5 files changed, 37 insertions(+), 3 deletions(-)