All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] Turbostat: add a necessary recipe to meta-oe
@ 2018-05-22  3:26 Hongzhi.Song
  2018-05-22 19:04 ` Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Hongzhi.Song @ 2018-05-22  3:26 UTC (permalink / raw)
  To: openembedded-core

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@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"
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+B = "${WORKDIR}/${BPN}-${PV}"
+
+EXTRA_OEMAKE = '\
+    -C ${S}/tools/power/x86/turbostat \
+    O=${B} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    ARCH=${ARCH} \
+    CC="${CC}" \
+    AR="${AR}" \
+'
+
+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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-oe][PATCH] Turbostat: add a necessary recipe to meta-oe
  2018-05-22  3:26 [meta-oe][PATCH] Turbostat: add a necessary recipe to meta-oe Hongzhi.Song
@ 2018-05-22 19:04 ` Peter Kjellerstedt
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2018-05-22 19:04 UTC (permalink / raw)
  To: Hongzhi.Song, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Hongzhi.Song
> Sent: den 22 maj 2018 05:27
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [meta-oe][PATCH] Turbostat: add a necessary recipe
> to meta-oe

This should be sent to openembedded-devel@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@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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-22 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22  3:26 [meta-oe][PATCH] Turbostat: add a necessary recipe to meta-oe Hongzhi.Song
2018-05-22 19:04 ` Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.