Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3947250rwl; Tue, 27 Dec 2022 18:43:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXsY122h6aHE7+qVnAGHGlw2Tiv+ieTg8qIkivySqb3/okskNEFuID6xXoBIpSizQhdRWlue X-Received: by 2002:a17:906:684b:b0:7c1:ff4:d0c6 with SMTP id a11-20020a170906684b00b007c10ff4d0c6mr20935662ejs.36.1672195412856; Tue, 27 Dec 2022 18:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672195412; cv=none; d=google.com; s=arc-20160816; b=L12IJ4ibw4HsmCQXty+PgjSV5fMZnw0kuNsQ9H79w/LQITask0b4nSgCM8qC99yBhe VtCCp+UOo60S+REb7jdhcnsPHvjcGdBjwixMBnfKB5movh8ll7mfAqJOuHqM3C5bPe1W ejy53GBIaGuHTHyJxqaCh1zTvounPnHsfdrwAEBtg4xjYF9i+/FXaKnoONKEEVsw71Oo Ztr/bfN6q1vV4N+mlnmel94XW/ijjSGbP+xo1v/9Sg70uKCZmgtb8rhP+K25G4HaBl0D wIP9UDthTRe266Jl/yr036EfKymoxCfBYoVqAl2H4ZcALJT+6aU8SFHg5Q6h+EkzmXVq Rhxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=c+emAzP2819+NwSWvo0hj9NxKeB8ohnCV+rjZM+j+kA=; b=f/QHjcwz2XwicmSstfUwGvxHJn/XqrhjA48DxaxwIFFWsRuDkUWzD1XYZn1Q7ZDyM+ ddq4aCBKtehMD7lvT/KijfkIi7fOX5jGpLCbJQlmBJFtE+OV1SKwEsz1z24Vc989kB+E Aoxb4ERE1FG6dA9tutp+brbKZP2HUNQ/8RAxoQQ0Y7FVV97A9rtto5oWAFnuQgoDl+X4 ymUvMOUlMCafnstPoBvpCCFJwDA1MW2wLiniGMhChKcRoiaghEPv0OTwkDiFKzwQWfPN kp51rVvWWguOpEL1yzyvUlvwbm+NZiwnEETQggytFYW2VmOJYQb10BjN88dsbMuoRe3w r/xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=ZTOnaPXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xh9-20020a170906da8900b0084c464789absi7397361ejb.781.2022.12.27.18.43.17; Tue, 27 Dec 2022 18:43:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=ZTOnaPXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232602AbiL1B65 (ORCPT + 65 others); Tue, 27 Dec 2022 20:58:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbiL1B6m (ORCPT ); Tue, 27 Dec 2022 20:58:42 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E23B7292; Tue, 27 Dec 2022 17:58:41 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 401901106; Wed, 28 Dec 2022 02:58:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1672192721; bh=T0xNNhCSq7eox6ZW7rwjelLQ+yuE6npQ6iDEXXXfl30=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=ZTOnaPXuT3XIbwLeV/42cgze1icACWTRw/6Do4cHQZC4rcrCOSV2oMLKDwCxsnnDi NBMFkQz8nQ59zuEpTcREVFSJfbUGOmgjfSJQbCJdCgxEQIGGMvUNeRR0fV7vIowW0F QL9aIXvtp6LeZF2ALe5CKE/+wdHg54VVOMKbHTHMaB6OJet1RX4imW18Bm0FHL+yYe i5sivRv4tNE8thKMZJiZAAp4gh31nT1CqwKeuvWgPzq/0oRxjHTlP89F3EcVOQgZWA yte3vIWy86KQbZuNYSnatvL3sKSYXxVQSjKPs6LC+K9NiluMWhiTlPIBVbeZIZoIGa U8ZGz7PGac86g== Date: Wed, 28 Dec 2022 02:58:40 +0100 From: Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2 4/4] perf python: only check for the clang features we care about removing Message-ID: <9756370bbcf53781b073dfc7953b76db0b69a08b.1672192591.git.nabijaczleweli@nabijaczleweli.xyz> References: <44bb9a29bd7a0385c25ebfd69abd0a41ac2d753b.1672187710.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vyuwmpmjt5cojxm7" Content-Disposition: inline In-Reply-To: <44bb9a29bd7a0385c25ebfd69abd0a41ac2d753b.1672187710.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS,T_PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vyuwmpmjt5cojxm7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Instead of checking for all 6 flags every time for both fields, only check for the ones we already know are in there. This means instead of running 2*6 processes, we run, on my Bullseye system, just one (for -fstack-protector-strong)! This reduces the run-time by appx. (2*6-1)*.05=3D550ms (or, without the -c patch, 1.1s). Signed-off-by: Ahelenia Ziemia=C5=84ska --- tools/perf/util/setup.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 0a557f2bf357..f4b94c0f9055 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -14,18 +14,9 @@ if cc_is_clang: vars =3D get_config_vars() for var in ('CFLAGS', 'OPT'): vars[var] =3D sub("-specs=3D[^ ]+", "", vars[var]) - if not clang_has_option("-mcet"): - vars[var] =3D sub("-mcet", "", vars[var]) - if not clang_has_option("-fcf-protection"): - vars[var] =3D sub("-fcf-protection", "", vars[var]) - if not clang_has_option("-fstack-clash-protection"): - vars[var] =3D sub("-fstack-clash-protection", "", vars[var]) - if not clang_has_option("-fstack-protector-strong"): - vars[var] =3D sub("-fstack-protector-strong", "", vars[var]) - if not clang_has_option("-fno-semantic-interposition"): - vars[var] =3D sub("-fno-semantic-interposition", "", vars[var]) - if not clang_has_option("-ffat-lto-objects"): - vars[var] =3D sub("-ffat-lto-objects", "", vars[var]) + for opt in ("-mcet", "-fcf-protection", "-fstack-clash-protection"= , "-fstack-protector-strong", "-fno-semantic-interposition", "-ffat-lto-obj= ects"): + if vars[var].find(opt) !=3D -1 and not clang_has_option(opt): + vars[var] =3D vars[var].replace(opt, "") =20 from setuptools import setup, Extension =20 --=20 2.30.2 --vyuwmpmjt5cojxm7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmOros8ACgkQvP0LAY0m WPHFHhAArFjDykBA0LHZzcLMo3iyNVhQA9VFtxQMepwy+xju3KtPQmhhAzv8xPxU 9G6I9L7wgc+Z3D0SbQc4hY+KMDSvDQHUIVp+tZZwOz05uBVbBa/36o4F/eVzWnnO eYeLuEYPrXxPeQq6DPk7gEonqNrprwWnTSTFcsJ99Qur10ge819FAkqPxbMYyVsM aIn5JyDky95YNc0qrx+cUba33TKDAAL6u3NROe2s9VXgjq3Rx6/6p1OOBrcOS0xD DfOqeQXosNJ+cKE27AhR3XAjdkZbLWC1cdomqNz2xSua6K8fuvzjTG4Ui9uwicCS +XHpEcJjmGMDEOfU7B5WkibQIG+lP7VTfdjK+BqacQOqGK17x2gYllUvWeRUaTYA fpVkYJduCk3B3umgWrJujBC1zl8sfCjLLUrh1tYaCMY6LI+vsT47hpYnfgoLVtdS xrAeH0y5Ia9PobukkdYuYVV4lqVUhz8i/u2pJ5wBx6kLvgnAuoKfF5LHC/NVsdnf ZqzkvLAMCxqanJ19eqeUfP92jZxujhT7uczTt82mBST3YCwKKKPEgQFUXTBWQk+u OXtiwVWDM/MV0do95T3I8Xf8LobnuD8JtMgbXY4ZXhxXd2CrV5iCu1U2UbRCeMf4 sDPcKFMi8DhX0CVZMlPCAJHAcHMPpAA1Zk6ERPaM8oGuhSlbCfQ= =VJVc -----END PGP SIGNATURE----- --vyuwmpmjt5cojxm7--