diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/poky/meta/recipes-kernel/perf | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/poky/meta/recipes-kernel/perf')
-rw-r--r-- | external/poky/meta/recipes-kernel/perf/perf.bb | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/external/poky/meta/recipes-kernel/perf/perf.bb b/external/poky/meta/recipes-kernel/perf/perf.bb index bae49487..c4b7b77e 100644 --- a/external/poky/meta/recipes-kernel/perf/perf.bb +++ b/external/poky/meta/recipes-kernel/perf/perf.bb @@ -13,7 +13,7 @@ PR = "r9" PACKAGECONFIG ??= "scripting tui libunwind" PACKAGECONFIG[dwarf] = ",NO_DWARF=1" -PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python" +PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3" # gui support was added with kernel 3.6.35 # since 3.10 libnewt was replaced by slang # to cover a wide range of kernel we add both dependencies @@ -25,6 +25,7 @@ PACKAGECONFIG[jvmti] = ",NO_JVMTI=1" # libaudit support would need scripting to be enabled PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit" PACKAGECONFIG[manpages] = ",,xmlto-native asciidoc-native" +PACKAGECONFIG[cap] = ",,libcap" # libunwind is not yet ported for some architectures PACKAGECONFIG_remove_arc = "libunwind" @@ -44,14 +45,14 @@ PROVIDES = "virtual/perf" inherit linux-kernel-base kernel-arch manpages # needed for building the tools/perf Python bindings -inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'pythonnative', '', d)} -inherit python-dir +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3native', '', d)} +inherit python3-dir export PYTHON_SITEPACKAGES_DIR #kernel 3.1+ supports WERROR to disable warnings as errors export WERROR = "0" -do_populate_lic[depends] += "virtual/kernel:do_patch" +do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" # needed for building the tools/perf Perl binding include ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perf-perl.inc', '', d)} @@ -72,6 +73,8 @@ EXTRA_OEMAKE = '\ CROSS_COMPILE=${TARGET_PREFIX} \ ARCH=${ARCH} \ CC="${CC}" \ + CCLD="${CC}" \ + LDSHARED="${CC} -shared" \ AR="${AR}" \ LD="${LD}" \ EXTRA_CFLAGS="-ldw" \ @@ -80,6 +83,7 @@ EXTRA_OEMAKE = '\ NO_GTK2=1 \ ${PACKAGECONFIG_CONFARGS} \ TMPDIR="${B}" \ + LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \ ' EXTRA_OEMAKE += "\ @@ -93,6 +97,7 @@ EXTRA_OEMAKE += "\ 'sharedir=${@os.path.relpath(datadir, prefix)}' \ 'mandir=${@os.path.relpath(mandir, prefix)}' \ 'infodir=${@os.path.relpath(infodir, prefix)}' \ + ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \ " # During do_configure, we might run a 'make clean'. That often breaks @@ -103,7 +108,6 @@ EXTRA_OEMAKE += "\ EXTRA_OEMAKE_append_task-configure = " JOBS=1" PERF_SRC ?= "Makefile \ - include \ tools/arch \ tools/build \ tools/include \ @@ -111,6 +115,8 @@ PERF_SRC ?= "Makefile \ tools/Makefile \ tools/perf \ tools/scripts \ + scripts/ \ + arch/${ARCH}/Makefile \ " PERF_EXTRA_LDFLAGS = "" @@ -131,7 +137,7 @@ do_install() { oe_runmake install # we are checking for this make target to be compatible with older perf versions if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then - oe_runmake DESTDIR=${D} install-python_ext + oe_runmake DESTDIR=${D} install-python_ext fi } @@ -141,6 +147,7 @@ python copy_perf_source_from_kernel() { src_dir = d.getVar("STAGING_KERNEL_DIR") dest_dir = d.getVar("S") bb.utils.mkdirhier(dest_dir) + bb.utils.prunedir(dest_dir) for s in sources: src = oe.path.join(src_dir, s) dest = oe.path.join(dest_dir, s) @@ -149,6 +156,8 @@ python copy_perf_source_from_kernel() { if os.path.isdir(src): oe.path.copyhardlinktree(src, dest) else: + src_path = os.path.dirname(s) + os.makedirs(os.path.join(dest_dir,src_path),exist_ok=True) bb.utils.copyfile(src, dest) } @@ -231,9 +240,14 @@ do_configure_prepend () { fi # use /usr/bin/env instead of version specific python - for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do - sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}" + for s in `find ${S}/tools/perf/ -name '*.py'` `find ${S}/scripts/ -name 'bpf_helpers_doc.py'`; do + sed -i -e "s,#!.*python.*,#!${USRBINPATH}/env python3," ${s} done + + # unistd.h can be out of sync between libc-headers and the captured version in the perf source + # so we copy it from the sysroot unistd.h to the perf unistd.h + install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h + install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/include/uapi/asm-generic/unistd.h } python do_package_prepend() { @@ -247,14 +261,15 @@ PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python" RDEPENDS_${PN} += "elfutils bash" RDEPENDS_${PN}-archive =+ "bash" -RDEPENDS_${PN}-python =+ "bash python python-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}" +RDEPENDS_${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python3', '', d)}" RDEPENDS_${PN}-perl =+ "bash perl perl-modules" -RDEPENDS_${PN}-tests =+ "python" +RDEPENDS_${PN}-tests =+ "python3" RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}" RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}" -FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent" +FILES_SOLIBSDEV = "" +FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent ${libdir}/libperf-jvmti.so" FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive" FILES_${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests" FILES_${PN}-python = " \ @@ -265,3 +280,4 @@ FILES_${PN}-perl = "${libexecdir}/perf-core/scripts/perl" INHIBIT_PACKAGE_DEBUG_SPLIT="1" +DEBUG_OPTIMIZATION_append = " -Wno-error=maybe-uninitialized" |