summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/perf
Commit message (Collapse)AuthorAgeFilesLines
* perf: add libtraceevent packageconfigMax Krummenacher2023-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 7e7a7394b47f6fd4a4dd26a18a5d94302ab6df1e) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: make pkg-config availableMax Krummenacher2023-05-221-0/+2
| | | | | | | | | | | | | | | 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. (From OE-Core rev: f7e743428792fde93d5ca1c97244fc2b967fe666) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix buildpaths QA warningBruce Ashfield2023-03-111-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: c8845ab59cd7c28874473618f134a5d45906d6ea) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Enable debug/source packagingRichard Purdie2023-02-041-2/+12
| | | | | | | | | | | | | | | | | | 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 (From OE-Core rev: 95983108121c8b96f5659d110498bf2afc6189d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Fix 6.1 kernel reproducibility issueRichard Purdie2023-02-031-0/+4
| | | | | | | | | | | | | | | | | 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! (From OE-Core rev: d2c27ae5c0d06363d2f0a2a8eb4e8e492df58444) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Depend on native setuptools3Khem Raj2022-10-251-1/+1
| | | | | | | | | | | | perf has need for python setuptools when scripting is enabled from 6.0.0 onwards it seems to throw an explicit error (From OE-Core rev: da3d00178809bbf7cc453401e0c5937796ebc2c1) 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>
* perf: Fix for recent kernel upgradesRichard Purdie2022-09-211-0/+6
| | | | | | | | | | 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. (From OE-Core rev: cf33e2ab2693eafaf0e5fc45666355d60e084281) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Add packageconfig for libbfd support and use disabled as defaultKhem Raj2022-08-161-0/+1
| | | | | | | | | | | | | | | 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/ (From OE-Core rev: 119b37cd59163970476644183ed509a2d2ea6acd) 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>
* perf: Fix reproducibility issues with 5.19 onwardsRichard Purdie2022-08-121-1/+1
| | | | | | | | | | 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. (From OE-Core rev: 138673f833a72c636a7fa185089f25dda350dc54) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix reproduciblity in older releases of LinuxRoss Burton2022-07-231-0/+3
| | | | | | | | | | | | | | 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. (From OE-Core rev: 6783c1e295e5afafd73a02fd986ca8956a89dda7) 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>
* perf: fix reproducibility in 5.19+Bruce Ashfield2022-07-041-0/+6
| | | | | | | | | | | | | | | | | 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. (From OE-Core rev: b24e73fb34049061ea03a6f2b6a54cdbee7b406b) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: sort-pmuevents: really keep array terminatorsLucas Stach2022-06-221-1/+4
| | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 69c35a48c5100b884f1b633142b07222b9390e92) 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>
* meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX ↵Richard Purdie2022-02-201-1/+1
| | | | | | | | | | | | | 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. (From OE-Core rev: ceda3238cdbf1beb216ae9ddb242470d5dfc25e0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Tweak for mips n64Richard Purdie2021-12-121-1/+3
| | | | | | | | | 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. (From OE-Core rev: 33828620872b80e1c745612e025215666ba755c8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Enable libunwind packageconfig on riscv64Khem Raj2021-12-061-1/+0
| | | | | | | | | libunwind now supports risc64 (From OE-Core rev: 41ab1040b61a86157dd1995e36deb3df65d9c0c5) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: sort-pmuevents: allow for additional type qualifiers and storage classMax Krummenacher2021-11-261-14/+16
| | | | | | | | | | | | | | | | 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'. (From OE-Core rev: 8406e83ade1c34d8a7d8063f2e7445aafa471721) 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>
* perf: sort-pmuevents: don't drop elementsMax Krummenacher2021-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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[] = { }; (From OE-Core rev: e1382583cd5060be301afaa9998ccf250cc8bca3) 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>
* meta: convert nested overrides leftovers to new syntaxDenys Dmytriyenko2021-08-041-1/+1
| | | | | | | | | Those were missed in previous rounds of automated and manual conversion. (From OE-Core rev: 22f9c7268b542baf6cd8aa0e34c8fb7aa1579e08) Signed-off-by: Denys Dmytriyenko <denis@denix.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Convert to new override syntaxRichard Purdie2021-08-021-20/+20
| | | | | | | | | | | | 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 "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Use python3targetconfig to ensure we use target librariesRichard Purdie2021-06-171-1/+1
| | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 8e2b6c042edd9ec76cb8281247604e4f81518780) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix python-audit RDEPENDSBruce Ashfield2021-05-041-1/+1
| | | | | | | | | | | | | 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. (From OE-Core rev: 7eccb9c0c2ea00685451c44cb8faa96c4a2272fd) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf-tests: add bash into RDEPENDS (v5.12-rc5+)Bruce Ashfield2021-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 159cdb159ad0e9d3ed73cfc07f9acd5c0b608e7b) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Remove libunwind for rv32Khem Raj2021-03-141-0/+1
| | | | | | | | | | libunwind is not yet ported to RISCV32 (From OE-Core rev: 2cce2a296b4659a6c7e7f069e11f6f35957608d2) 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>
* perf: reproducibility fixes for pmu-events.cBruce Ashfield2021-03-122-0/+109
| | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 5281b2a6e16b6d24b66172b8269478356c0ce6c9) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix reproducibility issuesBruce Ashfield2021-03-101-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (From OE-Core rev: dea57aa1cd879df4feae1b9595b38c5b6ff74574) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: backport a fix for confusing non-fatal errorMartin Jansa2020-08-201-0/+4
| | | | | | | | | | | | | | | | | | | | * 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 (From OE-Core rev: c603e6e13e44ae907cf1f04abf6e1babf3d7be26) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: add PACKAGECONFIG for CoreSight supportRoss Burton2020-07-181-0/+2
| | | | | | | | | | | 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. (From OE-Core rev: 2e9c2f054730069554c9102333aa779c214d8b90) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix compile error when rebuildingChangqing Li2020-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 57b4745cca8d486c1f20b8f01f4a25cb59c4b968) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Fix externalsrc supportPaul Barker2020-03-101-1/+1
| | | | | | | | | | | | | | | 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. (From OE-Core rev: eab605bab94552046ec4adae5debe026cc03bb4c) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Correct the substitution of python shebangsHe Zhe2020-02-221-5/+2
| | | | | | | | | | | | | | | | | | | | 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> (From OE-Core rev: 3f93173130a94310255389cfc62c67102a4fb21b) Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Pass LDSHARED and CCLD via EXTRA_OEMAKEKhem Raj2020-01-271-0/+2
| | | | | | | | | | | | | | | | | 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 (From OE-Core rev: f9259da409c2aa92deb71aef0da2405c8d836615) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix build for v5.5+Bruce Ashfield2020-01-161-0/+1
| | | | | | | | | | | | | | 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. (From OE-Core rev: 103316d50d4947b3c3500eb5cbc4845702a62d22) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: drop 'include' copyBruce Ashfield2019-11-041-9/+0
| | | | | | | | | | | | | | | | | The copy of the kernel's top level include directory is not required to build perf. We have both the linux-libc-headers and perf's captured/copied headers for what it requires. The copy of the kernel's headers is leading us to multiple smaller fixes to ensure that the various .h files are in sync. We can remove the copy and all of the sync checks, and perf still builds and executes correctly. (From OE-Core rev: 79bfd5515887e5faf315a581d98bda63899760da) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: add 'cap' PACKAGECONFIGBruce Ashfield2019-11-041-0/+1
| | | | | | | | | | | perf can use libcap when available, so we add a packageconfig for those that want the support. (From OE-Core rev: 9a35c61d2218e139aa4420ef25f8cf4a0c4c2cfc) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: create directories before copying single filesBruce Ashfield2019-11-041-0/+2
| | | | | | | | | | | | If we need to copy a single file from the linux source tree into the perf source tree, we need to ensure that the directory structure it requires has been created first. (From OE-Core rev: 7c33f0b1ee35031aa97e5e5231f53d8502b583c9) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix v5.4+ buildsBruce Ashfield2019-11-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | When building perf for 5.4+, we have some new files that need to be copied (and synchronized) due to structural changes in the kernel source tree. Some of the issues these fixes are warnings, but none the less, they are worth fixing. - We copy arch/${ARCH}/Makefile, since it is source by some perf Makefiles - We copy scripts/, since the perf utilities are looking for files in that directory stucture. - We have *three* copies of ctypes.h in the tools/* hierarchy during the build. If the tools/perf/util/include/linux/ variant is used, it will trigger build errors since it is not complete. We copy the kernel's main include/linux/ctype.h to ensure they are in sync. (From OE-Core rev: 6a000d734c2fe57b4a601fe7e7373096345b02b4) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix build on kernels which don't have ${S}/tools/include/linux/bits.hMartin Jansa2019-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/include/linux/bits.h was added in v4.20-rc1 with this commit: commit ba4aa02b417f08a0bee5e7b8ed70cac788a7c854 Author: Arnaldo Carvalho de Melo <acme@redhat.com> Date: Tue Sep 25 10:55:59 2018 -0300 tools include: Adopt linux/bits.h * also if you're building for such older kernel you will probably see do_compile failing with: | config/Makefile:448: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev | config/Makefile:495: Python 3 is not yet supported; please set | config/Makefile:496: PYTHON and/or PYTHON_CONFIG appropriately. easiest work around is to disable scripting PACKAGECONFIG, because since oe-core commit: commit 584af667e0000129bcb5c9e8108485f2f6590eaf Author: Bruce Ashfield <bruce.ashfield@gmail.com> Date: Wed Aug 28 22:14:41 2019 -0400 perf: change dependencies on python to python3 The upstream kernel can now handle python3 for the perf scripts, coupled with the impending EOL of python2, we switch the dependencies in perf (scripting) to python3. it now uses python3, but the support for that was added in kernel v4.17-rc1 with: commit 66dfdff03d196e51322c6a85c0d8db8bb2bdd655 Author: Jaroslav Skarvada <jskarvad@redhat.com> Date: Fri Jan 19 21:56:41 2018 +0100 perf tools: Add Python 3 support Added Python 3 support while keeping Python 2.7 compatibility. if you really need scripting support than either backport the kernel patch to your kernel or undo the perf recipe changes. (From OE-Core rev: d6ee3d3bdf183a9060b5b0c25b97688a4b9d40dc) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: v5.3+ build fixesBruce Ashfield2019-08-301-0/+4
| | | | | | | | | | | | | | | | In the 5.3+ perf builds, there are multiple unistd.h files that need to be kept in sync. So not only do we update one, we update both to ensure that libc-headers and the perf build are in sync. perf checks some key files itself to be sure they are in sync, and bits.h can be out of sync. There's no build error that results with bits.h at the moment, but we still make sure they are in sync to avoid the configure/compile warning. (From OE-Core rev: b850ee597e7116cc2a7546853f2b976c891196ef) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: change dependencies on python to python3Bruce Ashfield2019-08-301-8/+11
| | | | | | | | | | | | | | | | | | | | The upstream kernel can now handle python3 for the perf scripts, coupled with the impending EOL of python2, we switch the dependencies in perf (scripting) to python3. Outside of dependency changes, we also pass the following two variables to the perf build: PYTHON=python3 PYTHON_CONFIG=python3-config. To ensure that our python3 components are used. For configurations that disable perf scripting, there is no change in behaviour. [YOCTO #13358] (From OE-Core rev: 584af667e0000129bcb5c9e8108485f2f6590eaf) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: make sure that the tools/include/uapi/asm-generic directory existsMartin Jansa2019-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | * before trying to copy unistd.h into it * older kernels don't have uapi in tools/include and do_configure fails with: DEBUG: Executing shell function do_configure cp: cannot create regular file '.../perf/1.0-r9/perf-1.0/tools/include/uapi/asm-generic/unistd.h': No such file or directory WARNING: exit code 1 from a shell command. * tools/include/uapi was added in kernel 4.8 with https://github.com/torvalds/linux/commit/c4b6014e8bb0c8d47fe5c71ebc604f31091e5d3f tools: Add copy of perf_event.h to tools/include/linux/ (From OE-Core rev: 5fdb96f4996856286c4f72b93d31b7990ceed8aa) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: workaround the error cased by maybe-uninitialized warningDengke Du2019-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When enable DEBUG_BUILD, the perf build failed by the following error: libbpf.c:727:36: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized] This is ok until Khem commit a patch in oe-core: 16643b03227466e2c80a24c2d079fe36e89553c1 This commit import "-Og" option to "DEBUG_OPTIMIZATION", result in this error. Actually, the warning was misinformation. We explore the code in libbpf.c: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf/libbpf.c#n640 -------------------------------------------------------------------------- if (scn) data = elf_getdata(scn, NULL); if (!scn || !data) { pr_warning("failed to get Elf_Data from map section %d\n", obj->efile.maps_shndx); return -EINVAL; } ...... using data... ...... -------------------------------------------------------------------------- If the 'scn' was not null, the data will be initialized. if the data was null, the function will return -EINVAL, so the data must be not null, but compiler can't see it in 'if' code block, so treat it as 'maybe-uninitialized'. (From OE-Core rev: 0eb4048bc5865579327f5a88086e3e3241b012cb) Signed-off-by: Dengke Du <dengke.du@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: synchronize unistd.h between libc-headers and perf sourceBruce Ashfield2019-03-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the build for some architectures, perf generates a program which executes on the host to dump the syscall table. The generation of that program uses the cross compiler + sysroot to expand unistd.h. As such, we are getting the contents of that file from linux-libc-headers. The compilation of that generated program uses the host compiler and a restricted include path to the perf source code. In the perf source there is a captured unistd.h, as such it will be used when compiling the host executable. The perf source code is copied from the kernel version that is being built .. so we have a mismatch between the generation and the compilation of the host program. Normally this mismatch is fine, but if the libc-headers are newer than the kernel, we'll have syscalls (and their syscall numbers) that are not defined in the perf source code. This leads to a compiler error and a cascading failure of the perf build due to a missing generated file. To fix this, we can copy unistd.h from the recipe-sysroot into the perf source code and they will always be in sync. (From OE-Core rev: 3a23e094c4189af878e467f1636aea63955e250d) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Set libunwind dir explicitly to point into staging sysrootKhem Raj2019-03-021-0/+1
| | | | | | | | | | This helps it find the unwind library in sysroot always and not look around and confuse with host (From OE-Core rev: e914c03964c540493523b18660f8a4eaeec78e3d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Package libperf-jvmti.so as part of ${PN}Alex Kiernan2019-02-161-1/+2
| | | | | | | | | | | | | | perf's jvmti support builds libperf-jvmti.so that needs to be packaged as part of the main package, not a developer package. Given there's no files in the developer package, override FILES_SOLIBSDEV so it's not gobbled by FILES_${PN}-dev, and then add just that file to FILES_${PN} so that if in the future there other files which would be added to the dev package we'll fail then. (From OE-Core rev: 284763fcf188a497f15a1c69a50ceeee99d546f8) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: Disable libunwind for ARC & RISCV64Alexey Brodkin2018-11-071-0/+4
| | | | | | | | | | | | | | | | libunwind is not yet ported for ARC & RISCV64 and on attempt to build it for those arches we just get an error message. If we explicitly disable libunwind it is gracefully handled by perf build system and it just gets configured to not use it so perf is still usable even on those arches. (From OE-Core rev: bb06900a1f29fdd4066f6d7e7a961d230c2e9438) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fix do_compile failure with /tmp mounted with noexecHongxu Jia2018-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | On a builder which has /tmp mounted nexec, the ARM64 generation of the sycall table will fail: [snip] |perf-1.0/tools/perf/arch/arm64/entry/syscalls//mksyscalltbl: /tmp/create-table-6VGPSt: Permission denied [snip] To avoid the permission denied error, we must instruct the perf build to place temporary files in an appropriate directory (versus always using /tmp). To do this, we need both a kernel source change to perf, and a recipe change to pass the temp directory in by a TMPDIR variable. The linux-yocto has a reference kernel change: [perf arm64: Fix generate system call table failed with /tmp mounted with noexec], that has also been submitted upstream mailing list linux-perf-users@vger.kernel.org (From OE-Core rev: d819e7fa76e2b732aa7c33ab0e9a834781090824) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Reviewed-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: make tools needed for API documentation respect the manpages PACKAGECONFIGRoss Burton2018-10-101-3/+1
| | | | | | | (From OE-Core rev: 15d42f84b1fcffc17b21eba50e5d5ee06419a659) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: do not pull in any perl dependencies unless scripting is requestedDima Zavin2018-09-132-7/+8
| | | | | | | | (From OE-Core rev: 79a19811f4039c5d1861094abbbdaea0aedeee04) Signed-off-by: Dima Zavin <dmitriyz@waymo.com> Signed-off-by: Andrew Bresticker <abrestic@waymo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: fail if src path does not existMikko Rapeli2018-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | A missing src directory from a broken kernel recipe resulted only in a warning: WARNING: copyfile: stat of /home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch failed ([Errno 2] No such file or directory: '/home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch') and the build failed horribly. With this change it's an error which can not be missed: ERROR: perf-1.0-r9 do_configure: Path does not exist: /home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch. Maybe PERF_SRC does not match the kernel version. ERROR: perf-1.0-r9 do_configure: Function failed: copy_perf_source_from_kernel ERROR: Logfile of failure stored in: /home/builder/src/tmp-glibc/work/target-linux/perf/1.0-r9/temp/log.do_configure.21083 NOTE: recipe perf-1.0-r9: task do_configure: Failed ERROR: Task (/home/builder/src/poky/meta/recipes-kernel/perf/perf.bb:do_configure) failed with exit code '1' To get get perf compiling from a custom kernel, a perf.bbappend can be created which defines PERF_SRC as list of files and directories needed from kernel source tree to compile perf. This varies between kernel versions. (From OE-Core rev: c392dabefc431dbfb31d6a1465c75ba9cc765804) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* perf: inherit manpages instead of adding man to RDEPENDS_${PN}-docMartin Jansa2018-08-141-2/+1
| | | | | | | (From OE-Core rev: 92c79abfdedb4b9f16191e253cf2dcec9e2f0cfb) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>