From c6eae929fd74f11ab13d469a38bffd4e8ba50fb5 Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Tue, 25 Sep 2018 14:37:16 -0400 Subject: gpu: nvgpu: posix: Multithreading for unit tests Add a -j argument to enable running unit tests on several threads. Also adds signal handling to prevent a fatal error in one thread from killing the whole unit test framework. JIRA NVGPU-1043 Change-Id: I891a547640cd005a50ffa5c06367ed46c54de012 Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/1847740 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/include/unit/args.h | 1 + userspace/include/unit/unit.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'userspace/include/unit') diff --git a/userspace/include/unit/args.h b/userspace/include/unit/args.h index def84a29..708a1655 100644 --- a/userspace/include/unit/args.h +++ b/userspace/include/unit/args.h @@ -42,6 +42,7 @@ struct unit_fw_args { bool help; int verbose_lvl; bool no_color; + int thread_count; const char *unit_name; const char *unit_load_path; diff --git a/userspace/include/unit/unit.h b/userspace/include/unit/unit.h index 2f93bab5..442a73f1 100644 --- a/userspace/include/unit/unit.h +++ b/userspace/include/unit/unit.h @@ -23,6 +23,8 @@ #ifndef __UNIT_UNIT_H__ #define __UNIT_UNIT_H__ +#include + struct gk20a; struct unit_module; @@ -84,6 +86,8 @@ struct unit_module { */ void *lib_handle; struct unit_fw *fw; + + pthread_t thread; }; /* -- cgit v1.2.2