diff --git a/userspace/src/exec.c b/userspace/src/exec.c index 8c9233518..6fd3e7eab 100644 --- a/userspace/src/exec.c +++ b/userspace/src/exec.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,8 @@ static void *core_exec_module(void *module_param) unsigned int i; struct unit_module *module = (struct unit_module *) module_param; struct gk20a *g; + clock_t begin; + double time_spent; g = module->fw->nvgpu.nvgpu_posix_probe(); @@ -68,6 +71,7 @@ static void *core_exec_module(void *module_param) } core_vbs(module->fw, 1, "Execing module: %s\n", module->name); + begin = clock(); thread_local_module = module; @@ -97,7 +101,9 @@ static void *core_exec_module(void *module_param) module->fw->nvgpu.nvgpu_posix_cleanup(g); - core_vbs(module->fw, 1, "Module completed: %s\n", module->name); + time_spent = (double)(clock() - begin) / CLOCKS_PER_SEC; + core_vbs(module->fw, 1, "Module completed: %s (execution time: %f)\n", + module->name, time_spent); thread_exit: sem_post(&unit_thread_semaphore); return NULL; diff --git a/userspace/unit.sh b/userspace/unit.sh index db762af7e..76dda7e8b 100755 --- a/userspace/unit.sh +++ b/userspace/unit.sh @@ -34,7 +34,7 @@ if [ -f nvgpu_unit ]; then # target, so use that dir structure LD_LIBRARY_PATH=".:units" cores=$(cat /proc/cpuinfo |grep processor |wc -l) - NVGPU_UNIT="./nvgpu_unit --nvtest --unit-load-path units/ --no-color \ + NVGPU_UNIT="./nvgpu_unit -v --nvtest --unit-load-path units/ --no-color \ --num-threads $cores" else # running on host