summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/perf
AgeCommit message (Collapse)Author
2024-04-08perf: make bpf asm include arch conditionalBruce Ashfield
To keep the perf source copying as small as possible, we can further refine the arch/uapi copy to the single file that we currently need. To avoid a warning from the general perf source copy routine, we make the .h conditional based on the architecture. The supported architectures will not change often, so updating this arch list is very minimal effort. Alternatively, we could add a PERF_OPTIONAL_SRC variable and not warn if a file isn't available for a given architecture. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-08perf: add asm include required for v6.9+Max Krummenacher
Kernel commit 9eea8fafe33e ("libbpf: fix __arg_ctx type enforcement for perf_event programs") added with 6.9-rc1 tools/include/uapi/asm/bpf_perf_event.h which for arc, arm64, loongarch, riscv and s390 includes headers from the arch/${ARCH}/... directories. Which results in: ERROR: perf-1.0-r0 do_compile: oe_runmake failed | In file included from 1.0/perf-1.0/tools/include/uapi/linux/bpf_perf_event.h:11, | from libbpf.c:36: | perf/1.0/perf-1.0/tools/include/uapi/asm/bpf_perf_event.h:2:10: fatal error: ../../arch/arm64/include/uapi/asm/bpf_perf_event.h: No such file or directory | 2 | #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h" | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We copy the uapi/asm directory to make sure the header file is present. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04perf: fix TMPDIR contamination for recent mainline kernelsEnrico Jörns
The sed command sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \ ${S}/tools/perf/Makefile.perf that was introduced by oe-core commit 43f96506 ("perf: fix the install-python_ext") [1] and adapted with oe-core commit 138673f8 ("perf: Fix reproducibility issues with 5.19 onwards") [2], patches the 'setup.py install' arguments for the 'install-python_ext' Make target similar to what the setuptools3_legacy.bbclass provides as ${SETUPTOOLS_INSTALL_ARGS}. However, this only applies to the linux-yocto kernel patched with linux-yocto commit 3fd60d4d ("perf: change --root to --prefix for python install") [3] that was introduced in 2012 and never went upstream in any way. For a recent mainline kernel instead, we will run into host path contamination QA warnings like: | WARNING: perf-1.0-r0 do_package_qa: QA Issue: File /usr/lib/python3.11/site-packages/perf-0.1-py3.11-linux-x86_64.egg/EGG-INFO/SOURCES.txt in package perf-python contains reference to TMPDIR | File /usr/lib/python3.11/site-packages/perf-0.1-py3.11-linux-x86_64.egg/__pycache__/perf.cpython-311.pyc in package perf-python contains reference to TMPDIR [buildpaths] To fix this, this commit introduces a replacement for Makefile.perf that results in the exact same setup.py install args as for the linux-yocto kernel. In oe-core commit c849ed0c ("perf: fix the install-python_ext on upstream kernel") [4], the sed that was originally meant for 'Makefile' only, was extended to 'Makefile*' (and thus including) Makefile.perf to fix similar issues. Since this would the affect the just-introduced Makefile.perf-specific sed, the scope of this extra sed was limited back to 'Makefile' only. The line could also be entirely removed maybe, since it seems to be for very old kernels only. In general, I would tend to argue that the above-mentioned linux-yocto patch for should be dropped if it requires additional sed-based patching anyway. [1] https://git.openembedded.org/openembedded-core/commit/?id=43f965061f8af4c4537e9d9c0257253e613a616d [2] https://git.openembedded.org/openembedded-core/commit/?id=138673f833a72c636a7fa185089f25dda350dc54 [3] https://git.yoctoproject.org/linux-yocto/commit/?id=3fd60d4d6f0095b03ff9b7b1499a049c580e7302 [4] https://git.openembedded.org/openembedded-core/commit/?id=c849ed0c66a2fb7d91795c421eb4c87b47d03c0d Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-04-04perf: Fix QA error due to most recent kernelRyan Eatmon
A change in the latest kernel (next), triggers a QA error due to a missing RDEPENDS on perl for perf-tests. ERROR: QA Issue: /usr/libexec/perf-core/tests/shell/common/check_no_patterns_found.pl contained in package perf-tests requires /usr/bin/perl, but no providers found in RDEPENDS:perf-tests? [file-rdeps] Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-02-13meta/recipes: python 3.12 regexAdrian Freihofer
Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18classes/recipes: Switch to use inherit_deferRichard Purdie
Now that bitbake supports the use of inherit_defer, switch all conditional (variable based) inherits to use this instead. This leads to more a more deterministic user experience since there is no longer an immediate expansion and later changes to the variables in question (e.g. a bbappend) are accounted for. This patch tries to ensure the behaviour before/after remains as unchanged as it reasonably can, e.g. by always inherting populate_sdk_base. native and nativesdk continue to need to be inherited last, hence being used with inherit_defer in a handful of very specific cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20perf: drop PE, PR from /usr/src/debug pathsMartin Jansa
Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-09perf: fix build with latest kernelMax Krummenacher
Kernel 6.7-rc1 commit 02e85f74668e ("tools: arm64: Add a Makefile for generating sysreg-defs.h") uses files from arch/arm64/tools/, gen-sysreg.awk and sysreg. Without the files the build of perf fails independent of the used architecture (confirmed with armv7 and qemux86_64). As arch/arm64/tools/ has been added with 5.13 allow perf to build even it that directory does not exist. Add arch/arm64/tools/ to PERF_SRC. Fixes: | make[3]: *** No rule to make target '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/arch/arm64/tools/gen-sysreg.awk', needed by '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/tools/arch/arm64/include/generated/asm/sysreg-defs.h'. Stop. | make[2]: *** [Makefile.perf:456: arm64-sysreg-defs] Error 2 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-09perf: add jevents PACKAGECONFIG itemRasmus Villemoes
Building for an arm64 target, e.g. qemuarm64 or a raspberrypi3, without "python" in PACKAGECONFIG, results in | Makefile.config:892: *** ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.. Stop. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-25perf: lift TARGET_CC_ARCH modification out of security_flags.incRasmus Villemoes
Building perf without security_flags.inc being included in one's distro results in the buildpaths warning WARNING: perf-1.0-r9 do_package_qa: QA Issue: File /usr/bin/trace in package perf contains reference to TMPDIR because the ${DEBUG_PREFIX_MAP} does not get used. Most recipes get that from CFLAGS, but the perf recipe explicitly unsets that. Now ${SELECTED_OPTIMIZATION} of course contains more than just ${DEBUG_FLAGS}/${DEBUG_PREFIX_MAP}. For most TUs, perf's build system adds its own optimization flags (-O6 for odd reasons), so for those including the -O2 or -Og doesn't change anything. But looking at the .o.cmd files show that there are some TUs which currently get built without any -O flag. So for those adding the distro's SELECTED_OPTIMIZATION seem to be the right thing to do. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-22recipes: Drop remaining PR values from recipesRichard Purdie
We've been removing PR values from recipes at upgrade time for a while. In general anyone maintaining a binary distro would end up having to curate these themselves so the values in OE-Core aren't really that useful anymore. In many ways it makes sense to clear out the remaining ones (which are mostly for 'config' recipes that are unlikely to increase in PV) and leave a clean slate for anyone implementing a binary distro config. References are left in meta-selftest since the tests there do involve them and their removal upon upgrade. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24perf: disable perl supportRoss Burton
The perf support was broken and if enabled results in non-reproducible binaries, so disable it for now. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24perf: split scripting PACKAGECONFIG into perl and pythonRoss Burton
There's no reason for Python and Perl support to be tied together, so split the PACKAGECONFIG into two. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24perf: fix perl binding supportRoss Burton
The build of the perl integration has been broken for some time. Update the PERL_* variables so that it can find libperl in the new location. This then fails because the Perl headers cause warnings and the feature checks run with -Werror, so disable the errors. The perf-dbg package then has target build paths, so set INSANE_SKIP for now until this is resolved. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24perf: add more PACKAGECONFIGsRoss Burton
libpfm4 and babeltrace are enabled if they're found, so add PACKAGECONFIGs so that our configuration is explicit. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24perf: enable verbose feature detectionRoss Burton
Having verbose feature detection is helpful to see exactly what has been enabled or disabled. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-10perf: fix buildpaths QA warning in 6.4+Bruce Ashfield
kernel version 6.4 introduces a new file that need to have absolute paths removed, so we can avoid the buildpaths QA warning and have relocatable packages. We add pmu-flex.h to the processing, and the issue is resolved. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-31perf: Make built-in libtraceevent plugins cohabit with external libtraceeventKhem Raj
This will package the plugins built by perf into kernel specific dir under libdir, so it does not conflict with plugins from newly added libtraceevent recipe Fixes do_sdk_depends: The file /usr/lib/traceevent/plugins/plugin_cfg80211.so is installed by both perf and libtraceevent, aborting Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-22perf: add libtraceevent packageconfigMax Krummenacher
With kernel 6.4-rc1 commit 6898e60f709b ("perf build: If libtraceevent isn't present error the build") having libtraceevent is a required dependency unless building it with 'NO_LIBTRACEEVENT=1'. Older kernels did build libtraceevent as provided by the kernel sources. (Unless LIBTRACEEVENT_DYNAMIC=1 was defined, then it tried to pickup an external provided libtraceevent and printed a warning if not found.) Add a libtraceevent packageconfig which adds the dependency on libtraceevent if set, otherwise builds with NO_LIBTRACEEVENT=1. For older kernels the old behaviour of building libtraceevent from the kernel sources isn't changed. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-05-22perf: make pkg-config availableMax Krummenacher
Fixup the to be called pkg-config as $(CROSS_COMPILE)pkg-config doesn't exist. With kernels < 6.4 pkg-config is only used for the gtk+-2.0 integration which is disabled in the OE config. Thus the issue wasn't exposed so far. With kernel 6.4 pkg-config is additionally used for libtraceevent and libtracefs. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-03-11perf: fix buildpaths QA warningBruce Ashfield
In the 6.2+ kernel, arm64 perf has a buildpaths QA warning as a syscall table is now being dynamically generated. That generated table includes unistd.h by absolute path, which in turn triggers the buildpaths QA warning. This could easily be patched in linux-yocto, but that would leave the QA issue in perf built from other kernel trees. So we instead to the following: - Add the perf tools directory to the include path - Modify the Makefile to have a relative path to unistd.h and pass both the relative and absolute path to the generation script - Modify the generation script to take the relative location of unistd.h as a new parameter, and use that in the generated sycalls.c file At build, the added include path of the perf source allows the relative path file to be included, and no buildpaths warning is generated. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-02-04perf: Enable debug/source packagingRichard Purdie
This was disabled in 2014[1] due to an error message which as far as I can tell, no longer occurs. Having debug information and source files present will make debugging reproducibility issues much easier so remove this line as it appears no longer needed. Fix up a few files which have buildpaths in them to avoid QA warnings and reproducubility issues. [1] OE-Core revision c1b5a262c0201faf2c6bf545d6acb32dfe383ba3 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-03perf: Fix 6.1 kernel reproducibility issueRichard Purdie
The pmu-events.c file is generated by a python script making os.scandir() calls. The return value is "order on disk" which can cary between machines. Add in a sed to fix the perf source to sort this data which makes the pmu-events.c file deterministic. We should try and upstream this change but we'll need to sed for varying kernel versions. We should also try and get the perf source being added to the perf-devsrc package so when failures like this occur, diffoscope is much more helpful! Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-25perf: Depend on native setuptools3Khem Raj
perf has need for python setuptools when scripting is enabled from 6.0.0 onwards it seems to throw an explicit error Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-21perf: Fix for recent kernel upgradesRichard Purdie
With recent kernel changes in stable, the full path to python was being encoded into binaries and python install files. Add some workarounds for both issues to fix build reproducibility issues. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-16perf: Add packageconfig for libbfd support and use disabled as defaultKhem Raj
Disable it by default, libbfd changes with binutils major releases and sometimes it creates a dependency to fix it. See [1] This will help building with binutils 2.39 [1] https://lore.kernel.org/lkml/20210910225756.729087-1-irogers@google.com/T/ Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12perf: Fix reproducibility issues with 5.19 onwardsRichard Purdie
In 5.19 onwards the build process changed and encoded full build paths into the output. Adapt the code to look more like our setuptools class calls. This seems to work ok with older kernels too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-23perf: fix reproduciblity in older releases of LinuxRoss Burton
If you build perf from Linux 5.4 it still contains buildpaths (pointing to the sysroot's Python) as the existing fixes don't apply to the lines in that old release. Add further expressions to remove the final buildpaths. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-04perf: fix reproducibility in 5.19+Bruce Ashfield
kernels with upstream commit 630af16eee495f583db5202c3613d1b191f10694 [perf tools: Use Python devtools for version autodetection rather than runtime], or -stable backports of that commmit, evade our substitutions for reproducibility. We add a second sed expression to ensure that our definition of python is used, as we have the proper environement setup and don't need the full path of python, which eventually will be captured by the perf binaries. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22perf: sort-pmuevents: really keep array terminatorsLucas Stach
Commit e1382583cd50 ("perf: sort-pmuevents: don't drop elements") tried to fix a case where the array terminator elements were dropped from the sorted list breaking the build, but it only worked for the case where the terminator is the only element of the array. When the array has other elements the terminator will still be silently dropped, causing invalid memory accesses at runtime when the perf utility iterates over the array. Fix this by treating any unmatched entry as an array terminator and also add a comment to make it a little more clear how things are ending up at the right position in the sorted list. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX ↵Richard Purdie
license identifiers An automated conversion using scripts/contrib/convert-spdx-licenses.py to convert to use the standard SPDX license identifiers. Two recipes in meta-selftest were not converted as they're that way specifically for testing. A change in linux-firmware was also skipped and may need a more manual tweak. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-12perf: Tweak for mips n64Richard Purdie
With the changes to binutils, perf's direct calls to ld break for mips n64. We already have tweaks for n32 so match those with the ones for n64. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-06perf: Enable libunwind packageconfig on riscv64Khem Raj
libunwind now supports risc64 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-26perf: sort-pmuevents: allow for additional type qualifiers and storage classMax Krummenacher
With kernel 5.16 some structs in pmu-events do get a const qualifier, some a static const storage class and qualifier. The current sort-pmuevents cannot cope with that and drops all struct arrays with such additional elements. This then leads to compiler errors. Allow '^struct', '^const struct', '^static struct', '^static const struct'. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-11-26perf: sort-pmuevents: don't drop elementsMax Krummenacher
If a struct element neither has an element cpuid or name it gets silenty dropped. Kernel 5.15 for some ARCHs have at least one array of structs matching this. e.g. for arm pmu-events.c: |#include "pmu-events/pmu-events.h" struct pmu_events_map pmu_events_map[] = { { .cpuid = 0, .version = 0, .type = 0, .table = 0, }, }; struct pmu_sys_events pmu_sys_event_tables[] = { { .table = 0 }, }; Before this patch the second struct is translated to an empty array:: struct pmu_sys_events pmu_sys_event_tables[] = { }; Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-08-04meta: convert nested overrides leftovers to new syntaxDenys Dmytriyenko
Those were missed in previous rounds of automated and manual conversion. Signed-off-by: Denys Dmytriyenko <denis@denix.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-17perf: Use python3targetconfig to ensure we use target librariesRichard Purdie
We've seen some reproducibility issues on the autobuilder in perf where the size of the python module varies slightly between systems. After some head scratching and removing the --quiet option to the python module build, you can see it using -Lrecipe-sysroot-native in the linking commandline for the module. This means it is linking against the native library on systems where that works, skipping it and using the target one otherwise, probably with warnings in logs we've not seen. The fix is to inherit the python3targetconfig class which ensures that the target sysroot is used, then the byte differences between the builds go away and things are sane(r) again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-04perf: fix python-audit RDEPENDSBruce Ashfield
When doing the perf python3 conversion, the audit-python RDEPENDS was caught up in the regex replacement and was incorrectly changed. The audit recipe continues to produce a package called audit-python and it is that package we should have as a RDEPENDS. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-06perf-tests: add bash into RDEPENDS (v5.12-rc5+)Bruce Ashfield
Upstream commit: commit 1dc481c0b0cf18d3952d93a73c4ece90dec277f0 Author: Leo Yan <leo.yan@linaro.org> Date: Sat Mar 20 18:45:54 2021 +0800 perf test: Change to use bash for daemon test When executing the daemon test on Arm64 and x86 with Debian (Buster) distro, both skip the test case with the log: Changes tools/perf/tests/shell/daemon.sh to be explicitly bash (it was already required, but was just skipped on various distros). We add it into our RDEPENDS for perf-tests to fixup 5.12+ builds. We already have relatively heavy RDEPENDS for perf tests (python3), so adding bash into the RDEPENDS isn't signifcant even for older perf builds that use the same recipe. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-14perf: Remove libunwind for rv32Khem Raj
libunwind is not yet ported to RISCV32 Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11perf: reproducibility fixes for pmu-events.cBruce Ashfield
perf generates pmu-events.c as part of the build process. The code that generates the events is doing tree walks and potentially other non-determinstic things. We'd rather not mess with that implementation, so we add a script that knows how to read the pmu-events.c, sort the entries and then copy it over the generated one. With this, we should always have events in the same order, improving reproducibility. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-10perf: fix reproducibility issuesBruce Ashfield
perf has been failing our reproducible testing due to multiple symbols containg build paths. With this commit, we fix the issues: 1) The following line in the Makefle: override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON_AUTO)) "PYTHON" / "PYTHON_AUTO" have the full path as part of the variable. We've ensure that the environment is setup and we do not need the full path to be captured, since the symbol gets built into the executable, making it not reproducible. 2) The following line: srcdir_SQ = $(patsubst %tools/perf,tools/perf,$(subst ','\'',$(srcdir))), Captures the full src path of perf, which of course makes it not reproducible. We really only need the relative location 'tools/perf', so we change the Makefile line to remove everything before 'tools/perf' 3) OUTPUT is the full path, we have python on the path so we remove it from the definition. This is captured in the perf binary, so breaks reproducibility PYTHONPATH="BUILD_STR(python) 4) To avoid bison generating #ifdefs that have captured paths, we make sure all the calls have YFLAGS, which contains prefix mapping information. Upstream-status: OE specific to our cross/build environments. Variants will be developed for upstream Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-20perf: backport a fix for confusing non-fatal errorMartin Jansa
* add V=1 to make log.do_compile a bit more useful, with this it shows: /bin/sh '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools/perf/trace/beauty/arch_errno_names.sh' x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/recipe-sysroot /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/tools > /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/perf/1.0-r9/perf-1.0/trace/beauty/generated/arch_errno_name_array.c find: unknown predicate `-m64/arch' x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h' x86_64-oe-linux-gcc: fatal error: no input files compilation terminated. x86_64-oe-linux-gcc: error: unrecognized command-line option '-m64/include/uapi/asm-generic/errno.h' x86_64-oe-linux-gcc: fatal error: no input files compilation terminated. * apply https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8 with sed call to fix this Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-18perf: add PACKAGECONFIG for CoreSight supportRoss Burton
meta-arm has a recipe for OpenCSD, the CoreSight Trace Decoder library, so add a PACKAGECONFIG so that users can enable the use of CoreSight in perf builds. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-02perf: fix compile error when rebuildingChangqing Li
Fix error like: Makefile.perf:597: recipe for target 'intel_x86_64-wrs-linux/perf/1.0-r9/perf-1.0/perf-in.o] Error 2 Makefile.perf:220: recipe for target 'sub-make' failed make[1]: *** [sub-make] Error 2 Makefile:69: recipe for target 'all' failed make: *** [all] Error 2 during rebuilding, when kernel version changed, some source files also maybe changed. It could happened that the source under ${S} messed up with some already dropped files and also new files. Fix by clean the ${S} before copy source files. Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-10perf: Fix externalsrc supportPaul Barker
When the externalsrc class is used the tasks listed in SRCTREECOVEREDTASKS are deleted to prevent them being executed. If externalsrc is used for the kernel then this will include virtual/kernel:do_patch. We can depend on do_shared_workdir instead as this will survive when externalsrc is used. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-22perf: Correct the substitution of python shebangsHe Zhe
To make the native python3 always used, - Use sed one-liner instead - Add substitution for ${S}/scripts/bpf_helpers_doc.py to fix the following warning. File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) ModuleNotFoundError: No module named '_sysconfigdata' This issue is first reported by Joel Stanley <joel@jms.id.au> The sed one-liner is credited to Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-27perf: Pass LDSHARED and CCLD via EXTRA_OEMAKEKhem Raj
python code underneath is smart and pokes at python installation in sysroot for compile environment, the overrides from EXTRA_OEMAKE are ofcourse preferred but it falls back to python3's distutils/sysconfig for rest of them, and it does use CCLD and LDSHARED for linking, when we use clang to compile python3 then it encodes these variables to be clang however, when building perf we inherit kernel which forces gcc to be used for compiling perf, which then mixes both compilers due to CCLD and LDSHARED demands. Therefore override CCLD and LDSHARED in make environment helps python/distutils to use right linker Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-16perf: fix build for v5.5+Bruce Ashfield
In kernel 5.5+ there are python3 scripts that explicitly use /usr/bin/python3 as the interpreter. That will find the host python and produce undefined results. We add that interpreter path to our substitutions to ensure that our sysroot variant is used. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>