[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/59] linux-user: strace now handles unshare syscall args correct
From: |
Laurent Vivier |
Subject: |
[PULL 02/59] linux-user: strace now handles unshare syscall args correctly |
Date: |
Tue, 18 May 2021 07:30:34 +0200 |
From: Matus Kysel <mkysel@tachyum.com>
Syscall unshare did not have custom print function for strace, but it's
argument is same as flags in clone syscall, so it can be easily implemented.
Also updated missing flags from clone_flags.
Signed-off-by: Matus Kysel <mkysel@tachyum.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210406144203.1020598-1-mkysel@tachyum.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/strace.c | 18 ++++++++++++++++++
linux-user/strace.list | 2 +-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index e969121b6cd7..1cadb6d50f2d 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1109,6 +1109,12 @@ UNUSED static struct flags clone_flags[] = {
#if defined(CLONE_NEWNET)
FLAG_GENERIC(CLONE_NEWNET),
#endif
+#if defined(CLONE_NEWCGROUP)
+ FLAG_GENERIC(CLONE_NEWCGROUP),
+#endif
+#if defined(CLONE_NEWTIME)
+ FLAG_GENERIC(CLONE_NEWTIME),
+#endif
#if defined(CLONE_IO)
FLAG_GENERIC(CLONE_IO),
#endif
@@ -3467,6 +3473,18 @@ print_unlinkat(void *cpu_env, const struct syscallname
*name,
}
#endif
+#ifdef TARGET_NR_unshare
+static void
+print_unshare(void *cpu_env, const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_flags(clone_flags, arg0, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
#ifdef TARGET_NR_utime
static void
print_utime(void *cpu_env, const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 084048ab96dd..3b7c15578ca4 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1573,7 +1573,7 @@
{ TARGET_NR_unlinkat, "unlinkat" , NULL, print_unlinkat, NULL },
#endif
#ifdef TARGET_NR_unshare
-{ TARGET_NR_unshare, "unshare" , NULL, NULL, NULL },
+{ TARGET_NR_unshare, "unshare" , NULL, print_unshare, NULL },
#endif
#ifdef TARGET_NR_userfaultfd
{ TARGET_NR_userfaultfd, "userfaultfd" , NULL, NULL, NULL },
--
2.31.1
- [PULL 53/59] linux-user: Pass ka_restorer to do_sigaction, (continued)
- [PULL 53/59] linux-user: Pass ka_restorer to do_sigaction, Laurent Vivier, 2021/05/17
- [PULL 57/59] linux-user: Tidy TARGET_NR_rt_sigaction, Laurent Vivier, 2021/05/17
- [PULL 38/59] linux-user/s390x: Fix sigcontext sregs value, Laurent Vivier, 2021/05/17
- Re: [PULL 00/59] Linux user for 6.1 patches, no-reply, 2021/05/17
- [PULL 00/59] Linux user for 6.1 patches, Laurent Vivier, 2021/05/18
- [PULL 05/59] linux-user/arm: Do not fill in si_code for fpa11 exceptions, Laurent Vivier, 2021/05/18
- [PULL 07/59] linux-user: Add strace support for printing arguments of llseek, Laurent Vivier, 2021/05/18
- [PULL 04/59] linux-user/arm: Do not emulate fpa11 in thumb mode, Laurent Vivier, 2021/05/18
- [PULL 03/59] linux-user/arm: Split out emulate_arm_fpa11, Laurent Vivier, 2021/05/18
- [PULL 02/59] linux-user: strace now handles unshare syscall args correctly,
Laurent Vivier <=
- [PULL 09/59] linux-user: Use target_restore_altstack in all sigreturn, Laurent Vivier, 2021/05/18
- [PULL 06/59] linux-user/arm: Simplify accumulating and raising fpa11 exceptions, Laurent Vivier, 2021/05/18
- [PULL 10/59] linux-user: Pass CPUArchState to do_sigaltstack, Laurent Vivier, 2021/05/18
- [PULL 11/59] linux-user: Pass CPUArchState to target_restore_altstack, Laurent Vivier, 2021/05/18
- [PULL 15/59] linux-user/sparc: Merge sparc64 target_elf.h, Laurent Vivier, 2021/05/18
- [PULL 12/59] linux-user/sparc: Include TARGET_STACK_BIAS in get_sp_from_cpustate, Laurent Vivier, 2021/05/18
- [PULL 17/59] linux-user/sparc: Merge sparc64 termbits.h, Laurent Vivier, 2021/05/18
- [PULL 01/59] linux-user: Remove dead code, Laurent Vivier, 2021/05/18
- [PULL 13/59] linux-user/sparc: Clean up init_thread, Laurent Vivier, 2021/05/18
- [PULL 16/59] linux-user/sparc: Merge sparc64 target_structs.h, Laurent Vivier, 2021/05/18