aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-01-28 14:24:17 -0800
committerFlorian Fainelli <f.fainelli@gmail.com>2016-01-28 14:24:17 -0800
commit2b1b267a008ab662ee1d32d5aaad2cbce029d1b3 (patch)
tree19753abeb9f69cb34a066a275182e1402e5a58f8
parentfed782fa382577f27e52ca58c131c72191d2f250 (diff)
parent5e2e3d3f3e41e1a9ae8633870ec043cf73ebee56 (diff)
Merge pull request #2324 from ffainelli/bonnieplus
utils: Import bonnie++
-rw-r--r--utils/bonnie++/Makefile53
-rw-r--r--utils/bonnie++/patches/001-cross_compile_fix.patch38
-rw-r--r--utils/bonnie++/patches/002-add-verbose-error-messages.patch47
3 files changed, 138 insertions, 0 deletions
diff --git a/utils/bonnie++/Makefile b/utils/bonnie++/Makefile
new file mode 100644
index 000000000..0008cc23c
--- /dev/null
+++ b/utils/bonnie++/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2009-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bonnie++
+PKG_VERSION:=1.97
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/
+PKG_MD5SUM:=d6cf9703242998b2ddc2d875b028b3c6
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=copyright.txt
+PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bonniexx
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libstdcpp +libpthread
+ TITLE:=Bonnie++ - hard drive bottleneck testing program.
+ URL:=http://www.coker.com.au/bonnie++/
+endef
+
+define Package/bonniexx/description
+ Bonnie++ is a benchmark suite that is aimed at performing a number of simple
+ tests of hard drive and file system performance.
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ TARGET_CXX="$(TARGET_CXX)" \
+ TARGET_LINK="$(TARGET_CXX)" \
+ MORECFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CXXFLAGS)" \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ all
+endef
+
+define Package/bonniexx/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/bonnie++ $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/bon_csv2html $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,bonniexx))
diff --git a/utils/bonnie++/patches/001-cross_compile_fix.patch b/utils/bonnie++/patches/001-cross_compile_fix.patch
new file mode 100644
index 000000000..0379fec0b
--- /dev/null
+++ b/utils/bonnie++/patches/001-cross_compile_fix.patch
@@ -0,0 +1,38 @@
+Index: bonnie++-1.97.1/configure
+===================================================================
+--- bonnie++-1.97.1.orig/configure
++++ bonnie++-1.97.1/configure
+@@ -3955,9 +3955,7 @@ rm -f core conftest.err conftest.$ac_obj
+
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "cannot run test program while cross compiling
+-See \`config.log' for more details" "$LINENO" 5 ; }
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} }
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+Index: bonnie++-1.97.1/Makefile
+===================================================================
+--- bonnie++-1.97.1.orig/Makefile
++++ bonnie++-1.97.1/Makefile
+@@ -1,5 +1,7 @@
+ EXES=bonnie++ zcav getc_putc getc_putc_helper
+ EXE=bon_csv2html generate_randfile
++TARGET_CXX=g++
++TARGET_LINK=g++
+
+ all: $(EXE) $(EXES)
+
+@@ -10,8 +12,8 @@ eprefix=${prefix}
+ #MORE_WARNINGS=-Weffc++
+ WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS)
+ CFLAGS=-O2 -DNDEBUG $(WFLAGS) $(MORECFLAGS)
+-CXX=g++ $(CFLAGS)
+-LINK=g++
++CXX=$(TARGET_CXX) $(CFLAGS)
++LINK=$(TARGET_LINK)
+ THREAD_LFLAGS=-lpthread
+
+ INSTALL=/usr/bin/install -c
diff --git a/utils/bonnie++/patches/002-add-verbose-error-messages.patch b/utils/bonnie++/patches/002-add-verbose-error-messages.patch
new file mode 100644
index 000000000..ccec8e8f1
--- /dev/null
+++ b/utils/bonnie++/patches/002-add-verbose-error-messages.patch
@@ -0,0 +1,47 @@
+--- a/bon_file.cpp
++++ b/bon_file.cpp
+@@ -464,25 +464,37 @@ int COpenTest::delete_sequential(BonTime
+ }
+ if(m_number_directories != 1)
+ {
+- if(chdir("..") || rmdir(buf))
++ if(chdir(".."))
+ {
++ io_error("chdir");
++ return -1;
++ }
++ if(rmdir(buf))
++ {
++ fprintf(stderr, "Unable to delete directory '%s'\n", buf);
+ io_error("rmdir");
+ return -1;
+ }
+ }
+ }
+- if(chdir("..") || rmdir(m_dirname))
++ if(count != m_number)
+ {
+- io_error("rmdir");
++ fprintf(stderr, "Expected %d files but only got %d\n", m_number, count);
+ return -1;
+ }
+- delete m_dirname;
+- m_dirname = NULL;
+- if(count != m_number)
++ if(chdir(".."))
+ {
+- fprintf(stderr, "Expected %d files but only got %d\n", m_number, count);
++ io_error("chdir");
++ return -1;
++ }
++ if(rmdir(m_dirname))
++ {
++ fprintf(stderr, "Unable to delete directory '%s'\n", m_dirname);
++ io_error("rmdir");
+ return -1;
+ }
++ delete m_dirname;
++ m_dirname = NULL;
+ sync();
+ timer.stop_and_record(DelSeq);
+ timer.add_latency(DelSeq, dur.getMax());