Skip to content
Snippets Groups Projects
Commit 6b46cef9 authored by Marcin Bernatowicz's avatar Marcin Bernatowicz Committed by Kamil Konieczny
Browse files

benchmarks/gem_wsim: Option to list physical engines


Added command line option (-l) to list physical engines.

Signed-off-by: default avatarMarcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Reviewed-by: default avatarKamil Konieczny <kamil.konieczny@linux.intel.com>
parent 73d12d2f
No related merge requests found
Pipeline #1237780 passed
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment