[OE-core] [meta-oe][PATCH] Turbostat: add a necessary recipe to meta-oe
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Tue May 22 19:04:57 UTC 2018
> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org
> [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf Of
> Hongzhi.Song
> Sent: den 22 maj 2018 05:27
> To: openembedded-core at lists.openembedded.org
> Subject: [OE-core] [meta-oe][PATCH] Turbostat: add a necessary recipe
> to meta-oe
This should be sent to openembedded-devel at lists.openembedded.org instead
as it relates to meta-oe and not meta.
> This is an efficient tool to reflect the status of processors.
> Turbostat reports processor topology, frequency, idle power-state
> statistics, temperature and power on processors.
>
> Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
> ---
> meta-oe/recipes-kernel/turbostat/turbostat.bb | 53
> +++++++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
> create mode 100644 meta-oe/recipes-kernel/turbostat/turbostat.bb
>
> diff --git a/meta-oe/recipes-kernel/turbostat/turbostat.bb b/meta-
> oe/recipes-kernel/turbostat/turbostat.bb
> new file mode 100644
> index 000000000..f4614b406
> --- /dev/null
> +++ b/meta-oe/recipes-kernel/turbostat/turbostat.bb
> @@ -0,0 +1,53 @@
> +SUMMARY = "Report processor frequency and idle statistics"
> +DESCRIPTION = "turbostat reports processor topology, frequency, idle \
> +power-state statistics, temperature and power on modern X86 processors. \
> +Either command is forked and statistics are printed upon its completion, \
> +or statistics are printed periodically."
> +
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
> +
> +inherit kernelsrc
> +PROVIDES = "virtual/turbostat"
Why is virtual/turbostat needed? Are there likely to be alternatives?
> +do_populate_lic[depends] += "virtual/kernel:do_patch"
> +do_configure[depends] += "virtual/kernel:do_shared_workdir"
> +
> +B = "${WORKDIR}/${BPN}-${PV}"
> +
> +EXTRA_OEMAKE = '\
It is better to use " here and ' around ${CC} and ${AR} below.
> + -C ${S}/tools/power/x86/turbostat \
What about other architectures? If they are not supported, you should add:
COMPATIBLE_MACHINE = "x86"
> + O=${B} \
> + CROSS_COMPILE=${TARGET_PREFIX} \
> + ARCH=${ARCH} \
> + CC="${CC}" \
> + AR="${AR}" \
> +'
Combine the two EXTRA_OEMAKE into one.
> +
> +EXTRA_OEMAKE += "\
> + 'prefix=${prefix}' \
> + 'bindir=${bindir}' \
> + 'sharedir=${datadir}' \
> + 'sysconfdir=${sysconfdir}' \
> + 'sharedir=${@os.path.relpath(datadir, prefix)}' \
> + 'mandir=${@os.path.relpath(mandir, prefix)}' \
> + 'infodir=${@os.path.relpath(infodir, prefix)}' \
> +"
> +
> +do_compile() {
> + # Linux kernel build system is expected to do the right thing
> + unset CFLAGS
> + oe_runmake turbostat
> +}
> +
> +do_install() {
> + # Linux kernel build system is expected to do the right thing
> + unset CFLAGS
> + oe_runmake DESTDIR=${D} install
> +}
> +
> +python do_package_prepend() {
> + d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
> +}
> +
> +TARGET_CC_ARCH += "${LDFLAGS}"
> --
> 2.11.0
//Peter
More information about the Openembedded-core
mailing list