From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 07/15] intel_gpu_top: Determine number of tiles
Date: Wed, 17 May 2023 14:25:34 -0700 [thread overview]
Message-ID: <20230517212542.3681862-8-umesh.nerlige.ramappa@intel.com> (raw)
In-Reply-To: <20230517212542.3681862-1-umesh.nerlige.ramappa@intel.com>
Find out how many tiles are present in the platforms for multi-tile support.
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tools/intel_gpu_top.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index ae086ae12..fc57f6857 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -118,6 +118,8 @@ struct engines {
bool discrete;
char *device;
+ int num_gts;
+
/* Do not edit below this line.
* This structure is reallocated every time a new engine is
* found and size is increased by sizeof (engine).
@@ -539,6 +541,25 @@ static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
imc_open(pmu, "data_reads", engines);
}
+static int get_num_gts(uint64_t type)
+{
+ int fd, cnt;
+
+ errno = 0;
+ for (cnt = 0; cnt < MAX_GTS; cnt++) {
+ fd = igt_perf_open(type, __I915_PMU_REQUESTED_FREQUENCY(cnt));
+ if (fd < 0)
+ break;
+
+ close(fd);
+ }
+ assert(!errno || errno == ENOENT);
+ assert(cnt > 0);
+ errno = 0;
+
+ return cnt;
+}
+
static int pmu_init(struct engines *engines)
{
unsigned int i;
@@ -547,6 +568,7 @@ static int pmu_init(struct engines *engines)
engines->fd = -1;
engines->num_counters = 0;
+ engines->num_gts = get_num_gts(type);
engines->irq.config = I915_PMU_INTERRUPTS;
fd = _open_pmu(type, engines->num_counters, &engines->irq, engines->fd);
--
2.36.1
next prev parent reply other threads:[~2023-05-17 21:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 21:25 [igt-dev] [PATCH i-g-t v2 00/15] PMU: multi-tile support Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 01/15] perf_pmu: Support multi-tile in rc6 subtest Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 02/15] perf_pmu: Two new rc6 subtests Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 03/15] perf_pmu: Support multi-tile in frequency subtest Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 04/15] perf_pmu: Quiesce GPU if measuring idle busyness without spinner Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 05/15] perf_pmu: Use correct pmu config for multi-tile Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 06/15] intel_gpu_top: Add an array of freq and rc6 counters Umesh Nerlige Ramappa
2023-05-17 21:25 ` Umesh Nerlige Ramappa [this message]
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 08/15] intel_gpu_top: Capture freq and rc6 counters from each gt Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 09/15] intel_gpu_top: Switch pmu_counter to use aggregated values Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 10/15] intel_gpu_top: Add definitions for gt-specific items and groups Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 11/15] intel_gpu_top: Bump up size of groups to accomodate multi-gt Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 12/15] intel_gpu_top: Increase visibility for class_view Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 13/15] intel_gpu_top: Show gt specific values if requested Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 14/15] intel_gpu_top: Reduce one level of indent Umesh Nerlige Ramappa
2023-05-17 21:25 ` [igt-dev] [PATCH i-g-t v2 15/15] intel_gpu_top: Add gt specific values to header in interactive mode Umesh Nerlige Ramappa
2023-05-17 22:15 ` [igt-dev] ✗ Fi.CI.BAT: failure for PMU: multi-tile support (rev4) Patchwork
2023-05-18 12:04 ` Kamil Konieczny
2023-05-18 12:20 ` Yedireswarapu, SaiX Nandan
2023-05-18 12:19 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-05-19 0:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-05-19 6:44 ` Umesh Nerlige Ramappa
2023-05-19 8:39 ` Dixit, Ashutosh
2023-05-19 15:55 ` Umesh Nerlige Ramappa
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=20230517212542.3681862-8-umesh.nerlige.ramappa@intel.com \
--to=umesh.nerlige.ramappa@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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