2012-06-20 14:31:40 +00:00
|
|
|
SUMMARY = "Performance analysis tools for Linux"
|
|
|
|
DESCRIPTION = "Performance counters for Linux are a new kernel-based \
|
|
|
|
subsystem that provide a framework for all things \
|
|
|
|
performance analysis. It covers hardware level \
|
|
|
|
(CPU/PMU, Performance Monitoring Unit) features \
|
|
|
|
and software features (software counters, tracepoints) \
|
|
|
|
as well."
|
|
|
|
|
|
|
|
LICENSE = "GPLv2"
|
|
|
|
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
|
|
|
|
|
2014-06-24 21:34:46 +00:00
|
|
|
PR = "r9"
|
2012-06-20 14:31:40 +00:00
|
|
|
|
2013-03-08 00:39:00 +00:00
|
|
|
require perf-features.inc
|
2012-07-09 17:07:09 +00:00
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
BUILDPERF_libc-uclibc = "no"
|
|
|
|
|
2014-06-24 21:34:47 +00:00
|
|
|
# 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
|
|
|
|
TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
|
2012-07-12 07:17:11 +00:00
|
|
|
SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
|
2012-07-09 17:07:11 +00:00
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
DEPENDS = "virtual/kernel \
|
|
|
|
virtual/${MLPREFIX}libc \
|
|
|
|
${MLPREFIX}elfutils \
|
|
|
|
${MLPREFIX}binutils \
|
2012-07-09 17:07:11 +00:00
|
|
|
${TUI_DEPENDS} \
|
2012-07-12 07:17:11 +00:00
|
|
|
${SCRIPTING_DEPENDS} \
|
2012-08-25 22:57:22 +00:00
|
|
|
bison flex \
|
2012-06-20 14:31:40 +00:00
|
|
|
"
|
2012-06-25 04:31:58 +00:00
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
PROVIDES = "virtual/perf"
|
|
|
|
|
2013-03-19 04:58:07 +00:00
|
|
|
inherit linux-kernel-base kernel-arch pythonnative
|
2012-06-20 14:31:40 +00:00
|
|
|
|
2012-06-25 04:26:33 +00:00
|
|
|
# needed for building the tools/perf Python bindings
|
|
|
|
inherit python-dir
|
|
|
|
export STAGING_INCDIR
|
|
|
|
export STAGING_LIBDIR
|
|
|
|
export BUILD_SYS
|
|
|
|
export HOST_SYS
|
|
|
|
|
2013-04-18 14:27:08 +00:00
|
|
|
do_populate_lic[depends] += "virtual/kernel:do_populate_sysroot"
|
|
|
|
|
2012-06-25 04:31:58 +00:00
|
|
|
# needed for building the tools/perf Perl binding
|
|
|
|
inherit perlnative cpan-base
|
|
|
|
# Env var which tells perl if it should use host (no) or target (yes) settings
|
|
|
|
export PERLCONFIGTARGET = "${@is_target(d)}"
|
|
|
|
export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
|
|
|
|
export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
|
|
|
|
export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
|
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
S = "${STAGING_KERNEL_DIR}"
|
2013-09-12 09:28:17 +00:00
|
|
|
# The source should be ready after the do_unpack
|
|
|
|
do_unpack[depends] += "virtual/kernel:do_populate_sysroot"
|
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
B = "${WORKDIR}/${BPN}-${PV}"
|
|
|
|
|
2012-07-09 17:07:10 +00:00
|
|
|
SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
|
2012-07-09 17:07:11 +00:00
|
|
|
TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
|
2012-07-09 17:07:10 +00:00
|
|
|
|
2013-09-18 13:51:04 +00:00
|
|
|
# The LDFLAGS is required or some old kernels fails due missing
|
|
|
|
# symbols and this is preferred than requiring patches to every old
|
|
|
|
# supported kernel.
|
|
|
|
LDFLAGS="-ldl -lutil"
|
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
EXTRA_OEMAKE = \
|
|
|
|
'-C ${S}/tools/perf \
|
|
|
|
O=${B} \
|
|
|
|
CROSS_COMPILE=${TARGET_PREFIX} \
|
|
|
|
ARCH=${ARCH} \
|
|
|
|
CC="${CC}" \
|
|
|
|
AR="${AR}" \
|
2012-10-17 16:47:51 +00:00
|
|
|
perfexecdir=${libexecdir} \
|
2012-07-09 17:07:11 +00:00
|
|
|
NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
|
2012-06-20 14:31:40 +00:00
|
|
|
'
|
|
|
|
|
2012-12-12 11:26:11 +00:00
|
|
|
EXTRA_OEMAKE += "\
|
2012-12-12 11:26:12 +00:00
|
|
|
'prefix=${prefix}' \
|
|
|
|
'bindir=${bindir}' \
|
|
|
|
'sharedir=${datadir}' \
|
|
|
|
'sysconfdir=${sysconfdir}' \
|
|
|
|
'perfexecdir=${libexecdir}/perf-core' \
|
|
|
|
\
|
|
|
|
'ETC_PERFCONFIG=${@oe.path.relative(prefix, sysconfdir)}' \
|
|
|
|
'sharedir=${@oe.path.relative(prefix, datadir)}' \
|
|
|
|
'mandir=${@oe.path.relative(prefix, mandir)}' \
|
|
|
|
'infodir=${@oe.path.relative(prefix, infodir)}' \
|
2012-12-12 11:26:11 +00:00
|
|
|
"
|
|
|
|
|
2013-10-11 08:11:44 +00:00
|
|
|
# PPC64 uses long long for u64 in the kernel, but powerpc's asm/types.h
|
|
|
|
# prevents 64-bit userland from seeing this definition, instead defaulting
|
|
|
|
# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
|
2013-10-26 07:53:16 +00:00
|
|
|
# int-ll64.h included. And MIPS64 has the same issue.
|
2013-10-11 08:11:44 +00:00
|
|
|
EXTRA_OEMAKE_append_powerpc64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
|
2013-10-26 07:53:16 +00:00
|
|
|
EXTRA_OEMAKE_append_mips64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
|
2013-10-11 08:11:44 +00:00
|
|
|
|
2013-03-05 05:20:27 +00:00
|
|
|
PARALLEL_MAKE = ""
|
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
do_compile() {
|
2013-09-17 04:18:20 +00:00
|
|
|
# Linux kernel build system is expected to do the right thing
|
2013-09-18 13:51:04 +00:00
|
|
|
unset CFLAGS
|
2012-06-20 14:31:40 +00:00
|
|
|
oe_runmake all
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2013-09-17 04:18:20 +00:00
|
|
|
# Linux kernel build system is expected to do the right thing
|
2013-09-18 13:51:04 +00:00
|
|
|
unset CFLAGS
|
2012-06-20 14:31:40 +00:00
|
|
|
oe_runmake DESTDIR=${D} install
|
2012-08-17 02:54:56 +00:00
|
|
|
# we are checking for this make target to be compatible with older perf versions
|
2014-06-24 21:34:45 +00:00
|
|
|
if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" -a $(grep install-python_ext ${S}/tools/perf/Makefile) = "0" ]; then
|
2012-07-09 17:07:10 +00:00
|
|
|
oe_runmake DESTDIR=${D} install-python_ext
|
|
|
|
fi
|
2012-06-20 14:31:40 +00:00
|
|
|
}
|
|
|
|
|
2012-12-12 07:08:37 +00:00
|
|
|
do_configure_prepend () {
|
|
|
|
sed -i 's,-Werror ,,' ${S}/tools/perf/Makefile
|
|
|
|
}
|
|
|
|
|
2013-03-19 04:58:07 +00:00
|
|
|
python do_package_prepend() {
|
2013-03-19 13:22:59 +00:00
|
|
|
bb.data.setVar('PKGV', get_kernelversion('${S}').split("-")[0], d)
|
2013-03-19 04:58:07 +00:00
|
|
|
}
|
|
|
|
|
2012-06-20 14:31:40 +00:00
|
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
|
|
|
2014-06-24 21:34:46 +00:00
|
|
|
PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
|
|
|
|
|
|
|
|
RDEPENDS_${PN} += "elfutils"
|
|
|
|
RDEPENDS_${PN}-archive =+ "bash"
|
|
|
|
RDEPENDS_${PN}-python =+ "bash python"
|
|
|
|
RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
|
|
|
|
|
|
|
|
RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-scripting', '${PN}-perl ${PN}-python', '',d)}"
|
|
|
|
RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
|
|
|
|
|
2012-06-25 04:26:33 +00:00
|
|
|
FILES_${PN}-dbg += "${libdir}/python*/site-packages/.debug"
|
2014-06-24 21:34:46 +00:00
|
|
|
FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
|
|
|
|
FILES_${PN}-tests = "${libdir}/perf/perf-core/tests"
|
|
|
|
FILES_${PN}-python = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
|
|
|
|
FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"
|