From patchwork Mon Oct 30 11:14:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 159690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2128707vqb; Mon, 30 Oct 2023 04:17:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyoeOu09KwHxTfvndYINeFrtl4Q2kwx+dRKAQ5zOR4X8xW/naX6BgZN8HUsC/y/XJLtiqw X-Received: by 2002:a05:6a00:2d0b:b0:692:6d3f:485b with SMTP id fa11-20020a056a002d0b00b006926d3f485bmr7655606pfb.3.1698664631474; Mon, 30 Oct 2023 04:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698664631; cv=none; d=google.com; s=arc-20160816; b=V3FmVIbiAUN51RhzMfaZjFqfgBQENZO/ytSbJOveZwWrUZ26Uu+rd9kccZ7ZoLnwN/ iItkCb5TiyTnjPLl4V/wymQHhGzeQDAIEfblpBTfY2yJnAUj2Hvp6S0jCUkR+J9IH8z5 Ug43YMn0nVFh1sp0I/ozSCcycT/rIIrb2WOSvHbUIx97wXr74ZtdxVvtWMS+9s1dLnFf qLK6D+QSlJJWQ10tFR7uJGsMQ+aZW340PkINPwBUG9KrngEB2fvOs5PMv9U63gk9uYDo hc79sRv3OatHK5ScB4XAxW3umJ1N1Yg2+T0R9Twm7Sc/GKrldxHi/j8TkWJ21HiJv/uy r0cw== 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 :message-id:date:subject:cc:to:from; bh=qnF85iwLnbfifqJBVEFqUL+kzbGIqPNiSbBllmGGjR0=; fh=JXx1mv1fB650HoTkc5GIgpDQ5Ey550GcDyaNZ/s6bYc=; b=QE0wmMq4nPWlGhB9yxriNSpAEx01fWfeOwk4bdD223MLUIPcx51brsSxXkUYx8XV6y oK5DodYeZ6WtYkB1TwojfZcNcgnVoPzY+yI/8AvaN84jL/XdWAqMnGsyyo5NqvZdE0RY od6GFb7sQdp5jQdNMfbRgwLqB8ebQ6BoulgfpL/jwXS4SVhsqE/OYRNNcNsAZMGJ+J+n I3zp3FCDP/NziqIAppV0KjoocljWY9GD4PbKxd2BkL6xVjf02HRXj4rCOo/EtQ71HNjY D69w5EgbuVpIDYGG1nIjZo8cdXn3Xbl73hD2kyHxUxqq33TuyEOB4OSsc0ywjlx4tRoF Fabw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ka18-20020a056a00939200b006933e8fec67si4931624pfb.227.2023.10.30.04.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 04:17:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 12D34806E153; Mon, 30 Oct 2023 04:17:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbjJ3LQy (ORCPT + 31 others); Mon, 30 Oct 2023 07:16:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232543AbjJ3LQx (ORCPT ); Mon, 30 Oct 2023 07:16:53 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1764B3; Mon, 30 Oct 2023 04:16:50 -0700 (PDT) Received: from kwepemm000003.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SJrHd2sNqzrTsK; Mon, 30 Oct 2023 19:13:49 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 30 Oct 2023 19:16:48 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 1/2] perf build: Add loading python binding check to python.so build Date: Mon, 30 Oct 2023 11:14:37 +0000 Message-ID: <20231030111438.1357962-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.22] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm000003.china.huawei.com (7.193.23.66) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 04:17:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781178964629363735 X-GMAIL-MSGID: 1781178964629363735 Add loading python binding check to python.so build so that problem can be detected in advance in the build phase instead of being left to `perf test` phase. In normal scenarios, the original build is not affected: $ cd tools/perf $ rm -rf /tmp/perf; mkdir /tmp/perf; make O=/tmp/perf $ echo $? 0 $ cd /tmp/perf $ ./perf test python 19: 'import perf' in python : Ok Create an error scenario, for example, delete util/rlimit.c from util/python-ext-sources: $ cd tools/perf $ sed -i 's@util/rlimit.c@#util/rlimit.c@g' util/python-ext-sources $ grep rlimit util/python-ext-sources #util/rlimit.c $ rm -rf /tmp/perf; mkdir /tmp/perf; make JOBS=1 O=/tmp/perf GEN /tmp/perf/python/perf.cpython-310-x86_64-linux-gnu.so Error: Load python binding failed. See /tmp/perf/python_ext_build/lib//build.log for more details make[2]: *** [Makefile.perf:644: /tmp/perf/python/perf.cpython-310-x86_64-linux-gnu.so] Error 1 make[1]: *** [Makefile.perf:242: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 $ cat /tmp/perf/python_ext_build/lib//build.log Traceback (most recent call last): File "", line 1, in ImportError: /tmp/perf/python_ext_build/lib/perf.cpython-310-x86_64-linux-gnu.so: undefined symbol: rlimit__increase_nofile Signed-off-by: Yang Jihong Acked-by: Namhyung Kim --- tools/perf/Makefile.perf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index d80dcaa5a1e3..a2449c4890ad 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -645,7 +645,13 @@ $(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): $(PYTHON_EXT_SRCS) $(PYTHON_EXT_ CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \ $(PYTHON_WORD) util/setup.py \ --quiet build_ext; \ - cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/ + $(PYTHON_WORD) -c 'import sys; sys.path.insert(0, "$(PYTHON_EXTBUILD_LIB)"); import perf' 2>$(PYTHON_EXTBUILD_LIB)/build.log; \ + if [ $$? -ne 0 ]; then \ + echo "Error: Load python binding failed. See $(PYTHON_EXTBUILD_LIB)/build.log for more details"; \ + exit 1; \ + else \ + cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/; \ + fi python_perf_target: @echo "Target is: $(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX)" From patchwork Mon Oct 30 11:14:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 159689 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2128653vqb; Mon, 30 Oct 2023 04:17:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIF2dY+mWs1XQGCMVDTMF8DeFqdcXNc0iuijaCo0LuE/FKjgFu4o3P2XWt33sYmt6vbeat X-Received: by 2002:a05:6a00:10d4:b0:690:1857:3349 with SMTP id d20-20020a056a0010d400b0069018573349mr11768131pfu.25.1698664621990; Mon, 30 Oct 2023 04:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698664621; cv=none; d=google.com; s=arc-20160816; b=RxSg4CY1+mYQ1wp4fldDyXYHd7OCGDx+KYA9GY62aqnQYKlzyZ9JrE6p9+dgNV7wzO vBkHp0HMmduuqHEv4Ykw0790Z8XcwaqB5DP030rTAqxfu2xS/suLqqsT7XhRQ0kFhRWx Ufz1obeRfiu2DTqmL724PPLRnNTmBVEBkf0y8MVsx01N/b4mR4rpbK/83UV+gy0/+oMD bnZgiygjuPdW42fOMHOyZVo4d7d4pkTNW6CaaAlndlsybyjZNoZ/wGfvr+l8w+z7mA9N RVSp970ywLaF1BZZRYvwsJOunLQzqdbQ8uqv6fysgyklM0jnkQs9MwE6BUzTpgORb3fo m38g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8P+Y5GjSDRrnUPD2xb6t8YjXMzc/aQ+FTQA0nXg2cIs=; fh=JXx1mv1fB650HoTkc5GIgpDQ5Ey550GcDyaNZ/s6bYc=; b=QqYK3Lgq5WhwihU3AV95AeC1yiMMtAfk+kYpv8BmhTx3MqgCMT6C8saGme0UTnJrhs bqfNnvtg/yQpzIF0taVeBDL3SOmKqsSAOERYobg5p7gAMPqnbeovhra4dRhIfdT3a7Vo PVP6S4jrjBZCxfw+A+cR7quQ6xfI9+D594Fmy8HIkIkqhX2RM7On7uCNek7u7wqBYTHB U8g4RLpoua/YFO3zAd2Ce3ZSOZGfEmp9UYSr0PA+mZPMI77yiqwCKrHORnwoa1vUTod5 /V7tQPylUMo1ScHUiWdbHPXCSDEXx4oXB+A0AZpwlR2prdcZ4pjLRU6g1tvHRrHfAw0F UEYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y13-20020aa79e0d000000b006c0f03b2467si2161882pfq.218.2023.10.30.04.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 04:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 20F4280C5F99; Mon, 30 Oct 2023 04:17:01 -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 S232938AbjJ3LQz (ORCPT + 31 others); Mon, 30 Oct 2023 07:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232821AbjJ3LQy (ORCPT ); Mon, 30 Oct 2023 07:16:54 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F776B4; Mon, 30 Oct 2023 04:16:51 -0700 (PDT) Received: from kwepemm000003.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SJrHd6Q3NzrTpK; Mon, 30 Oct 2023 19:13:49 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 30 Oct 2023 19:16:48 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 2/2] perf tools: Add the python_ext_build directory to .gitignore Date: Mon, 30 Oct 2023 11:14:38 +0000 Message-ID: <20231030111438.1357962-2-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231030111438.1357962-1-yangjihong1@huawei.com> References: <20231030111438.1357962-1-yangjihong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.174.22] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm000003.china.huawei.com (7.193.23.66) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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]); Mon, 30 Oct 2023 04:17:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781178954375609989 X-GMAIL-MSGID: 1781178954375609989 `python_ext_build` is the build directory for python.so, ignore it for cleaner git status. Signed-off-by: Yang Jihong --- tools/perf/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index f533e76fb480..ee5c14f3b8b1 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -49,3 +49,4 @@ libtraceevent/ libtraceevent_plugins/ fixdep Documentation/doc.dep +python_ext_build/