From nobody Thu Apr 25 20:52:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1617718360; cv=none; d=zohomail.com; s=zohoarc; b=VGW7XXB2glDRBXN5YUQpNBJ2g8lS74FkkF4xrzAAAP275/7yYCRm7qTN3hMiD3+U1o2fU1dltN5eUIv7PXZw5eTcK8yen6U1d/3z7v8E2TMg5AW+Uvl0Fk8yuvpNMaMo3RbM+yJ5+bSQry2xkfZ+12ilAUEU/CzIu4DnJO+XRH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617718360; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject; bh=r4ghuXQ0mWF9CQL06y55/UTDDpr+HeTBgnIUR0Jp1/Q=; b=HpIoKpVnZW8zlurGgGThpMvhgr2bq8Tj8GzSiqNzq81Uw4XSGI2LowOgkIZKUl3bC43y+vxUgK2yIDKRnwNmn9DqEciZR5mLiZ9JqemtEeWM+NXoo53xIM9C5w/iT32oGG4QRCnthNZpjIm5H5ywkhYCont10YURGqfhlX3SuNE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617718360766215.85519654972177; Tue, 6 Apr 2021 07:12:40 -0700 (PDT) Received: from localhost ([::1]:43106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTmRa-0000xW-TY for importer@patchew.org; Tue, 06 Apr 2021 10:12:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTmQV-0000UW-U4 for qemu-devel@nongnu.org; Tue, 06 Apr 2021 10:11:31 -0400 Received: from mx1.tachyum.com ([66.160.133.170]:9282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTmQU-0001Nq-CW for qemu-devel@nongnu.org; Tue, 06 Apr 2021 10:11:31 -0400 Received: by mx1.tachyum.com (Postfix, from userid 1000) id B2F7110056EF; Tue, 6 Apr 2021 07:11:27 -0700 (PDT) Received: from tsk-dev-sw-mkysel.tachyum.sk (tsk-fw1.tachyum.sk [93.184.71.90]) by mx1.tachyum.com (Postfix) with ESMTP id BC0FB1005684; Tue, 6 Apr 2021 07:11:25 -0700 (PDT) From: Matus Kysel To: Subject: [PATCH] linux-user: strace now handles unshare syscall args correctly Date: Tue, 6 Apr 2021 14:11:13 +0000 Message-Id: <20210406141113.922634-1-mkysel@tachyum.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=66.160.133.170; envelope-from=mkysel@tachyum.com; helo=mx1.tachyum.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:All patches CC here" , Laurent Vivier , Matus Kysel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Syscall unshare did not have custom print function for strace, but it's arg= ument is same as flags in clone syscall, so it can be easily implemented. Signed-off-by: Matus Kysel Reviewed-by: Laurent Vivier --- linux-user/strace.c | 12 ++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index e969121b6c..d48df8c1a9 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3467,6 +3467,18 @@ print_unlinkat(void *cpu_env, const struct syscallna= me *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 084048ab96..3b7c15578c 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.25.1