Rewrite exit_group01 test
v5 cover Rewrite exit_group01 test
From: Andrea Cervesato <[email protected]>
exit_group01 test has been completely rewritten and tst_gettid() has been added to support missing gettid() syscall from GLIBC
Andrea Cervesato (2):
Add tst_gettid wrapper around gettid syscall
Refactor exit_group01 using new API
include/tst_pid.h | 8 + lib/tst_pid.c | 5 + testcases/kernel/syscalls/exit_group/Makefile | 2 + .../kernel/syscalls/exit_group/exit_group01.c | 161 ++++++++++++------ 4 files changed, 125 insertions(+), 51 deletions(-)
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 1/2 Add tst_gettid wrapper around gettid syscall
From: Andrea Cervesato <[email protected]>
--- include/tst_pid.h | 8 ++++++++ lib/tst_pid.c | 5 +++++ 2 files changed, 13 insertions(+)
include/tst_pid.h +8 -0
@@ -50,4 +50,12 @@ static inline int tst_get_free_pids(void (*cleanup_fn)(void))*/ pid_t tst_getpid (void ); +/* +* Direct gettid() syscall. Some glibc versions cache gettid() return value +* which can cause confusing issues for example in processes created by +* direct clone() syscall (without using the glibc wrapper). Use this function +* whenever the current process may be a thread of the main test process. +*/ +pid_t tst_gettid (void ); +#endif /* TST_PID_H__ */
lib/tst_pid.c +5 -0
@@ -166,3 +166,8 @@ pid_t tst_getpid(void) {return syscall (SYS_getpid); } + +pid_t tst_gettid (void ) +{ +return syscall (SYS_gettid); +}
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 2/2 Refactor exit_group01 using new API
In reply to Andrea CervesatoFrom: Andrea Cervesato <[email protected]>
We provided a different approach to exit_group() testing, spawning multiple threads inside the child and checking if they get killed with the parent process.
--- testcases/kernel/syscalls/exit_group/Makefile | 2 + .../kernel/syscalls/exit_group/exit_group01.c | 161 ++++++++++++------ 2 files changed, 112 insertions(+), 51 deletions(-)
testcases/kernel/syscalls/exit_group/Makefile +2 -0
@@ -3,6 +3,8 @@ top_srcdir ?= ../../../.. +exit_group01: CFLAGS+=-pthread + include $(top_srcdir)/include/mk/testcases.mk include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/exit_group/exit_group01.c +110 -51
178 lines not on this page · raw message
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Richard Palethorpe
AppliedHello,
Merged, thanks!
Quoted 17 lines · Andrea Cervesato
From: Andrea Cervesato <[email protected]>
exit_group01test has been completely rewritten andtst_gettid()has been added to support missinggettid()syscall from GLIBCAndrea Cervesato (2):
Addtst_gettidwrapper around gettid syscall
Refactorexit_group01using new APIinclude/tst_pid.h | 8 + lib/tst_pid.c | 5 + testcases/kernel/syscalls/exit_group/Makefile | 2 + .../kernel/syscalls/exit_group/exit_group01.c | 161 ++++++++++++------ 4 files changed, 125 insertions(+), 51 deletions(-)Signature · 1 line
2.35.3
Signature · 5 lines
Thank you, Richard. -- Mailing list info: https://lists.linux.it/listinfo/ltp