gpu: nvgpu: unit: Argument to run single unit

Specify a unit to run from the command line, especially useful
as the number of units is increasing. The argument behaves as
a wildcard. All units that contain the argument in the name will
be executed.

JIRA NVGPU-1246

Change-Id: Ia650929751a0acd83fc034fbeb0fd7df8d39e48d
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1967082
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2018-12-06 15:04:24 -05:00
committed by mobile promotions
parent 9d92695e97
commit 48648cfc58
4 changed files with 31 additions and 4 deletions

View File

@@ -77,6 +77,14 @@ static struct unit_module *load_one_module(struct unit_fw *fw,
core_vbs(fw, 1, "Loading: %s\n", dent->d_name);
if (fw->args->unit_to_run != NULL) {
if (strstr(dent->d_name, fw->args->unit_to_run) == NULL) {
core_vbs(fw, 1, " Skipping unit (not *%s*)\n",
fw->args->unit_to_run);
return NULL;
}
}
lib_handle = dlopen(dent->d_name, RTLD_NOW);
if (lib_handle == NULL) {
core_err(fw, "Failed to load %s: %s\n",