From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: tursulin@igalia.com, kamil.konieczny@linux.intel.com,
lukasz.laguna@intel.com
Subject: [PATCH v3 i-g-t 6/6] benchmarks/gem_wsim: Option to list physical engines
Date: Mon, 29 Jul 2024 19:52:19 +0200 [thread overview]
Message-ID: <20240729175219.1636694-7-marcin.bernatowicz@linux.intel.com> (raw)
In-Reply-To: <20240729175219.1636694-1-marcin.bernatowicz@linux.intel.com>
Added command line option (-l) to list physical engines.
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
benchmarks/gem_wsim.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 0c022f9ce..c4fd00a6a 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -2989,6 +2989,7 @@ static void print_help(void)
" -f <scale> Scale factor for batch durations.\n"
" -F <scale> Scale factor for delays.\n"
" -L List GPUs.\n"
+" -l List physical engines.\n"
" -D <gpu> One of the GPUs from -L.\n"
);
}
@@ -3048,10 +3049,42 @@ add_workload_arg(struct w_arg *w_args, unsigned int nr_args, char *w_arg,
return w_args;
}
+static void list_engines(void)
+{
+ struct intel_engines *engines = query_engines();
+ int engine_class_count[NUM_ENGINE_CLASSES] = {};
+ unsigned int i;
+
+ for (i = 0; i < engines->nr_engines; ++i) {
+ igt_assert_lt(engines->engines[i].engine_class, NUM_ENGINE_CLASSES);
+ engine_class_count[engines->engines[i].engine_class]++;
+ }
+
+ for (i = 0; i < engines->nr_engines; ++i) {
+ if (engine_class_count[engines->engines[i].engine_class] > 1)
+ printf("%s%u",
+ intel_engine_class_string(engines->engines[i].engine_class),
+ engines->engines[i].engine_instance + 1);
+ else
+ printf("%s",
+ intel_engine_class_string(engines->engines[i].engine_class));
+
+ if (is_xe && engines->engines[i].gt_id)
+ printf("-%u", engines->engines[i].gt_id);
+
+ if (verbose > 3)
+ printf(" [%d:%d:%d]", engines->engines[i].engine_class,
+ engines->engines[i].engine_instance,
+ engines->engines[i].gt_id);
+ printf("\n");
+ }
+}
+
int main(int argc, char **argv)
{
struct igt_device_card card = { };
bool list_devices_arg = false;
+ bool list_engines_arg = false;
unsigned int repeat = 1;
unsigned int clients = 1;
unsigned int flags = 0;
@@ -3074,11 +3107,14 @@ int main(int argc, char **argv)
master_prng = time(NULL);
while ((c = getopt(argc, argv,
- "LhqvsSdc:r:w:W:a:p:I:f:F:D:")) != -1) {
+ "LlhqvsSdc:r:w:W:a:p:I:f:F:D:")) != -1) {
switch (c) {
case 'L':
list_devices_arg = true;
break;
+ case 'l':
+ list_engines_arg = true;
+ break;
case 'D':
device_arg = strdup(optarg);
break;
@@ -3199,6 +3235,11 @@ int main(int argc, char **argv)
if (is_xe)
xe_device_get(fd);
+ if (list_engines_arg) {
+ list_engines();
+ goto out;
+ }
+
if (!nr_w_args) {
wsim_err("No workload descriptor(s)!\n");
goto err;
--
2.31.1
next prev parent reply other threads:[~2024-07-29 17:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 17:52 [PATCH v3 i-g-t 0/6] benchmarks/gem_wsim: Extend engine selection syntax Marcin Bernatowicz
2024-07-29 17:52 ` [PATCH v3 i-g-t 1/6] benchmarks/gem_wsim: Introduce intel_engines structure Marcin Bernatowicz
2024-07-31 14:53 ` Kamil Konieczny
2024-07-29 17:52 ` [PATCH v3 i-g-t 2/6] benchmarks/gem_wsim: Unify bond handling Marcin Bernatowicz
2024-07-31 14:56 ` Kamil Konieczny
2024-07-29 17:52 ` [PATCH v3 i-g-t 3/6] benchmarks/gem_wsim: Introduce engine_idx to streamline engine selection Marcin Bernatowicz
2024-07-31 14:57 ` Kamil Konieczny
2024-07-29 17:52 ` [PATCH v3 i-g-t 4/6] benchmarks/gem_wsim: Update request_idx in prepare phase Marcin Bernatowicz
2024-07-31 14:59 ` Kamil Konieczny
2024-07-29 17:52 ` [PATCH v3 i-g-t 5/6] benchmarks/gem_wsim: Extend engine selection syntax Marcin Bernatowicz
2024-07-31 15:00 ` Kamil Konieczny
2024-07-29 17:52 ` Marcin Bernatowicz [this message]
2024-07-31 15:02 ` [PATCH v3 i-g-t 6/6] benchmarks/gem_wsim: Option to list physical engines Kamil Konieczny
2024-07-29 19:40 ` ✓ CI.xeBAT: success for benchmarks/gem_wsim: Extend engine selection syntax (rev3) Patchwork
2024-07-29 19:59 ` ✓ Fi.CI.BAT: " Patchwork
2024-07-30 0:13 ` ✗ CI.xeFULL: failure " Patchwork
2024-07-31 11:40 ` Kamil Konieczny
2024-07-30 12:06 ` ✗ Fi.CI.IGT: " Patchwork
2024-07-31 11:45 ` Kamil Konieczny
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=20240729175219.1636694-7-marcin.bernatowicz@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=lukasz.laguna@intel.com \
--cc=tursulin@igalia.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