diff mbox series

[i-g-t,v2,2/4] lib/igt_drm_clients: Add pdev and driver info

Message ID 20241220003734.69174-3-vinay.belgaumkar@intel.com (mailing list archive)
State New
Headers show
Series tools/gputop: Add PMU stats | expand

Commit Message

Vinay Belgaumkar Dec. 20, 2024, 12:37 a.m. UTC
This will be used for gathering PMU event information.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

This will be used for gathering PMU event information.

Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
/igt_debugfs.c.orig
---
 lib/igt_drm_clients.c | 6 ++++++
 lib/igt_drm_clients.h | 4 ++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/lib/igt_drm_clients.c b/lib/igt_drm_clients.c
index 858cd3645..e30e3243e 100644
--- a/lib/igt_drm_clients.c
+++ b/lib/igt_drm_clients.c
@@ -190,6 +190,12 @@  igt_drm_client_add(struct igt_drm_clients *clients,
 	c->drm_minor = drm_minor;
 	c->clients = clients;
 
+	/* Save driver and pdev info for later use */
+	if (info->driver && info->pdev) {
+		strncpy(c->driver, info->driver, sizeof(c->driver));
+		strncpy(c->pdev, info->pdev, sizeof(c->pdev));
+	}
+
 	/* Engines */
 	c->engines = calloc(1, sizeof(*c->engines));
 	assert(c->engines);
diff --git a/lib/igt_drm_clients.h b/lib/igt_drm_clients.h
index 946d709de..6d2a48997 100644
--- a/lib/igt_drm_clients.h
+++ b/lib/igt_drm_clients.h
@@ -86,6 +86,10 @@  struct igt_drm_client {
 		uint64_t last_total_cycles; /* Engine total cycles data as parsed from fdinfo. */
 	} *utilization; /* Array of engine utilization */
 
+	void *pmu_info; /* Pointer to structure that holds client PMU info */
+	char driver[128];
+	char pdev[128];
+
 	struct drm_client_meminfo *memory; /* Array of region memory utilisation as parsed from fdinfo. */
 };