All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package: add powertop 2.7
@ 2015-03-19  5:40 Steven Noonan
  2015-03-20 15:33 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Noonan @ 2015-03-19  5:40 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---

v2:
  - Propagate dependencies from libnl and pciutils.
  - Add description for powertop-autotune.patch.
  - Fix hash origin data.
  - Remove defaults-satisfied POWERTOP_SOURCE value.

 package/Config.in                        |  1 +
 package/powertop/Config.in               | 13 +++++++++++++
 package/powertop/powertop-autotune.patch | 15 +++++++++++++++
 package/powertop/powertop.hash           |  2 ++
 package/powertop/powertop.mk             | 13 +++++++++++++
 5 files changed, 44 insertions(+)
 create mode 100644 package/powertop/Config.in
 create mode 100644 package/powertop/powertop-autotune.patch
 create mode 100644 package/powertop/powertop.hash
 create mode 100644 package/powertop/powertop.mk

diff --git a/package/Config.in b/package/Config.in
index 4ee489c..c938326 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -365,6 +365,7 @@ endif
 	source "package/pciutils/Config.in"
 	source "package/picocom/Config.in"
 	source "package/pifmrds/Config.in"
+	source "package/powertop/Config.in"
 	source "package/pps-tools/Config.in"
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
diff --git a/package/powertop/Config.in b/package/powertop/Config.in
new file mode 100644
index 0000000..202c951
--- /dev/null
+++ b/package/powertop/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_POWERTOP
+	bool "powertop"
+	# pciutils dependency
+	depends on !BR2_bfin
+	# libnl dependency
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_PCIUTILS
+	select BR2_PACKAGE_LIBNL
+	help
+	  A tool to diagnose issues with power consumption and power management
+
+	  https://01.org/powertop/
diff --git a/package/powertop/powertop-autotune.patch b/package/powertop/powertop-autotune.patch
new file mode 100644
index 0000000..f2b3dff
--- /dev/null
+++ b/package/powertop/powertop-autotune.patch
@@ -0,0 +1,15 @@
+Patch pulled from https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/powertop&id=37469c47b885c50365f57044e4ad72e0e3512b91
+
+Fixes a use-after-close bug in create_all_devfreq_devices().
+
+Signed-off-by: Steven Noonan <steven@uplinklabs.net>
+
+--- a/src/devices/devfreq.cpp
++++ b/src/devices/devfreq.cpp
+@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
+		fprintf(stderr, "Devfreq not enabled\n");
+		is_enabled = false;
+		closedir(dir);
++		dir = NULL;
+		return;
+	}
diff --git a/package/powertop/powertop.hash b/package/powertop/powertop.hash
new file mode 100644
index 0000000..b64981e
--- /dev/null
+++ b/package/powertop/powertop.hash
@@ -0,0 +1,2 @@
+# Locally-generated hash
+sha256	8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca	powertop-2.7.tar.gz
diff --git a/package/powertop/powertop.mk b/package/powertop/powertop.mk
new file mode 100644
index 0000000..3d0c1ab
--- /dev/null
+++ b/package/powertop/powertop.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# powertop
+#
+################################################################################
+
+POWERTOP_VERSION = 2.7
+POWERTOP_SITE = https://01.org/sites/default/files/downloads/powertop/
+POWERTOP_DEPENDENCIES = pciutils ncurses libnl
+POWERTOP_LICENSE = GPLv2
+POWERTOP_LICENSE_FILES = COPYING
+
+$(eval $(autotools-package))
-- 
2.3.3

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

* [Buildroot] [PATCH] package: add powertop 2.7
  2015-03-19  5:40 [Buildroot] [PATCH] package: add powertop 2.7 Steven Noonan
@ 2015-03-20 15:33 ` Thomas Petazzoni
  2015-03-20 20:28   ` Steven Noonan
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-03-20 15:33 UTC (permalink / raw)
  To: buildroot

Dear Steven Noonan,

On Wed, 18 Mar 2015 22:40:21 -0700, Steven Noonan wrote:
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>

I've applied, but to be honest, I found that they were too many trivial
issues that should have been discovered before the patch was submitted.
Here is the list of things that I had to change:

    [Thomas:
      - fix commit title
      - powertop wants libintl unconditionally, so make sure
        BR2_PACKAGE_GETTEXT is selected when BR2_NEEDS_GETTEXT is set,
        and add gettext to the dependencies.
      - add missing comment about thread dependency.
      - add missing dependency on host-pkgconf, without which powertop
        cannot find libnl.
      - patch src/Makefile.am to not pass -fstack-protector, which fails
        to build if the toolchain does not have SSP support.
      - rename patch powertop-autotune.patch to confirm to the patch
        naming convention.]

Commit title: we normally expect "<foo>: new package" for package
additions. I agree, this is pure nitpicking :-)

The libintl issue was trivially found by using a uClibc toolchain,
which is the default in Buildroot. You can for example use
http://autobuild.buildroot.org/toolchains/configs/br-arm-full.config as
a base configuration file to quickly test things against uClibc.

The missing thread comment was trivial, it's documented in the section
"17.2.2. Dependencies on target and toolchain options" in the Buildroot
manual.

The missing dependency on host-pkgconf is seen when you do a build with
just powertop. Whenever you submit a new package, make sure you do a
build from scratch with just this package enabled, so that you have
some minimal verification that the dependencies are correct.

The -fstack-protector issue was also seen because I'm using a standard
uClibc toolchain, which do not have SSP enabled by default.

The patch naming convention is also documented in the Buildroot manual.

In the light of those comments, could you have a second look at your
other "new package" submissions and retest them with a uClibc
toolchain, and with a Buildroot build having just each new package
enabled, in order to discover missing dependencies?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package: add powertop 2.7
  2015-03-20 15:33 ` Thomas Petazzoni
@ 2015-03-20 20:28   ` Steven Noonan
  2015-03-20 20:54     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Noonan @ 2015-03-20 20:28 UTC (permalink / raw)
  To: buildroot

On Fri, Mar 20, 2015 at 8:33 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Steven Noonan,
>
> On Wed, 18 Mar 2015 22:40:21 -0700, Steven Noonan wrote:
>> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
>
> I've applied, but to be honest, I found that they were too many trivial
> issues that should have been discovered before the patch was submitted.
> Here is the list of things that I had to change:
>
>     [Thomas:
>       - fix commit title
>       - powertop wants libintl unconditionally, so make sure
>         BR2_PACKAGE_GETTEXT is selected when BR2_NEEDS_GETTEXT is set,
>         and add gettext to the dependencies.
>       - add missing comment about thread dependency.
>       - add missing dependency on host-pkgconf, without which powertop
>         cannot find libnl.
>       - patch src/Makefile.am to not pass -fstack-protector, which fails
>         to build if the toolchain does not have SSP support.
>       - rename patch powertop-autotune.patch to confirm to the patch
>         naming convention.]

Yes, I agree, that number of issues is ridiculous.

> Commit title: we normally expect "<foo>: new package" for package
> additions. I agree, this is pure nitpicking :-)
>
> The libintl issue was trivially found by using a uClibc toolchain,
> which is the default in Buildroot. You can for example use
> http://autobuild.buildroot.org/toolchains/configs/br-arm-full.config as
> a base configuration file to quickly test things against uClibc.
>
> The missing thread comment was trivial, it's documented in the section
> "17.2.2. Dependencies on target and toolchain options" in the Buildroot
> manual.
>
> The missing dependency on host-pkgconf is seen when you do a build with
> just powertop. Whenever you submit a new package, make sure you do a
> build from scratch with just this package enabled, so that you have
> some minimal verification that the dependencies are correct.
>
> The -fstack-protector issue was also seen because I'm using a standard
> uClibc toolchain, which do not have SSP enabled by default.
>
> The patch naming convention is also documented in the Buildroot manual.
>
> In the light of those comments, could you have a second look at your
> other "new package" submissions and retest them with a uClibc
> toolchain, and with a Buildroot build having just each new package
> enabled, in order to discover missing dependencies?
>
> Thanks a lot!

I appreciate the feedback. I had only been testing with x86_64 and x32
glibc builds, and hadn't thought of uClibc issues. I'll be sure to try
and test that in the future.

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

* [Buildroot] [PATCH] package: add powertop 2.7
  2015-03-20 20:28   ` Steven Noonan
@ 2015-03-20 20:54     ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2015-03-20 20:54 UTC (permalink / raw)
  To: buildroot

Dear Steven Noonan,

On Fri, 20 Mar 2015 13:28:03 -0700, Steven Noonan wrote:

> >     [Thomas:
> >       - fix commit title
> >       - powertop wants libintl unconditionally, so make sure
> >         BR2_PACKAGE_GETTEXT is selected when BR2_NEEDS_GETTEXT is set,
> >         and add gettext to the dependencies.
> >       - add missing comment about thread dependency.
> >       - add missing dependency on host-pkgconf, without which powertop
> >         cannot find libnl.
> >       - patch src/Makefile.am to not pass -fstack-protector, which fails
> >         to build if the toolchain does not have SSP support.
> >       - rename patch powertop-autotune.patch to confirm to the patch
> >         naming convention.]
> 
> Yes, I agree, that number of issues is ridiculous.

Well, I wouldn't use "ridiculous" : those are your first Buildroot
contributions, so it's kind of expected that you don't necessarily know
all the combinations we typically test before applying patches. I'm
very happy to see new contributors, and to see you and Mike Williams
taking care of the systemd stuff. So clearly I don't want to shoot down
your contributions :-)

> I appreciate the feedback. I had only been testing with x86_64 and x32
> glibc builds, and hadn't thought of uClibc issues. I'll be sure to try
> and test that in the future.

Yes, even though glibc is widely used, uClibc is still our default C
library, and so we continue to check that things build fine with it.
You have some configuration fragments that use pre-built uClibc
toolchains at http://autobuild.buildroot.org/toolchains/configs/, which
make it easy to test various situations without having to rebuild a
full toolchain each time.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package: add powertop 2.7
  2015-03-19  3:48 ` [Buildroot] [PATCH] package: add powertop 2.7 Steven Noonan
@ 2015-03-19  5:31   ` Baruch Siach
  0 siblings, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2015-03-19  5:31 UTC (permalink / raw)
  To: buildroot

Hi Steven,

On Wed, Mar 18, 2015 at 08:48:04PM -0700, Steven Noonan wrote:
> diff --git a/package/powertop/Config.in b/package/powertop/Config.in
> new file mode 100644
> index 0000000..0e83c8f
> --- /dev/null
> +++ b/package/powertop/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_POWERTOP
> +	bool "powertop"
> +	select BR2_PACKAGE_NCURSES
> +	select BR2_PACKAGE_PCIUTILS
> +	select BR2_PACKAGE_LIBNL

Dependencies propagation.

> +	help
> +	  A tool to diagnose issues with power consumption and power management
> +
> +	  https://01.org/powertop/
> diff --git a/package/powertop/powertop-autotune.patch b/package/powertop/powertop-autotune.patch
> new file mode 100644
> index 0000000..23d6433
> --- /dev/null
> +++ b/package/powertop/powertop-autotune.patch
> @@ -0,0 +1,9 @@
> +--- a/src/devices/devfreq.cpp
> ++++ b/src/devices/devfreq.cpp

Please add a description and your sing-off here.

> +@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
> +		fprintf(stderr, "Devfreq not enabled\n");
> +		is_enabled = false;
> +		closedir(dir);
> ++		dir = NULL;
> +		return;
> +	}
> diff --git a/package/powertop/powertop.hash b/package/powertop/powertop.hash
> new file mode 100644
> index 0000000..b26ae80
> --- /dev/null
> +++ b/package/powertop/powertop.hash
> @@ -0,0 +1,2 @@
> +# From https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz

Hash origin.

> +sha256	8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca	powertop-2.7.tar.gz
> diff --git a/package/powertop/powertop.mk b/package/powertop/powertop.mk
> new file mode 100644
> index 0000000..337688a
> --- /dev/null
> +++ b/package/powertop/powertop.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# powertop
> +#
> +################################################################################
> +
> +POWERTOP_VERSION = 2.7
> +POWERTOP_SOURCE = powertop-$(POWERTOP_VERSION).tar.gz

This is the default. Please remove.

> +POWERTOP_SITE = https://01.org/sites/default/files/downloads/powertop/
> +POWERTOP_DEPENDENCIES = pciutils ncurses libnl
> +POWERTOP_LICENSE = GPLv2
> +POWERTOP_LICENSE_FILES = COPYING
> +
> +$(eval $(autotools-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] package: add powertop 2.7
  2015-03-19  3:48 [Buildroot] [PATCH] package: add hwloc 1.10.1 Steven Noonan
@ 2015-03-19  3:48 ` Steven Noonan
  2015-03-19  5:31   ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Noonan @ 2015-03-19  3:48 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
 package/Config.in                        |  1 +
 package/powertop/Config.in               |  9 +++++++++
 package/powertop/powertop-autotune.patch |  9 +++++++++
 package/powertop/powertop.hash           |  2 ++
 package/powertop/powertop.mk             | 14 ++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/powertop/Config.in
 create mode 100644 package/powertop/powertop-autotune.patch
 create mode 100644 package/powertop/powertop.hash
 create mode 100644 package/powertop/powertop.mk

diff --git a/package/Config.in b/package/Config.in
index 4ee489c..c938326 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -365,6 +365,7 @@ endif
 	source "package/pciutils/Config.in"
 	source "package/picocom/Config.in"
 	source "package/pifmrds/Config.in"
+	source "package/powertop/Config.in"
 	source "package/pps-tools/Config.in"
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
diff --git a/package/powertop/Config.in b/package/powertop/Config.in
new file mode 100644
index 0000000..0e83c8f
--- /dev/null
+++ b/package/powertop/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_POWERTOP
+	bool "powertop"
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_PCIUTILS
+	select BR2_PACKAGE_LIBNL
+	help
+	  A tool to diagnose issues with power consumption and power management
+
+	  https://01.org/powertop/
diff --git a/package/powertop/powertop-autotune.patch b/package/powertop/powertop-autotune.patch
new file mode 100644
index 0000000..23d6433
--- /dev/null
+++ b/package/powertop/powertop-autotune.patch
@@ -0,0 +1,9 @@
+--- a/src/devices/devfreq.cpp
++++ b/src/devices/devfreq.cpp
+@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
+		fprintf(stderr, "Devfreq not enabled\n");
+		is_enabled = false;
+		closedir(dir);
++		dir = NULL;
+		return;
+	}
diff --git a/package/powertop/powertop.hash b/package/powertop/powertop.hash
new file mode 100644
index 0000000..b26ae80
--- /dev/null
+++ b/package/powertop/powertop.hash
@@ -0,0 +1,2 @@
+# From https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
+sha256	8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca	powertop-2.7.tar.gz
diff --git a/package/powertop/powertop.mk b/package/powertop/powertop.mk
new file mode 100644
index 0000000..337688a
--- /dev/null
+++ b/package/powertop/powertop.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# powertop
+#
+################################################################################
+
+POWERTOP_VERSION = 2.7
+POWERTOP_SOURCE = powertop-$(POWERTOP_VERSION).tar.gz
+POWERTOP_SITE = https://01.org/sites/default/files/downloads/powertop/
+POWERTOP_DEPENDENCIES = pciutils ncurses libnl
+POWERTOP_LICENSE = GPLv2
+POWERTOP_LICENSE_FILES = COPYING
+
+$(eval $(autotools-package))
-- 
2.3.3

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

end of thread, other threads:[~2015-03-20 20:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  5:40 [Buildroot] [PATCH] package: add powertop 2.7 Steven Noonan
2015-03-20 15:33 ` Thomas Petazzoni
2015-03-20 20:28   ` Steven Noonan
2015-03-20 20:54     ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2015-03-19  3:48 [Buildroot] [PATCH] package: add hwloc 1.10.1 Steven Noonan
2015-03-19  3:48 ` [Buildroot] [PATCH] package: add powertop 2.7 Steven Noonan
2015-03-19  5:31   ` Baruch Siach

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.