From patchwork Wed Jun 11 14:29:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31766 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31C492054B for ; Wed, 11 Jun 2014 14:33:00 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf30043422oag.4 for ; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=7TJI64Mr7VCvDyXmJJK7LmXKMDmv+3wHlpxuJRi/t9g=; b=LKr/KVU6dKc7/WtL+A8U7Puf8HcAaUA3+rW7Y+jRWwySR6NSYEKTkBvx5CYUr7V+8W qpsPOLf+EBQ4nuKilUG3JvSYuww8ZkAaKeRTX+K85rnoca9BawnOq/yECW47d+rbZyaW OQ2TTSkhl6VB8esxoUkysxfLM+QfU8n3qNqJW8How3pfcIEFGXxtZGNwI4JAI4Xn3flx FhW7PlIDY8Glu8zoyxo9B1bn0bx7ZT6zVtgt2b0/wvGYiriDVOLuEXyO+XeNTvlJ3Geh yvCd/QMDurfOe28ZF72kHVWSLXnhWjOTlMOT5eB+xgEoY3txKXzggdB2pbCm2Of8oY6w qbsA== X-Gm-Message-State: ALoCoQlOJlf9QbOpVbfxzUY5o21I7ctQKriYqkb4QdZI6EfN98fnyjxp0SLyz0Lk4S3gsAaU4R3S X-Received: by 10.182.22.65 with SMTP id b1mr18937164obf.10.1402497179395; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.51 with SMTP id 48ls2631299qgu.23.gmail; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) X-Received: by 10.58.186.207 with SMTP id fm15mr40146650vec.4.1402497179151; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id yf17si14265699vdb.9.2014.06.11.07.32.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 07:32:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jx11so209364veb.23 for ; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr3456442vdd.24.1402497179064; Wed, 11 Jun 2014 07:32:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp308550vcb; Wed, 11 Jun 2014 07:32:58 -0700 (PDT) X-Received: by 10.140.48.161 with SMTP id o30mr49545664qga.68.1402497178537; Wed, 11 Jun 2014 07:32:58 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d69si30760535qgd.88.2014.06.11.07.32.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Jun 2014 07:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:46827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujaE-0008KF-2D for patch@linaro.org; Wed, 11 Jun 2014 10:32:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXQ-0004nu-56 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WujXP-0008IY-09 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:04 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXO-0008DN-QM for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:02 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WujXG-00076G-4C; Wed, 11 Jun 2014 15:29:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Wed, 11 Jun 2014 15:29:49 +0100 Message-Id: <1402496993-27206-12-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> References: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl Subject: [Qemu-devel] [PULL 11/15] bsd-user: Implement strace support for print_ioctl syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Sean Bruno Signed-off-by: Sean Bruno Message-id: 1402246651-71099-5-git-send-email-sbruno@freebsd.org Signed-off-by: Peter Maydell --- bsd-user/freebsd/strace.list | 2 +- bsd-user/strace.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list index 3235f16..718357b 100644 --- a/bsd-user/freebsd/strace.list +++ b/bsd-user/freebsd/strace.list @@ -80,7 +80,7 @@ { TARGET_FREEBSD_NR_getsockopt, "getsockopt", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_gettimeofday, "gettimeofday", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_getuid, "getuid", "%s()", NULL, NULL }, -{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, NULL, NULL }, +{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, print_ioctl, NULL }, { TARGET_FREEBSD_NR_issetugid, "issetugid", "%s()", NULL, NULL }, { TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL }, diff --git a/bsd-user/strace.c b/bsd-user/strace.c index b2633d0..e33dd4d 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -89,6 +89,25 @@ static void print_execve(const struct syscallname *name, abi_long arg1, gemu_log("NULL})"); } +static void print_ioctl(const struct syscallname *name, + abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, + abi_long arg5, abi_long arg6) +{ + /* Decode the ioctl request */ + gemu_log("%s(%d, 0x%0lx { IO%s%s GRP:0x%x('%c') CMD:%d LEN:%d }, 0x" + TARGET_ABI_FMT_lx ", ...)", + name->name, + (int)arg1, + (unsigned long)arg2, + arg2 & IOC_OUT ? "R" : "", + arg2 & IOC_IN ? "W" : "", + (unsigned)IOCGROUP(arg2), + isprint(IOCGROUP(arg2)) ? (char)IOCGROUP(arg2) : '?', + (int)arg2 & 0xFF, + (int)IOCPARM_LEN(arg2), + arg3); +} + /* * Variants for the return value output function */