From patchwork Sun Oct 9 13:28:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Syromyatnikov X-Patchwork-Id: 9369103 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6955660487 for ; Mon, 10 Oct 2016 08:32:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CAA729325 for ; Mon, 10 Oct 2016 08:32:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5014529340; Mon, 10 Oct 2016 08:32:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E280029325 for ; Mon, 10 Oct 2016 08:32:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9A8UfRn053189; Mon, 10 Oct 2016 04:30:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u99DT0MW016555 for ; Sun, 9 Oct 2016 09:29:00 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u99DT0HK002648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 9 Oct 2016 09:29:00 -0400 Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73018C05678E; Sun, 9 Oct 2016 13:28:59 +0000 (UTC) Received: by mail-lf0-f68.google.com with SMTP id l131so5462133lfl.0; Sun, 09 Oct 2016 06:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gvU98Dd24DB09YZFj0fX4v207Ag7iuViHUMymesAs14=; b=GM8EutWSU5pmxHlNuQv0aiwludkDFTzyVgAyW/A1qZXzhCopqiLowCPOJZZA97HF6k VU8i6ESRT6fTR3Xc0JxY5c2/QcIfTr9iNv1aCRe/H+zd2XQuW6FYT8RZs4s3XyMrW4bv 4bsGfyQOsFDQtyifsYBCkfPfWD04Tr1aS71KlSxRgsHIPCLw63aIEmMui58DI1tHz8Dc yP3eNh8qXHxm774P5kICyayk+PlibKDiocZV+nPMcHHpxvxN6ZTQeemTGtAHKJfXV0eF xvXXS3zVGXBD2QED9+ALIF03cmrb3R/DWUPaLP9efg521YQkMVQ9neFD4V7sychuiaUl oE+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gvU98Dd24DB09YZFj0fX4v207Ag7iuViHUMymesAs14=; b=lmH8rZnLagS2DXLmhyLWKPBY4eNhB8AnF7qvWS8/gvUs7skK8txfVmxPZSnUt77qSC o7NatUrQ6xoPp8Mk8mhe2nOz3ay5a7MjcQfxmJnPq1mdSEcUgKfBZWpJ0hU7iLiMXq+I Sdq8X5vtJjURilsOkLr8RxAdgCyA1ZRCC5JWicK6ASLFT4W0SwwTfwyXCdFdDkgKP9OT vMBBm6j/Xg+RAg6XUkxbAu5jVs/LgqaWG8ap80vlmSyMZR6D5NFfrZ1G2kAimaFPwbM4 iodb8PuNHrVLhzw0CFbVSX1nRssP7HvnxR60xaSRY5Vzhzzk9BWBA1jHtN3FeJ+qr1NN h3Kw== X-Gm-Message-State: AA6/9Rku2z4T6xYISLZCNNZ2y4u3sj06QheUWKJJEIdYlcd0LVGVyspGS+4H9w6iaLCT3A== X-Received: by 10.25.198.9 with SMTP id w9mr12112559lff.164.1476019737795; Sun, 09 Oct 2016 06:28:57 -0700 (PDT) Received: from obsidian (broadband-46-188-15-144.2com.net. [46.188.15.144]) by smtp.gmail.com with ESMTPSA id e70sm5136955lji.30.2016.10.09.06.28.56 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 09 Oct 2016 06:28:57 -0700 (PDT) Date: Sun, 9 Oct 2016 16:28:55 +0300 From: Eugene Syromyatnikov To: strace-devel@lists.sourceforge.net Message-ID: <20161009132855.GA2201@obsidian> References: <20161005.192828.566127461630656590.yamato@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161005.192828.566127461630656590.yamato@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 09 Oct 2016 13:28:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 09 Oct 2016 13:28:59 +0000 (UTC) for IP:'209.85.215.68' DOMAIN:'mail-lf0-f68.google.com' HELO:'mail-lf0-f68.google.com' FROM:'evgsyr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.68 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.68 mail-lf0-f68.google.com 209.85.215.68 mail-lf0-f68.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 10 Oct 2016 04:29:54 -0400 Cc: dm-devel@redhat.com, mpatocka@redhat.com, yamato@redhat.com Subject: [dm-devel] [PATCH 04/21] dm: Minor output tweaks X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP Trying to make it more C-like and in line with common practices regarding structure printing. --- dm.c | 21 +++++++++++++-------- tests/ioctl_dm.c | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dm.c b/dm.c index d81983d..ebdfc44 100644 --- a/dm.c +++ b/dm.c @@ -120,7 +120,7 @@ dm_decode_dm_target_spec(struct tcb *tcp, const struct dm_ioctl *ioc, offset = new_offset; } else { misplaced: - tprints(", misplaced struct dm_target_spec"); + tprints(", /* misplaced struct dm_target_spec */ ..."); break; } } @@ -150,7 +150,7 @@ dm_decode_dm_target_deps(const struct dm_ioctl *ioc, const char *extra, tprints("}"); } else { misplaced: - tprints(", misplaced struct dm_target_deps"); + tprints(", /* misplaced struct dm_target_deps */ ..."); } } @@ -182,7 +182,7 @@ dm_decode_dm_name_list(const struct dm_ioctl *ioc, const char *extra, offset = offset + s->next; } else { misplaced: - tprints(", misplaced struct dm_name_list"); + tprints(", /* misplaced struct dm_name_list */ ..."); break; } } @@ -216,7 +216,8 @@ dm_decode_dm_target_versions(const struct dm_ioctl *ioc, const char *extra, offset = offset + s->next; } else { misplaced: - tprints(", misplaced struct dm_target_versions"); + tprints(", /* misplaced struct dm_target_versions */ " + "..."); break; } } @@ -240,7 +241,7 @@ dm_decode_dm_target_msg(const struct dm_ioctl *ioc, const char *extra, QUOTE_0_TERMINATED); tprints("}"); } else { - tprints(", misplaced struct dm_target_msg"); + tprints(", /* misplaced struct dm_target_msg */"); } } @@ -255,7 +256,7 @@ dm_decode_string(const struct dm_ioctl *ioc, const char *extra, print_quoted_string(extra + offset, extra_size - offset, QUOTE_0_TERMINATED); } else { - tprints(", misplaced string"); + tprints(", /* misplaced string */"); } } @@ -275,8 +276,10 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) * if we use a different version of ABI, do not attempt to decode * ioctl fields */ - if (ioc.version[0] != DM_VERSION_MAJOR) + if (ioc.version[0] != DM_VERSION_MAJOR) { + tprints(", /* Unsupported device mapper ABI version */ ..."); goto skip; + } if (ioc.data_size > sizeof(ioc)) { extra = malloc(ioc.data_size); @@ -292,7 +295,9 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) dm_decode_device(code, &ioc); dm_decode_values(tcp, code, &ioc); dm_decode_flags(&ioc); - if (!abbrev(tcp)) + if (abbrev(tcp)) + tprints(", ..."); + else switch (code) { case DM_DEV_WAIT: case DM_TABLE_STATUS: diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c index cb6dd97..ba484ee 100644 --- a/tests/ioctl_dm.c +++ b/tests/ioctl_dm.c @@ -98,7 +98,7 @@ main(void) "{version=4.1.2, dev=makedev(18, 52), name=\"nnn\", " "uuid=\"uuu\", target_count=4294967295, flags=0, " "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " - "misplaced struct dm_target_spec}, " + "/* misplaced struct dm_target_spec */ ...}, " "{version=4.1.2, dev=makedev(18, 52), name=\"nnn\", " "uuid=\"uuu\", flags=0}) = -1 EBADF (%m)\n");