Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4627523pxj; Wed, 12 May 2021 09:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyrFP6KYOFlEO7LF0LNNf6BSfr5thVVAuo4DAJ9tVZdw0eoR4ACn9bYNa5slrBCk+w1Lc2 X-Received: by 2002:a05:6512:3e12:: with SMTP id i18mr15990350lfv.154.1620837171229; Wed, 12 May 2021 09:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837171; cv=none; d=google.com; s=arc-20160816; b=01LNixeEgfz1UP7esgbxtfO8G8xat6TP/vwMWr1ciOYEw/ixp0oem2allEQlqq5xBA sCfM5JcvUoHGmy7V6rwIJZ3WwNGPC1ZVn5msZEQ6eyRGS00Jdz5wfpVhzqXI0eysHtAu YVk2hG2tsaxrn1DC2hVaMUMnBHlPKb8mDNmiojpN4ppgiOaIyWhcJ+Lb8lXuMOBWpFyE FzVBk2TFs4GDSbUZoCy3YN5rj/4IEzO4r4U3z6fvXQvGht3ScqM4YT0qmaMr8nctaDJf Wr4PsidKOutxN0JiBz1T8SxtNLqoDUPm6FvNhmPRqiEwTOmxIOYE7Sfs47RZSYxHP0pl dQuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G2hLWUloM+9mBx/rkuRuxL5/nR+HODfJ8IGm6jPImuM=; b=Zh4R4LBcCXJH2sa21s1GBSh8FpquyeN1ZwNcPpfwqC9imElhLlg6Iy9hsQ0rX5ZNdJ Gy+rHSDHv0WJ+hKw0pMmKNvf5H0aEA2U+L09M/mHPuNkQJlE0pQX8N8BTxDx71gTI677 1Fw9OYC7u1szozmpO2rn4syRDpMKRleiH1TZpZ/HHTFrRsf+h4Vk19snP/nWNYhb594b GkVr7PGPBz7eN5OKIeVVgUaMq7zrsU1NbicgrD49czJfiM2wWwo6D/Wl+4gkNTih1TdR BLOzrogGLGes7G9LPUVr10KaQX8OeX7DiKNR0CCtXmcKbzT9Vt/pQFTtiyhaY4njMNnT h8mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UbwIcW12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si385496ljp.17.2021.05.12.09.32.21; Wed, 12 May 2021 09:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UbwIcW12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241867AbhELQbC (ORCPT + 99 others); Wed, 12 May 2021 12:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235632AbhELPkL (ORCPT ); Wed, 12 May 2021 11:40:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EDE761C70; Wed, 12 May 2021 15:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832856; bh=RcW17yEpprrcJBjwBZinKm14ZuE9ekd/3tVi4ft1fcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UbwIcW12z9eau6Rmb3XbHh6MpxEgr8oo6lE0ABKBdUQN+FecFjzk1X0trd2ItsivP Dm7D0XP8vMdpjhNC1Jkzv06CHJqo9cTjY5bYSNpxl6taulbchet0NxKDqeOgww2FK3 v63AwbYQCTEvpbltGQ4OIrvR+870t3CibsLIWN8g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Chikunov , Arnaldo Carvalho de Melo , Sasha Levin , "Dmitry V . Levin" Subject: [PATCH 5.10 452/530] perf beauty: Fix fsconfig generator Date: Wed, 12 May 2021 16:49:22 +0200 Message-Id: <20210512144834.616983638@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Chikunov [ Upstream commit 2e1daee14e67fbf9b27280b974e2c680a22cabea ] After gnulib update sed stopped matching `[[:space:]]*+' as before, causing the following compilation error: In file included from builtin-trace.c:719: trace/beauty/generated/fsconfig_arrays.c:2:3: error: expected expression before ']' token 2 | [] = "", | ^ trace/beauty/generated/fsconfig_arrays.c:2:3: error: array index in initializer not of integer type trace/beauty/generated/fsconfig_arrays.c:2:3: note: (near initialization for 'fsconfig_cmds') Fix this by correcting the regular expression used in the generator. Also, clean up the script by removing redundant egrep, xargs, and printf invocations. Committer testing: Continues to work: $ cat tools/perf/trace/beauty/fsconfig.sh #!/bin/sh # SPDX-License-Identifier: LGPL-2.1 if [ $# -ne 1 ] ; then linux_header_dir=tools/include/uapi/linux else linux_header_dir=$1 fi linux_mount=${linux_header_dir}/mount.h printf "static const char *fsconfig_cmds[] = {\n" ms='[[:space:]]*' sed -nr "s/^${ms}FSCONFIG_([[:alnum:]_]+)${ms}=${ms}([[:digit:]]+)${ms},.*/\t[\2] = \"\1\",/p" \ ${linux_mount} printf "};\n" $ tools/perf/trace/beauty/fsconfig.sh static const char *fsconfig_cmds[] = { [0] = "SET_FLAG", [1] = "SET_STRING", [2] = "SET_BINARY", [3] = "SET_PATH", [4] = "SET_PATH_EMPTY", [5] = "SET_FD", [6] = "CMD_CREATE", [7] = "CMD_RECONFIGURE", }; $ Fixes: d35293004a5e4 ("perf beauty: Add generator for fsconfig's 'cmd' arg values") Signed-off-by: Vitaly Chikunov Co-authored-by: Dmitry V. Levin Tested-by: Arnaldo Carvalho de Melo Link: http://lore.kernel.org/lkml/20210414182723.1670663-1-vt@altlinux.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/trace/beauty/fsconfig.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/perf/trace/beauty/fsconfig.sh b/tools/perf/trace/beauty/fsconfig.sh index 83fb24df05c9..bc6ef7bb7a5f 100755 --- a/tools/perf/trace/beauty/fsconfig.sh +++ b/tools/perf/trace/beauty/fsconfig.sh @@ -10,8 +10,7 @@ fi linux_mount=${linux_header_dir}/mount.h printf "static const char *fsconfig_cmds[] = {\n" -regex='^[[:space:]]*+FSCONFIG_([[:alnum:]_]+)[[:space:]]*=[[:space:]]*([[:digit:]]+)[[:space:]]*,[[:space:]]*.*' -egrep $regex ${linux_mount} | \ - sed -r "s/$regex/\2 \1/g" | \ - xargs printf "\t[%s] = \"%s\",\n" +ms='[[:space:]]*' +sed -nr "s/^${ms}FSCONFIG_([[:alnum:]_]+)${ms}=${ms}([[:digit:]]+)${ms},.*/\t[\2] = \"\1\",/p" \ + ${linux_mount} printf "};\n" -- 2.30.2