[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9756370bbcf53781b073dfc7953b76db0b69a08b.1672192591.git.nabijaczleweli@nabijaczleweli.xyz>
Date: Wed, 28 Dec 2022 02:58:40 +0100
From: Ahelenia Ziemiańska
<nabijaczleweli@...ijaczleweli.xyz>
To: unlisted-recipients:; (no To-header on input)
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: [PATCH v2 4/4] perf python: only check for the clang features we
care about removing
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=550ms (or, without the -c patch, 1.1s).
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@...ijaczleweli.xyz>
---
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 = get_config_vars()
for var in ('CFLAGS', 'OPT'):
vars[var] = sub("-specs=[^ ]+", "", vars[var])
- if not clang_has_option("-mcet"):
- vars[var] = sub("-mcet", "", vars[var])
- if not clang_has_option("-fcf-protection"):
- vars[var] = sub("-fcf-protection", "", vars[var])
- if not clang_has_option("-fstack-clash-protection"):
- vars[var] = sub("-fstack-clash-protection", "", vars[var])
- if not clang_has_option("-fstack-protector-strong"):
- vars[var] = sub("-fstack-protector-strong", "", vars[var])
- if not clang_has_option("-fno-semantic-interposition"):
- vars[var] = sub("-fno-semantic-interposition", "", vars[var])
- if not clang_has_option("-ffat-lto-objects"):
- vars[var] = sub("-ffat-lto-objects", "", vars[var])
+ for opt in ("-mcet", "-fcf-protection", "-fstack-clash-protection", "-fstack-protector-strong", "-fno-semantic-interposition", "-ffat-lto-objects"):
+ if vars[var].find(opt) != -1 and not clang_has_option(opt):
+ vars[var] = vars[var].replace(opt, "")
from setuptools import setup, Extension
--
2.30.2
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists