Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH i-g-t v2 1/4] tools/gputop: Define data structs for PMU stats
Date: Thu, 19 Dec 2024 16:37:31 -0800	[thread overview]
Message-ID: <20241220003734.69174-2-vinay.belgaumkar@intel.com> (raw)
In-Reply-To: <20241220003734.69174-1-vinay.belgaumkar@intel.com>

Prep work for adding PMU support in gputop.

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>
---
 tools/gputop.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tools/gputop.c b/tools/gputop.c
index 43b01f566..4e3663417 100644
--- a/tools/gputop.c
+++ b/tools/gputop.c
@@ -42,6 +42,34 @@ static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "
 #define ANSI_HEADER "\033[7m"
 #define ANSI_RESET "\033[0m"
 
+struct pmu_pair {
+	uint64_t cur;
+	uint64_t prev;
+};
+
+struct pmu_counter {
+	uint64_t type;
+	uint64_t config;
+	unsigned int idx;
+	struct pmu_pair val;
+	double scale;
+	const char *units;
+	bool present;
+};
+
+#define MAX_GTS 4
+
+struct pmu_info {
+	char device_events_path[300];
+	int pmu_fd;
+	struct pmu_counter req_freq[MAX_GTS];
+	struct pmu_counter act_freq[MAX_GTS];
+	struct pmu_counter c6[MAX_GTS];
+	int num_gts;
+	int num_counters;
+	uint64_t ts_cur, ts_prev;
+};
+
 static void n_spaces(const unsigned int n)
 {
 	unsigned int i;
-- 
2.38.1


  reply	other threads:[~2024-12-20  0:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20  0:37 [PATCH i-g-t v2 0/4] tools/gputop: Add PMU stats Vinay Belgaumkar
2024-12-20  0:37 ` Vinay Belgaumkar [this message]
2024-12-20  0:37 ` [PATCH i-g-t v2 2/4] lib/igt_drm_clients: Add pdev and driver info Vinay Belgaumkar
2024-12-20  0:37 ` [PATCH i-g-t v2 3/4] lib/igt_perf: Add utils to extract PMU event info Vinay Belgaumkar
2024-12-20  0:37 ` [PATCH i-g-t v2 4/4] tools/gputop: Add GT freq and c6 stats Vinay Belgaumkar
2024-12-20 10:15 ` [PATCH i-g-t v2 0/4] tools/gputop: Add PMU stats Tvrtko Ursulin
2024-12-20 19:13   ` Rodrigo Vivi
2024-12-20 19:32     ` Lucas De Marchi
2024-12-22 17:47       ` Tvrtko Ursulin
2025-01-13 23:19       ` Belgaumkar, Vinay

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=20241220003734.69174-2-vinay.belgaumkar@intel.com \
    --to=vinay.belgaumkar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@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