From patchwork Wed Oct 25 11:23:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 158046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2525978vqx; Wed, 25 Oct 2023 04:23:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7TOXuF2iXY+SZp6KFTubnS4aWafbHLOwAmadXVycUx7FfywM8CjEBwQlcWtv1z/Xl9vc4 X-Received: by 2002:a25:bcca:0:b0:d9a:e1bb:5468 with SMTP id l10-20020a25bcca000000b00d9ae1bb5468mr13304728ybm.46.1698233017211; Wed, 25 Oct 2023 04:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698233017; cv=none; d=google.com; s=arc-20160816; b=ewgSmqYdmJDXc9U4T76mv+vPAZs6ExupnOLYb1GpzF/x5foVqJOgpEjcUcsOH/dzNl xgeVTvGDUjeBnb1S+0pWLgv3w1QlVChO2Xu35HB9lTXGkuckWv6WWCjaQ/Y1n30wszem MKbAjPd6PvOzQOHZj3rJUakmtgNF4VFGpwdCxhtZSLj2k6MW0pPQ7Ix987v0uhu04/z/ zAO80qDXlkl4YhT3NNX8jpmDG6pSfU0QBbi8YWeu9/OJ7s+1xg2JrfKRnzXrjz2Gaq5h CdMlqc+sBBr8xRfcyGRJuthsbENU+lJ7dMXH6x4A3oyA/bygd8RhvOekzuvo7ki08EaR jYxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=9jsE2NDmu3IVeLrANPLgs8Vt3GinxKrRrLuPb5JC31Y=; fh=EyWe0P73fPyeDH747e0yQkqJr8jU9wEoh208ROYzUDg=; b=vHevBjzkZoN8YVTpzD7n1ZKRPG2+P5L4CaszN2/hxsG+T4MQ5KA9z8W8EjKQuahF0y KJay31dSDJQuQdLmuLrffj6L+kvajqCvV1ZF1HU/NIivC6DiEOqQdLTqn1+hle+Ernh3 tjSbvCUWOiFlGwKAYHLtWs49TuB9udiaeQ9kp+iOwgPfsFtwQ+JdW8D/5TFZLgVoPIyX 5GZ0OPeV1u7NYVYy/fGwvvrQ9k1VeD/jj5YK/Jz+U+Q5ywuXX65JS3LeILaIs9sSndyr k2TfgYgjkOAj7Wvh/mJ5UScJoF2X/DZznXh/c+U5S1aMwnDh0/+P/5ibq3Wfwdm4XD1e 377A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eC7a/rJ1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x7-20020a056902102700b00d9cc1ed345csi3917249ybt.372.2023.10.25.04.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eC7a/rJ1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 75DD08106F55; Wed, 25 Oct 2023 04:23:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234660AbjJYLXM (ORCPT + 26 others); Wed, 25 Oct 2023 07:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234479AbjJYLXL (ORCPT ); Wed, 25 Oct 2023 07:23:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05F0D130 for ; Wed, 25 Oct 2023 04:23:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2699CC433C8; Wed, 25 Oct 2023 11:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698232988; bh=rd8vsu6VohhU/lcsgpXqdi7nIrZyR6h4n0YxnC1/pQM=; h=Date:From:To:Cc:Subject:From; b=eC7a/rJ18UcEM9fHbpovUo0TkOPNGQdPNEJfnTsSh2Pm0hVznbAoxo93mM8m3YxS/ rq7p7v7Tw9AFPoKraGX6w/50zZ5zfSsFEbtbC/2x+bODvR+lxL/2Wv5QeAfb+DdW1Z 8u7N3cyX7mu91uOzpt4wnuxsGVT5xa5je7BZIh4egeIAKLVfuGP9NnGI/LT5X/tRGl aAvkFJLJphftUJlqpeeEQYjtUTsl8yLP+HZiup7pggGhubPpzdvh06ELROUSTrAHYJ RfG3kypUaPYi6bUn2PpJyKKidP/udKN0fs1XgW2DXSbL9wAk/afOumyYDO4RC+yx0W VN2EROU/1lw2w== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 42EC74035D; Wed, 25 Oct 2023 08:23:05 -0300 (-03) Date: Wed, 25 Oct 2023 08:23:05 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List Subject: [PATCH 1/1] perf build: Address stray '\' before # that is warned about since grep 3.8 Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 04:23:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780726383935708734 X-GMAIL-MSGID: 1780726383935708734 To address this grep 3.8 warning: grep: warning: stray \ before # We needed to remove the '' around the grep expression and keep the \ before # so that it is escaped by the $(shell grep ...) and thus doesn't get to grep. We need that \ before the #, otherwise we get this: Makefile.perf:364: *** unterminated call to function 'shell': missing ')'. Stop. As everything after the # will be considered a comment. Removing the single quotes needs some more escaping so that _some_ of the escaped chars gets to grep, like the '\|' that becomes '\\\|ยด. Running on debian:10, where there is no libtraceevent-devel available, we get: Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 I.e. both the comments and the util/trace-event.c were removed. When using: msg := $(error PYTHON_EXT_SRCS=$(PYTHON_EXT_SRCS)) While on the more recent fedora:38, with the new grep and make packages and libtraceevent-devel installed: Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c util/trace-event.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf' $ I.e. only the comments were removed. If we build it on the same fedora:38 system, but using NO_LIBTRACEEVENT=1 $ make NO_LIBTRACEEVENT=1 CORESIGHT=1 O=/tmp/build/$(basename $PWD) -C tools/perf install-bin Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf' $ Both comments and the util/trace-event.c file removed. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers --- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 456872ac410df4c0..d80dcaa5a1e337ae 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -361,7 +361,7 @@ python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT ifeq ($(CONFIG_LIBTRACEEVENT),y) PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) else - PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources) + PYTHON_EXT_SRCS := $(shell grep -v ^\#\\\|util/trace-event.c util/python-ext-sources) endif PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBAPI)