From patchwork Tue Oct 31 15:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 160163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp321499vqg; Tue, 31 Oct 2023 08:30:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHN45wAx0cpfZU6h+44iGqXvVoRfNjDsJd6a1ZmkKSklBUd9/6nrsMasOUFYTIoUmUTtqyc X-Received: by 2002:a05:6a20:1f81:b0:16b:d470:b403 with SMTP id dm1-20020a056a201f8100b0016bd470b403mr10705815pzb.28.1698766205645; Tue, 31 Oct 2023 08:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698766205; cv=none; d=google.com; s=arc-20160816; b=I9g2BPZZunfJSMgFZr3FVm3/XDB+KxMar/yxtqxsy4KzBlmERAVbXMiQbYB45QOwhO jkdG6XV3zFczdlQsOIE9jk34liBepQLeXXxsn5PLfkSkySJyJ4yW5kfxoJIUh2W5i5um uNQdd0H1LZhlvc6nlBe+IWJfMBfI/S4kVWNN0fpTXHcXvfjcLe9o7msCZ7ZPvf937XEb Q4DbM4Zrh5qtYs3Sj/qNlOq+DfcVOfpAq45xbLqYTAg/uJcUCLRMU/G90b56xqTl2Nzv z0bOEUu1rpSDcLrA0R4eTUjVDJrNhtQYCZh4YT0zOMUVC9seS1xzv4ScRE2s2FMvawFa QMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=IEwpBAmVAQ+MI3OhDVIxR5mT+zl2OYhp4SOeEGeCqhw=; fh=ficwc02GdE+VePKm9rl4PU8GKgAUggfpuxAtr64RN+Q=; b=Kr4QNtiFnlqeIEGCNnOaFlzyj1EJ7aXpC0hUqJv0vG1ldGcCX+pgYubcfOLYqvFLmw ceLTLLM6HzMIx4ct5l4xLXahrgBCk6jQLPR95mqqY1hlYBwFK4IIoIVxVCUM17X+RLEP DN1mnpYPvHOyHXdLqmfG++7s3zGRUJtGMfSPgAwnJioxdJ/VHVBxndG7KSqojUy23YzX Cq7OLQ6Srp62wc86KOgA9m89vULb2arymbd5EQxkOeT85A1NwZs0BQ0RLdjqisqVj7cG uG3B1Z6kycds/LiYVzF0U1GJd9xsVgdzufr30337t1cN5ueddMJO/CoBKeja5GSqun9T 82QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DUnQos1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q11-20020a056a00150b00b006bca1443f29si1119887pfu.297.2023.10.31.08.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DUnQos1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A0D0E801F74F; Tue, 31 Oct 2023 08:30:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345002AbjJaPaD (ORCPT + 33 others); Tue, 31 Oct 2023 11:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344229AbjJaPaC (ORCPT ); Tue, 31 Oct 2023 11:30:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9AFC1 for ; Tue, 31 Oct 2023 08:29:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D3E4C433C7; Tue, 31 Oct 2023 15:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698766199; bh=rxuRTaIT9pmaTWt2pQ7fckfcepAPCBhaM/SIwHI5TwU=; h=Date:From:To:Cc:Subject:From; b=DUnQos1DvY96N15uUhrCmonwEiOD1Cvw2tU39bfox/Fb8RM87kene+CmxU5Hivuvb 6vFzYmmF3AvugdsDUFsYxZoYPMsBxs6mzMRBSP1bjBayBdB0A408/YtHyXC/88mmKq 46CYNC8GDrXfndr0sjueI9miRYNnPv2ENmMXn464cfAyT9dWCx4mrdmMo3qKEaBYvu tQp4zsl7X8DaqYfs4RJCrh5fieMxoumadCrPd3XODxH+Kkk9a2EBkDYr7OfOc7+rtw K+3TWbjZ9hTejStyMaUPuudOWeT4s53TpC6t+hQGGMR8yt1aw5qX23FnMZMdsqK/m5 sXNDf1H7bSrvg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2B1C24035D; Tue, 31 Oct 2023 12:29:56 -0300 (-03) Date: Tue, 31 Oct 2023 12:29:56 -0300 From: Arnaldo Carvalho de Melo To: Linux Kernel Mailing List Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim Subject: [PATCH next 1/1] perf beauty socket/prctl_option: Cope with extended regexp complaint by grep Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 08:30:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781285472723848845 X-GMAIL-MSGID: 1781285472723848845 Noticed on fedora 38, the extended regexp that so far was ok for both grep and sed now gets complaints by grep, that says '/' doesn't need to be escaped with '\'. So stop using '/' in sed, use '%' instead and remove the \ before / in the common extended regexp. Link: https://x.com/SMT_Solvers/status/1710380010098344192?s=20 Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim --- tools/perf/trace/beauty/prctl_option.sh | 4 ++-- tools/perf/trace/beauty/socket.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/trace/beauty/prctl_option.sh b/tools/perf/trace/beauty/prctl_option.sh index 8059342ca4126c38..9455d9672f140d13 100755 --- a/tools/perf/trace/beauty/prctl_option.sh +++ b/tools/perf/trace/beauty/prctl_option.sh @@ -4,9 +4,9 @@ [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ printf "static const char *prctl_options[] = {\n" -regex='^#define[[:space:]]{1}PR_(\w+)[[:space:]]*([[:xdigit:]]+)([[:space:]]*\/.*)?$' +regex='^#define[[:space:]]{1}PR_(\w+)[[:space:]]*([[:xdigit:]]+)([[:space:]]*/.*)?$' grep -E $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \ - sed -r "s/$regex/\2 \1/g" | \ + sed -E "s%$regex%\2 \1%g" | \ sort -n | xargs printf "\t[%s] = \"%s\",\n" printf "};\n" diff --git a/tools/perf/trace/beauty/socket.sh b/tools/perf/trace/beauty/socket.sh index 8bc7ba62203e4a9d..670c6db298ae0298 100755 --- a/tools/perf/trace/beauty/socket.sh +++ b/tools/perf/trace/beauty/socket.sh @@ -18,10 +18,10 @@ grep -E $ipproto_regex ${uapi_header_dir}/in.h | \ printf "};\n\n" printf "static const char *socket_level[] = {\n" -socket_level_regex='^#define[[:space:]]+SOL_(\w+)[[:space:]]+([[:digit:]]+)([[:space:]]+\/.*)?' +socket_level_regex='^#define[[:space:]]+SOL_(\w+)[[:space:]]+([[:digit:]]+)([[:space:]]+/.*)?' grep -E $socket_level_regex ${beauty_header_dir}/socket.h | \ - sed -r "s/$socket_level_regex/\2 \1/g" | \ + sed -E "s%$socket_level_regex%\2 \1%g" | \ sort -n | xargs printf "\t[%s] = \"%s\",\n" printf "};\n\n"