Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1460907ybl; Thu, 22 Aug 2019 15:10:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCItK5lVtzC4lA3Tw3UMHfo4xVhtphAeRMv7oXeIKkFJbm35zy4BsiRZs/gv6cY6T0PMtw X-Received: by 2002:a17:90a:cc13:: with SMTP id b19mr1894640pju.117.1566511828644; Thu, 22 Aug 2019 15:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566511828; cv=none; d=google.com; s=arc-20160816; b=Om9k2CjcTxK7c2+v0qnZZhSF6THFJwiyuzzZj4ZABUYBPCFfq77SE59QnkdjdmXTJM IfZgIC3c3oGeGXsTpYjoN+DOhwLc4b/M5DfDhlhz0KpFd6MDP2C7C+v9cnVVd1DHT7xm 2ayNi8XjcGn+W5bV1MZb/pBSKmW6iuTkHAMKrif6oYG/9q++JisKOYFMBtsKZ2asl64v BoHbzAjwzUlExQtwm4W6L9AhkBmxrPg6bjQ+dM6KTRMOYAh5y3W5Wkux5SpMMtcdphlY tc6Gs8ZQ67Mi/xCEEBckpIeV4y0hvgOuGUBhqdBpnHnhScSD0wu0u3RoyxqeFqlemhJz n4wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MbTLwwh1jvIWv8NZKD7X5Pvo4rIuF5PRtfhEECF7zzk=; b=v8SDmVrRDO69xS57vZk8gaGG5xLvgvc/Pf85TM6hyb8aWnS4Ged/rjpo+XsOca9+EL Nk0W3HSty4OOr35htgb5swAiYsLu/UM6nGGBA2bhvFGmew2CNs0FaOrqSPMpuEppyN3w +QWbzXyzvhW3evkRboIpVtVuyGrCxrTqvuL2vWGfFaINpSCRYHYOWI5eygimkivlKFKY 6cH+bxizp2SswUq8XxVYtKWgZ2vmtlWJYJCoJpwkaJ1ckqOdjjtf33lHs03gXA3YUgSR UC2sbih7AGIX5w74Dhzv4VHnvlI9jy94WKhXC3GK5wQIgaYufoGlbZMvDCYsQ+pX2cCb Wy2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WE2AHv5X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f33si672925plb.283.2019.08.22.15.10.13; Thu, 22 Aug 2019 15:10:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WE2AHv5X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390480AbfHVRIn (ORCPT + 99 others); Thu, 22 Aug 2019 13:08:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:58464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390450AbfHVRIl (ORCPT ); Thu, 22 Aug 2019 13:08:41 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC88123429; Thu, 22 Aug 2019 17:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493721; bh=s6L8OP4RVDz/IuSN61W9whRCpF375hdigkwWMzjI6no=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WE2AHv5X4zU4oBsSYG6JlHOWuTZHT0QP5DP5s9mMVyGaxVG3xkwG/E9Y8IgPULjj0 cgJIy4MA5dTxGRUC86F6ep0ImSbZ41Ea34gMLhyz1knyyZ5QsDWI4XSZZlz3/xUJVU et0gRl9kUZxZ/lWQZagtdgx/rVmSKw8DsTCvAcgA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , =?UTF-8?q?Luis=20Cl=C3=A1udio=20Gon=C3=A7alves?= , Namhyung Kim , Sasha Levin Subject: [PATCH 5.2 050/135] tools perf beauty: Fix usbdevfs_ioctl table generator to handle _IOC() Date: Thu, 22 Aug 2019 13:06:46 -0400 Message-Id: <20190822170811.13303-51-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo [ Upstream commit 7ee526152db7a75d7b8713346dac76ffc3662b29 ] In addition to _IOW() and _IOR(), to handle this case: #define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len) That will happen in the next sync of this header file. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-3br5e4t64e4lp0goo84che3s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/trace/beauty/usbdevfs_ioctl.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/trace/beauty/usbdevfs_ioctl.sh b/tools/perf/trace/beauty/usbdevfs_ioctl.sh index 930b80f422e83..aa597ae537470 100755 --- a/tools/perf/trace/beauty/usbdevfs_ioctl.sh +++ b/tools/perf/trace/beauty/usbdevfs_ioctl.sh @@ -3,10 +3,13 @@ [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ +# also as: +# #define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len) + printf "static const char *usbdevfs_ioctl_cmds[] = {\n" -regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]{0,2}\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*" -egrep $regex ${header_dir}/usbdevice_fs.h | egrep -v 'USBDEVFS_\w+32[[:space:]]' | \ - sed -r "s/$regex/\2 \1/g" | \ +regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)(\(\w+\))?[[:space:]]+_IO[CWR]{0,2}\([[:space:]]*(_IOC_\w+,[[:space:]]*)?'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*" +egrep "$regex" ${header_dir}/usbdevice_fs.h | egrep -v 'USBDEVFS_\w+32[[:space:]]' | \ + sed -r "s/$regex/\4 \1/g" | \ sort | xargs printf "\t[%s] = \"%s\",\n" printf "};\n\n" printf "#if 0\n" -- 2.20.1