Skip to contentSkip to conversation

schedtop: new package

PATCH New Sergio Prado 2 participants 3 messages Nov 4, 2017 – Nov 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 schedtop: new package

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 ...ix-build-with-Boost-Filesystem-library-V3.patch | 54 ++++++++++++++++++++++
 package/schedtop/Config.in                         | 25 ++++++++++
 package/schedtop/schedtop.mk                       | 30 ++++++++++++
 5 files changed, 111 insertions(+)
 create mode 100644 package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch
 create mode 100644 package/schedtop/Config.in
 create mode 100644 package/schedtop/schedtop.mk
DEVELOPERS +1 -0
index f0f83b0f4291..8516a6c81e55 100644
@@ -1412,6 +1412,7 @@ F:	package/xr819-xradio/
 N:	Sergio Prado <[email protected]>
 F:	package/libgdiplus/
 F:	package/mongodb/
+F:	package/schedtop/
 F:	package/stella/
 F:	package/tunctl/
 F:	package/ubus/
package/Config.in +1 -0
index 55fe80139eaa..bda63c0804fb 100644
@@ -1936,6 +1936,7 @@ menu "System tools"
 	source "package/s6-linux-utils/Config.in"
 	source "package/s6-portable-utils/Config.in"
 	source "package/s6-rc/Config.in"
+	source "package/schedtop/Config.in"
 	source "package/scrub/Config.in"
 	source "package/scrypt/Config.in"
 	source "package/smack/Config.in"
package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch new file +54 -0

54 lines not on this page · raw message

package/schedtop/Config.in new file +25 -0
new file mode 100644
index 000000000000..2c13e50bb8e2
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_SCHEDTOP
+	bool "schedtop"
+	depends on BR2_INSTALL_LIBSTDCPP # boost
+	depends on BR2_TOOLCHAIN_HAS_THREADS # boost
+	depends on BR2_USE_WCHAR # boost
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_REGEX
+	select BR2_PACKAGE_BOOST_SYSTEM
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
+	select BR2_PACKAGE_NCURSES
+	help
+	  This utility will process statistics from /proc/schedstat
+	  such that the busiest stats will bubble up to the top. It
+	  can alternately be sorted by the largest stat, or by name.
+	  Stats can be included or excluded based on reg-ex pattern
+	  matching.
+
+	  You should enable CONFIG_SCHEDSTATS in your Linux kernel
+	  configuration to use this utility.
+
+	  https://github.com/ghaskins/schedtop
+
+comment "schedtop needs a toolchain w/ C++, threads, wchar"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
package/schedtop/schedtop.mk new file +30 -0
new file mode 100644
index 000000000000..656e3716f26b
@@ -0,0 +1,30 @@
+################################################################################
+#
+# schedtop
+#
+################################################################################
+
+SCHEDTOP_VERSION = 68dee649f96b3bf6db883de67f68ccc0b45cbc6e
+SCHEDTOP_SITE = $(call github,ghaskins,schedtop,$(SCHEDTOP_VERSION))
+SCHEDTOP_LICENSE = GPL-2.0
+SCHEDTOP_LICENSE_FILES = COPYING
+
+SCHEDTOP_DEPENDENCIES = boost ncurses
+
+SCHEDTOP_MAKE_ENV = $(TARGET_MAKE_ENV) OBJDIR="$(@D)/obj" LIBRARIES="-lboost_system"
+
+# uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SCHEDTOP_MAKE_ENV += LIBRARIES+=" -latomic"
+endif
+
+define SCHEDTOP_BUILD_CMDS
+	$(SCHEDTOP_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define SCHEDTOP_INSTALL_TARGET_CMDS
+	$(SCHEDTOP_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+		PREFIX=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 schedtop: new package

Hello,

Quoted 1 line · Sergio Prado

Thanks for this contribution! See a few comments/suggestions below.

Quoted 6 lines
package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch new file +0 -0
new file mode 100644
index 000000000000..d0dc278dfb70

package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch line 9

Quoted 9 lines
package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch new file +9 -0
@@ -0,0 +1,54 @@
+From 845e74ffc0d280163b66d81df963b4c3738f9666 Mon Sep 17 00:00:00 2001
+From: Sergio Prado <[email protected]>
+Date: Sun, 29 Oct 2017 13:20:10 -0200
+Subject: [PATCH] Fix build with Boost Filesystem library V3
+
+In version 3 of the boost filesystem library, string() is a member of
+path(), not directory_entry.
+
+Signed-off-by: Sergio Prado <[email protected]>

What about using
https://github.com/ghaskins/schedtop/pull/1/commits/19d9d3d16e4731c97f1395ba2127fe48a46bb765
which does pretty much the same thing, but with additional fixes ?

Quoted 10 lines
package/schedtop/schedtop.mk new file +4 -0
new file mode 100644
index 000000000000..656e3716f26b
@@ -0,0 +1,30 @@
+################################################################################
+#
+# schedtop
+#

package/schedtop/schedtop.mk line 14

Quoted 10 lines
package/schedtop/schedtop.mk new file +10 -0
+################################################################################
+
+SCHEDTOP_VERSION = 68dee649f96b3bf6db883de67f68ccc0b45cbc6e
+SCHEDTOP_SITE = $(call github,ghaskins,schedtop,$(SCHEDTOP_VERSION))
+SCHEDTOP_LICENSE = GPL-2.0
+SCHEDTOP_LICENSE_FILES = COPYING
+
+SCHEDTOP_DEPENDENCIES = boost ncurses
+
+SCHEDTOP_MAKE_ENV = $(TARGET_MAKE_ENV) OBJDIR="$(@D)/obj" LIBRARIES="-lboost_system"

Why do you need to customize OBJDIR ?

The LIBRARIES change would be taken care of if a patch like
https://github.com/ghaskins/schedtop/pull/1/commits/19d9d3d16e4731c97f1395ba2127fe48a46bb765
is used.

package/schedtop/schedtop.mk line 18

Quoted 3 lines
package/schedtop/schedtop.mk new file +3 -0
+# uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SCHEDTOP_MAKE_ENV += LIBRARIES+=" -latomic"

Are you sure += in shell as the expected result ?

Thanks!

Thomas

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

PATCH 1/1 schedtop: new package

Hello Thomas,

2017-11-23 20:13 GMT-02:00 Thomas Petazzoni <
[email protected]>:

Quoted 7 lines

Hello,

Quoted 1 line · Sergio Prado

Thanks for this contribution! See a few comments/suggestions below.

Thanks for reviewing the patch!

Quoted 2 lines

What about using

https://github.com/ghaskins/schedtop/pull/1/commits/19d9d3d16e4731c97f1395ba2127fe48a46bb765

Quoted 1 line

which does pretty much the same thing, but with additional fixes ?

I did not use it because it was not (yet) accepted upstream and it does more than just fixing build errors, like changing an application error message. Should we use patches not accepted upstream that changes application behavior?

Quoted 1 line
Quoted 1 line

+SCHEDTOP_MAKE_ENV = $(TARGET_MAKE_ENV) OBJDIR="$(@D)/obj"

LIBRARIES="-lboost_system"

Quoted 2 lines

Why do you need to customize OBJDIR ?

As you can see from the application's Makefile, OBJDIR is set to the host architecture name:

ARCH=$(shell uname -m)
OBJDIR ?= obj/$(ARCH)

And then in the end of the build you can see some build commands using the "obj/x86_64/" directory, and I thought that would be confuse, since we are cross-compiling. But I can remove it if you do not see any problem with this behavior.

Quoted 2 lines

The LIBRARIES change would be taken care of if a patch like

https://github.com/ghaskins/schedtop/pull/1/commits/19d9d3d16e4731c97f1395ba2127fe48a46bb765

Quoted 1 line

is used.

So it is better to patch the application's Makefile instead of changing the variable in the package's makefile?

Quoted 6 lines

package/schedtop/schedtop.mk line 18

Quoted 4 lines
package/schedtop/schedtop.mk new file +3 -0
+# uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SCHEDTOP_MAKE_ENV += LIBRARIES+=" -latomic"

Are you sure += in shell as the expected result ?

Yes, it works for shell scripts:

$ cat testvar.sh
#!/bin/sh
echo TESTVAR="$TESTVAR"
$ TESTVAR=1 TESTVAR+=2 ./testvar.sh
TESTVAR=12

And for Makefiles:

$ cat Makefile
TESTVAR?=1
all:
@echo TESTVAR="$(TESTVAR)"
$ TESTVAR=A TESTVAR+=B make
TESTVAR=AB

Do you see any problem doing that? I can create an extra variable and append to it before passing to SCHEDTOP_MAKE_ENV, but that would make the makefile a little bit more complex. What do you think?

Quoted 2 lines

Thanks!

Thanks!

Best regards,

Sergio Prado
Embedded Labworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171126/391a85c3/attachment.html>