From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C3B713C691; Thu, 13 Jun 2024 15:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718291450; cv=none; b=GiV/NJHFYXHEFoMvWrCHqzVFlgrooCl+ruSP3Ayy4tQRBUp6EvHqcnF4Gjkv9ET1oqqzMBOv3FVJwIJ4m+phRCKHJK5INsc4AXbtcwkbStJXdt8Cf6dx32rqkE2qm90B3hpg1m8NG//0usg4VMHQs1NMLUSO2gCh9siVYM+Ft4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718291450; c=relaxed/simple; bh=7NXk+p80KoKxvILnhkPLqOnRPGa7Kr/UOYr9kzKZ6zU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Os937KiRPWMsZcQMaUFL4yA2hyBpkk67a3hgbGTT1p1jy0o6+HzsScHxaKqoJRUszR9alkbGPWA066lNsxB90m41HLBSJe8ki7otqbRaq5GlIgzaXUZ8a5CHyOlBtP74T9vsubY65lDwZA6beIrVrUnNECX2DE1Q8Rb0/hJd03A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DB91FEC; Thu, 13 Jun 2024 08:11:11 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3ADB23F73B; Thu, 13 Jun 2024 08:10:41 -0700 (PDT) Message-ID: <9814866a-8f9d-4d82-ad2d-4b36203aa196@arm.com> Date: Thu, 13 Jun 2024 16:10:39 +0100 Precedence: bulk X-Mailing-List: linux-csky@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/7] Refactor perf python module build To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , John Garry , Will Deacon , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Terrell , Ravi Bangoria , Kees Cook , Andrei Vagin , Athira Jajeev , Oliver Upton , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, coresight@lists.linaro.org, rust-for-linux@vger.kernel.org, bpf@vger.kernel.org References: <20240612183205.3120248-1-irogers@google.com> Content-Language: en-US From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 13/06/2024 15:15, Arnaldo Carvalho de Melo wrote: > On Thu, Jun 13, 2024 at 10:27:15AM +0100, James Clark wrote: >> On 12/06/2024 19:31, Ian Rogers wrote: >>> Refactor the perf python module build to instead of building C files >>> it links libraries. To support this make static libraries for tests, >>> ui, util and pmu-events. Doing this allows fewer functions to be >>> stubbed out, importantly parse_events is no longer stubbed out which >>> will improve the ability to work with heterogeneous cores. >>> >>> Patches 1 to 5 add static libraries for existing parts of the perf >>> build. >>> >>> Patch 6 adds the python build using libraries rather than C source >>> files. >>> >>> Patch 7 cleans up the python dependencies and removes the no longer >>> needed python-ext-sources. >>> >> >> Reviewed-by: James Clark >> >> It does require a clean build to avoid some -fPIC errors presumably >> because not everything that requires it gets rebuilt, for anyone who >> gets stuck on that. > > We need to find a way to avoid requiring the 'make clean' :-/ > > - Arnaldo > Do we need to make it so that if any of the Makefiles are touched it does a clean? I'm assuming that was the cause of the issue I experienced here and that the Makefile and/or Build files aren't mentioned as dependencies of any target. >>> Ian Rogers (7): >>> perf ui: Make ui its own library >>> perf pmu-events: Make pmu-events a library >>> perf test: Make tests its own library >>> perf bench: Make bench its own library >>> perf util: Make util its own library >>> perf python: Switch module to linking libraries from building source >>> perf python: Clean up build dependencies >>> >>> tools/perf/Build | 14 +- >>> tools/perf/Makefile.config | 5 + >>> tools/perf/Makefile.perf | 66 ++- >>> tools/perf/arch/Build | 4 +- >>> tools/perf/arch/arm/Build | 4 +- >>> tools/perf/arch/arm/tests/Build | 8 +- >>> tools/perf/arch/arm/util/Build | 10 +- >>> tools/perf/arch/arm64/Build | 4 +- >>> tools/perf/arch/arm64/tests/Build | 8 +- >>> tools/perf/arch/arm64/util/Build | 20 +- >>> tools/perf/arch/csky/Build | 2 +- >>> tools/perf/arch/csky/util/Build | 6 +- >>> tools/perf/arch/loongarch/Build | 2 +- >>> tools/perf/arch/loongarch/util/Build | 8 +- >>> tools/perf/arch/mips/Build | 2 +- >>> tools/perf/arch/mips/util/Build | 6 +- >>> tools/perf/arch/powerpc/Build | 4 +- >>> tools/perf/arch/powerpc/tests/Build | 6 +- >>> tools/perf/arch/powerpc/util/Build | 24 +- >>> tools/perf/arch/riscv/Build | 2 +- >>> tools/perf/arch/riscv/util/Build | 8 +- >>> tools/perf/arch/s390/Build | 2 +- >>> tools/perf/arch/s390/util/Build | 16 +- >>> tools/perf/arch/sh/Build | 2 +- >>> tools/perf/arch/sh/util/Build | 2 +- >>> tools/perf/arch/sparc/Build | 2 +- >>> tools/perf/arch/sparc/util/Build | 2 +- >>> tools/perf/arch/x86/Build | 6 +- >>> tools/perf/arch/x86/tests/Build | 20 +- >>> tools/perf/arch/x86/util/Build | 42 +- >>> tools/perf/bench/Build | 46 +- >>> tools/perf/scripts/Build | 4 +- >>> tools/perf/scripts/perl/Perf-Trace-Util/Build | 2 +- >>> .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- >>> tools/perf/tests/Build | 140 +++---- >>> tools/perf/tests/workloads/Build | 12 +- >>> tools/perf/ui/Build | 18 +- >>> tools/perf/ui/browsers/Build | 14 +- >>> tools/perf/ui/tui/Build | 8 +- >>> tools/perf/util/Build | 394 +++++++++--------- >>> tools/perf/util/arm-spe-decoder/Build | 2 +- >>> tools/perf/util/cs-etm-decoder/Build | 2 +- >>> tools/perf/util/hisi-ptt-decoder/Build | 2 +- >>> tools/perf/util/intel-pt-decoder/Build | 2 +- >>> tools/perf/util/perf-regs-arch/Build | 18 +- >>> tools/perf/util/python-ext-sources | 53 --- >>> tools/perf/util/python.c | 271 +++++------- >>> tools/perf/util/scripting-engines/Build | 4 +- >>> tools/perf/util/setup.py | 33 +- >>> 49 files changed, 612 insertions(+), 722 deletions(-) >>> delete mode 100644 tools/perf/util/python-ext-sources >>>