Skip to contentSkip to conversation

ethtool: Allow enabling/disabling pretty printing

PATCH New Florian Fainelli 4 participants 7 messages Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Ethtool has a configure script option allowing the enabling or disabling of pretty printing for drivers, SFP modules etc which can save a significant amount of bytes on the root filesystem. Allow selecting that, and turn it on by default (like ethtool's configure script).

---
 package/ethtool/Config.in  | 10 ++++++++++
 package/ethtool/ethtool.mk |  2 ++
 2 files changed, 12 insertions(+)
package/ethtool/Config.in +10 -0
index 09704979e864..77795a838971 100644
@@ -5,3 +5,13 @@ config BR2_PACKAGE_ETHTOOL
 	  ethernet-based network interface.
 
 	  https://www.kernel.org/pub/software/network/ethtool/
+
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y
+		help
+		  Enables ethtool's pretty printing for drivers
+		  and SFP modules.
+endif
package/ethtool/ethtool.mk +2 -0
index 991df499a8fd..d8ebba5fae05 100644
@@ -9,5 +9,7 @@ ETHTOOL_SOURCE = ethtool-$(ETHTOOL_VERSION).tar.xz
 ETHTOOL_SITE = $(BR2_KERNEL_MIRROR)/software/network/ethtool
 ETHTOOL_LICENSE = GPL-2.0
 ETHTOOL_LICENSE_FILES = COPYING
+ETHTOOL_CONF_OPTS = \
+	$(if $(BR2_PACKAGE_ETHTOOL_PRETTY_PRINT),--enable-pretty-dump,--disable-pretty-dump)
 
 $(eval $(autotools-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Hi Florian,

Quoted 4 lines · Florian Fainelli

Ethtool has a configure script option allowing the enabling or disabling of pretty printing for drivers, SFP modules etc which can save a significant amount of bytes on the root filesystem. Allow selecting that, and turn it on by default (like ethtool's configure script).

Have you measured the impact on the target size?

A test build I ran here (ARM Cortex-A9, musl) showed a significant reduction of the (stripped) binary size from 233124 to 60408.

baruch

Quoted 34 lines
---
 package/ethtool/Config.in  | 10 ++++++++++
 package/ethtool/ethtool.mk |  2 ++
 2 files changed, 12 insertions(+)
package/ethtool/Config.in +10 -0
index 09704979e864..77795a838971 100644
@@ -5,3 +5,13 @@ config BR2_PACKAGE_ETHTOOL
 	  ethernet-based network interface.
 
 	  https://www.kernel.org/pub/software/network/ethtool/
+
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y
+		help
+		  Enables ethtool's pretty printing for drivers
+		  and SFP modules.
+endif
package/ethtool/ethtool.mk +2 -0
index 991df499a8fd..d8ebba5fae05 100644
@@ -9,5 +9,7 @@ ETHTOOL_SOURCE = ethtool-$(ETHTOOL_VERSION).tar.xz
 ETHTOOL_SITE = $(BR2_KERNEL_MIRROR)/software/network/ethtool
 ETHTOOL_LICENSE = GPL-2.0
 ETHTOOL_LICENSE_FILES = COPYING
+ETHTOOL_CONF_OPTS = \
+	$(if $(BR2_PACKAGE_ETHTOOL_PRETTY_PRINT),--enable-pretty-dump,--disable-pretty-dump)
Signature · 3 lines
     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 -
#2 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Quoted 4 lines · Baruch Siach

Hi Florian,

Quoted 1 line · Florian Fainelli

Ethtool has a configure script option allowing the enabling or

Quoted 8 lines

disabling of

Quoted 1 line

pretty printing for drivers, SFP modules etc which can save a

significant

Quoted 1 line

amount of bytes on the root filesystem. Allow selecting that, and

turn it on by

Quoted 1 line

default (like ethtool's configure script).

Have you measured the impact on the target size?

Yes, this was included in the original commit message:

https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=875616dfcbe57ea0f639a20d85fcbad2172ad744

~500 Kbytes on a x86_64 build
~337 Kbytes on a arm build

(savings from the original size)

Quoted 4 lines

A test build I ran here (ARM Cortex-A9, musl) showed a significant reduction
of the (stripped) binary size from 233124 to 60408.

My numbers were not stripped AFAIR, but what you are posting sounds about right.

Thanks
Hello,

Signature · 1 line
Florian
#3 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

In reply to Florian Fainelli
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Florian" == Florian Fainelli <[email protected]> writes:

Ethtool has a configure script option allowing the enabling or disabling of pretty printing for drivers, SFP modules etc which can save a significant amount of bytes on the root filesystem. Allow selecting that, and turn it on by default (like ethtool's configure script).

---
 package/ethtool/Config.in  | 10 ++++++++++
 package/ethtool/ethtool.mk |  2 ++
 2 files changed, 12 insertions(+)
package/ethtool/Config.in +0 -0
index 09704979e864..77795a838971 100644
@@ -5,3 +5,13 @@ config BR2_PACKAGE_ETHTOOL
 	  ethernet-based network interface.
 
 	  https://www.kernel.org/pub/software/network/ethtool/

package/ethtool/Config.in config BR2_PACKAGE_ETHTOOL · line 17

Quoted 10 lines
package/ethtool/Config.in +10 -0
+
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y
+		help
+		  Enables ethtool's pretty printing for drivers
+		  and SFP modules.
+endif

We don't indent sub options in Config.in, and normally don't do the if BR2_PACKAGE_FOO ... endif unless there are several sub options - so I've fixed that and committed, thanks.

Consider running utils/check-package on your patches before sending as it would have complained about this.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Hello,

Quoted 5 lines · Peter Korsgaard

package/ethtool/Config.in config BR2_PACKAGE_ETHTOOL · line 13

Quoted 5 lines
package/ethtool/Config.in +5 -0
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y

Should this really be "default y" ? Baruch reported a significant size increase with this option enabled.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Hi Thomas,

Quoted 10 lines · Thomas Petazzoni
Quoted 5 lines · Peter Korsgaard

package/ethtool/Config.in config BR2_PACKAGE_ETHTOOL · line 13

Quoted 5 lines
package/ethtool/Config.in +5 -0
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y

Should this really be "default y" ? Baruch reported a significant size increase with this option enabled.

This is the current default. The added option only allows to to remove pretty printing.

baruch

Signature · 3 lines
     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 -
#6 lore raw

PATCH 1/1 ethtool: Allow enabling/disabling pretty printing

Hello,

Quoted 9 lines · Baruch Siach
Quoted 8 lines · Thomas Petazzoni
Quoted 5 lines · Peter Korsgaard
Quoted 5 lines
package/ethtool/Config.in +5 -0
+if BR2_PACKAGE_ETHTOOL
+
+	config BR2_PACKAGE_ETHTOOL_PRETTY_PRINT
+		bool "enable pretty printing"
+		default y  
Quoted 5 lines
Quoted 2 lines

Should this really be "default y" ? Baruch reported a significant size increase with this option enabled.

This is the current default. The added option only allows to to remove pretty printing.

Aah, ok. Works for me then.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com