diff options
| author | Jörg Sommer <joerg.sommer@navimatix.de> | 2024-01-28 19:20:58 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-01-28 20:04:24 -0800 |
| commit | 1f8dc17b7cc7205a391b5284907371fab9a9bb66 (patch) | |
| tree | 0b1e0605468b59b20d1822662b7d44ad42a51efa /meta-oe/recipes-benchmark/bonnie | |
| parent | ede8aef105a12c0de0d7c00501f3f8c916cd6b5a (diff) | |
| download | meta-openembedded-1f8dc17b7cc7205a391b5284907371fab9a9bb66.tar.gz | |
bonnie++: New recipe for version 2.0
Newer versions of bonnie get published on
<https://doc.coker.com.au/projects/bonnie/>. Unfortunately, the new version
doesn't compile with g++ 11 which requires *fix-csv2html-data.patch* and
configure fails due to cross compilation which gets fixed
with *fix-configure-lfs.patch*
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-benchmark/bonnie')
4 files changed, 279 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-configure-lfs.patch b/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-configure-lfs.patch new file mode 100644 index 0000000000..af20acdcd0 --- /dev/null +++ b/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-configure-lfs.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | Upstream-Status: Submitted [https://salsa.debian.org/etbe/bonnie/-/merge_requests/3/diffs?commit_id=4ffece51791ba75ddca2e664cdce726cc40c92d3] | ||
| 2 | |||
| 3 | diff --git i/configure.in w/configure.in | ||
| 4 | index 080e40c..f2a2bbe 100644 | ||
| 5 | --- i/configure.in | ||
| 6 | +++ w/configure.in | ||
| 7 | @@ -82,8 +82,15 @@ void * thread_func(void * param) { return NULL; } | ||
| 8 | , thread_ldflags="-lpthread" | ||
| 9 | , thread_ldflags="-pthread") | ||
| 10 | |||
| 11 | -AC_SUBST(large_file) | ||
| 12 | -AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE | ||
| 13 | +AC_ARG_ENABLE(lfs, | ||
| 14 | + [ --disable-lfs disable large file support], | ||
| 15 | + LFS_CHOICE=$enableval, LFS_CHOICE=check) | ||
| 16 | + | ||
| 17 | +if test "$LFS_CHOICE" = yes; then | ||
| 18 | + bonniepp_cv_large_file=yes | ||
| 19 | +elif test "$LFS_CHOICE" = check; then | ||
| 20 | + AC_CACHE_CHECK([whether to enable -D_LARGEFILE64_SOURCE], bonniepp_cv_large_file, | ||
| 21 | + AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE | ||
| 22 | #define _LARGEFILE64_SOURCE | ||
| 23 | #endif | ||
| 24 | #include <stdio.h> | ||
| 25 | @@ -118,8 +125,12 @@ int main () { | ||
| 26 | } | ||
| 27 | close(fd); | ||
| 28 | return 0; | ||
| 29 | -}], large_file="yes") | ||
| 30 | -if [[ -n "$large_file" ]]; then | ||
| 31 | +}], bonniepp_cv_large_file="yes")) | ||
| 32 | +fi | ||
| 33 | + | ||
| 34 | +AC_SUBST(large_file) | ||
| 35 | + | ||
| 36 | +if [[ -n "$bonniepp_cv_large_file" ]]; then | ||
| 37 | large_file="#define _LARGEFILE64_SOURCE" | ||
| 38 | fi | ||
| 39 | |||
diff --git a/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-csv2html-data.patch b/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-csv2html-data.patch new file mode 100644 index 0000000000..4b37b8d654 --- /dev/null +++ b/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-csv2html-data.patch | |||
| @@ -0,0 +1,183 @@ | |||
| 1 | commit 7e9433a56f22426b11cbc9bd80e0debca67c893b | ||
| 2 | Author: Jörg Sommer <joerg.sommer@navimatix.de> | ||
| 3 | Date: Mon Jun 26 12:38:30 2023 +0200 | ||
| 4 | |||
| 5 | csv2html: Explicitly reference data in top level | ||
| 6 | |||
| 7 | With g++ 11 *data* became ambiguous with [std::data][1]. Therefore it's | ||
| 8 | needed to explicitly address the variable from the top level scope. | ||
| 9 | |||
| 10 | [1] https://en.cppreference.com/w/cpp/iterator/data | ||
| 11 | |||
| 12 | Upstream-Status: Submitted [https://salsa.debian.org/etbe/bonnie/-/merge_requests/3/diffs?commit_id=fb13a71d56dab8aaa39233fcaaedfb0ba4ad647d] | ||
| 13 | |||
| 14 | diff --git a/bon_csv2html.cpp b/bon_csv2html.cpp | ||
| 15 | index e9d9c50..652e330 100644 | ||
| 16 | --- a/bon_csv2html.cpp | ||
| 17 | +++ b/bon_csv2html.cpp | ||
| 18 | @@ -87,8 +87,8 @@ int main(int argc, char **argv) | ||
| 19 | read_in(buf); | ||
| 20 | } | ||
| 21 | |||
| 22 | - props = new PPCCHAR[data.size()]; | ||
| 23 | - for(i = 0; i < data.size(); i++) | ||
| 24 | + props = new PPCCHAR[::data.size()]; | ||
| 25 | + for(i = 0; i < ::data.size(); i++) | ||
| 26 | { | ||
| 27 | props[i] = new PCCHAR[MAX_ITEMS]; | ||
| 28 | props[i][0] = NULL; | ||
| 29 | @@ -109,7 +109,7 @@ int main(int argc, char **argv) | ||
| 30 | } | ||
| 31 | calc_vals(); | ||
| 32 | int mid_width = header(); | ||
| 33 | - for(i = 0; i < data.size(); i++) | ||
| 34 | + for(i = 0; i < ::data.size(); i++) | ||
| 35 | { | ||
| 36 | // First print the average speed line | ||
| 37 | printf("<tr>"); | ||
| 38 | @@ -171,23 +171,23 @@ int compar(const void *a, const void *b) | ||
| 39 | |||
| 40 | void calc_vals() | ||
| 41 | { | ||
| 42 | - ITEM *arr = new ITEM[data.size()]; | ||
| 43 | + ITEM *arr = new ITEM[::data.size()]; | ||
| 44 | for(unsigned int column_ind = 0; column_ind < MAX_ITEMS; column_ind++) | ||
| 45 | { | ||
| 46 | switch(vals[column_ind]) | ||
| 47 | { | ||
| 48 | case eNoCols: | ||
| 49 | { | ||
| 50 | - for(unsigned int row_ind = 0; row_ind < data.size(); row_ind++) | ||
| 51 | + for(unsigned int row_ind = 0; row_ind < ::data.size(); row_ind++) | ||
| 52 | { | ||
| 53 | if(column_ind == COL_CONCURRENCY) | ||
| 54 | { | ||
| 55 | - if(data[row_ind][column_ind] && strcmp("1", data[row_ind][column_ind])) | ||
| 56 | + if(::data[row_ind][column_ind] && strcmp("1", ::data[row_ind][column_ind])) | ||
| 57 | col_used[column_ind] = true; | ||
| 58 | } | ||
| 59 | else | ||
| 60 | { | ||
| 61 | - if(data[row_ind][column_ind] && strlen(data[row_ind][column_ind])) | ||
| 62 | + if(::data[row_ind][column_ind] && strlen(::data[row_ind][column_ind])) | ||
| 63 | col_used[column_ind] = true; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | @@ -195,22 +195,22 @@ void calc_vals() | ||
| 67 | break; | ||
| 68 | case eCPU: | ||
| 69 | { | ||
| 70 | - for(unsigned int row_ind = 0; row_ind < data.size(); row_ind++) | ||
| 71 | + for(unsigned int row_ind = 0; row_ind < ::data.size(); row_ind++) | ||
| 72 | { | ||
| 73 | double work, cpu; | ||
| 74 | arr[row_ind].val = 0.0; | ||
| 75 | - if(data[row_ind].size() > column_ind | ||
| 76 | - && sscanf(data[row_ind][column_ind - 1], "%lf", &work) == 1 | ||
| 77 | - && sscanf(data[row_ind][column_ind], "%lf", &cpu) == 1) | ||
| 78 | + if(::data[row_ind].size() > column_ind | ||
| 79 | + && sscanf(::data[row_ind][column_ind - 1], "%lf", &work) == 1 | ||
| 80 | + && sscanf(::data[row_ind][column_ind], "%lf", &cpu) == 1) | ||
| 81 | { | ||
| 82 | arr[row_ind].val = cpu / work; | ||
| 83 | } | ||
| 84 | arr[row_ind].pos = row_ind; | ||
| 85 | } | ||
| 86 | - qsort(arr, data.size(), sizeof(ITEM), compar); | ||
| 87 | + qsort(arr, ::data.size(), sizeof(ITEM), compar); | ||
| 88 | int col_count = -1; | ||
| 89 | double min_col = -1.0, max_col = -1.0; | ||
| 90 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 91 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 92 | { | ||
| 93 | // if item is different from previous or if the first row | ||
| 94 | // (sort_ind == 0) then increment col count | ||
| 95 | @@ -239,7 +239,7 @@ void calc_vals() | ||
| 96 | min_col /= mult; | ||
| 97 | } | ||
| 98 | double range_col = max_col - min_col; | ||
| 99 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 100 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 101 | { | ||
| 102 | if(arr[sort_ind].col_ind > -1) | ||
| 103 | { | ||
| 104 | @@ -250,7 +250,7 @@ void calc_vals() | ||
| 105 | } | ||
| 106 | else | ||
| 107 | { | ||
| 108 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 109 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 110 | { | ||
| 111 | if(vals[column_ind] == eLatency) | ||
| 112 | { | ||
| 113 | @@ -263,25 +263,25 @@ void calc_vals() | ||
| 114 | case eSpeed: | ||
| 115 | case eLatency: | ||
| 116 | { | ||
| 117 | - for(unsigned int row_ind = 0; row_ind < data.size(); row_ind++) | ||
| 118 | + for(unsigned int row_ind = 0; row_ind < ::data.size(); row_ind++) | ||
| 119 | { | ||
| 120 | arr[row_ind].val = 0.0; | ||
| 121 | - if(data[row_ind].size() <= column_ind | ||
| 122 | - || sscanf(data[row_ind][column_ind], "%lf", &arr[row_ind].val) == 0) | ||
| 123 | + if(::data[row_ind].size() <= column_ind | ||
| 124 | + || sscanf(::data[row_ind][column_ind], "%lf", &arr[row_ind].val) == 0) | ||
| 125 | arr[row_ind].val = 0.0; | ||
| 126 | if(vals[column_ind] == eLatency && arr[row_ind].val != 0.0) | ||
| 127 | { | ||
| 128 | - if(strstr(data[row_ind][column_ind], "ms")) | ||
| 129 | + if(strstr(::data[row_ind][column_ind], "ms")) | ||
| 130 | arr[row_ind].val *= 1000.0; | ||
| 131 | - else if(!strstr(data[row_ind][column_ind], "us")) | ||
| 132 | + else if(!strstr(::data[row_ind][column_ind], "us")) | ||
| 133 | arr[row_ind].val *= 1000000.0; // is !us && !ms then secs! | ||
| 134 | } | ||
| 135 | arr[row_ind].pos = row_ind; | ||
| 136 | } | ||
| 137 | - qsort(arr, data.size(), sizeof(ITEM), compar); | ||
| 138 | + qsort(arr, ::data.size(), sizeof(ITEM), compar); | ||
| 139 | int col_count = -1; | ||
| 140 | double min_col = -1.0, max_col = -1.0; | ||
| 141 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 142 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 143 | { | ||
| 144 | // if item is different from previous or if the first row | ||
| 145 | // (sort_ind == 0) then increment col count | ||
| 146 | @@ -310,7 +310,7 @@ void calc_vals() | ||
| 147 | min_col /= mult; | ||
| 148 | } | ||
| 149 | double range_col = max_col - min_col; | ||
| 150 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 151 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 152 | { | ||
| 153 | if(arr[sort_ind].col_ind > -1) | ||
| 154 | { | ||
| 155 | @@ -332,7 +332,7 @@ void calc_vals() | ||
| 156 | } | ||
| 157 | else | ||
| 158 | { | ||
| 159 | - for(unsigned int sort_ind = 0; sort_ind < data.size(); sort_ind++) | ||
| 160 | + for(unsigned int sort_ind = 0; sort_ind < ::data.size(); sort_ind++) | ||
| 161 | { | ||
| 162 | if(vals[column_ind] == eLatency) | ||
| 163 | { | ||
| 164 | @@ -481,16 +481,16 @@ void read_in(CPCCHAR buf) | ||
| 165 | free((void *)arr[0]); | ||
| 166 | return; | ||
| 167 | } | ||
| 168 | - data.push_back(arr); | ||
| 169 | + ::data.push_back(arr); | ||
| 170 | } | ||
| 171 | |||
| 172 | void print_item(int num, int item, CPCCHAR extra) | ||
| 173 | { | ||
| 174 | PCCHAR line_data; | ||
| 175 | char buf[1024]; | ||
| 176 | - if(int(data[num].size()) > item) | ||
| 177 | + if(int(::data[num].size()) > item) | ||
| 178 | { | ||
| 179 | - line_data = data[num][item]; | ||
| 180 | + line_data = ::data[num][item]; | ||
| 181 | switch(item) | ||
| 182 | { | ||
| 183 | case COL_PUT_BLOCK: | ||
diff --git a/meta-oe/recipes-benchmark/bonnie/bonnie++/makefile-use-link-for-helper.patch b/meta-oe/recipes-benchmark/bonnie/bonnie++/makefile-use-link-for-helper.patch new file mode 100644 index 0000000000..21565977a2 --- /dev/null +++ b/meta-oe/recipes-benchmark/bonnie/bonnie++/makefile-use-link-for-helper.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | Upstream-Status: Submitted [https://salsa.debian.org/etbe/bonnie/-/merge_requests/3/diffs?commit_id=f6ce71d9f97316697c55d0fb3c756becdee04c5c] | ||
| 2 | |||
| 3 | diff --git i/Makefile.in w/Makefile.in | ||
| 4 | index 6dfdb75..87a5fb1 100644 | ||
| 5 | --- i/Makefile.in | ||
| 6 | +++ w/Makefile.in | ||
| 7 | @@ -10,7 +10,7 @@ eprefix=@exec_prefix@ | ||
| 8 | 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) | ||
| 9 | CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS) | ||
| 10 | CXX=@CXX@ $(CFLAGS) | ||
| 11 | -LINK=@CXX@ | ||
| 12 | +LINK=$(LINK.cc) | ||
| 13 | THREAD_LFLAGS=@thread_ldflags@ | ||
| 14 | |||
| 15 | INSTALL=@INSTALL@ | ||
| 16 | @@ -43,7 +43,7 @@ getc_putc: $(GETCOBJS) getc_putc_helper | ||
| 17 | $(LINK) -o getc_putc $(GETCOBJS) $(THREAD_LFLAGS) | ||
| 18 | |||
| 19 | getc_putc_helper: $(GETCHOBJS) | ||
| 20 | - $(CXX) -o getc_putc_helper $(GETCHOBJS) | ||
| 21 | + $(LINK) -o getc_putc_helper $(GETCHOBJS) | ||
| 22 | |||
| 23 | bon_csv2html: bon_csv2html.o | ||
| 24 | $(LINK) bon_csv2html.o -o bon_csv2html | ||
diff --git a/meta-oe/recipes-benchmark/bonnie/bonnie++_2.00a.bb b/meta-oe/recipes-benchmark/bonnie/bonnie++_2.00a.bb new file mode 100644 index 0000000000..29590bfe84 --- /dev/null +++ b/meta-oe/recipes-benchmark/bonnie/bonnie++_2.00a.bb | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | SUMMARY = "Tests large file IO and creation/deletion of small files" | ||
| 2 | HOMEPAGE = "https://doc.coker.com.au/projects/bonnie/" | ||
| 3 | SECTION = "benchmark/tests" | ||
| 4 | LICENSE = "GPL-2.0-only" | ||
| 5 | LIC_FILES_CHKSUM = "file://copyright.txt;md5=cd4dde95a6b9d122f0a9150ae9cc3ee0" | ||
| 6 | |||
| 7 | SRC_URI = "\ | ||
| 8 | http://www.coker.com.au/bonnie++/${BPN}-${PV}.tgz \ | ||
| 9 | file://fix-configure-lfs.patch \ | ||
| 10 | file://fix-csv2html-data.patch \ | ||
| 11 | file://makefile-use-link-for-helper.patch \ | ||
| 12 | " | ||
| 13 | SRC_URI[sha256sum] = "a8d33bbd81bc7eb559ce5bf6e584b9b53faea39ccfb4ae92e58f27257e468f0e" | ||
| 14 | |||
| 15 | # force lfs to skip configure's check, because we are cross-building | ||
| 16 | PACKAGECONFIG ?= "lfs" | ||
| 17 | PACKAGECONFIG[lfs] = "--enable-lfs,--disable-lfs" | ||
| 18 | |||
| 19 | inherit autotools | ||
| 20 | |||
| 21 | EXTRA_OECONF += "--disable-stripping" | ||
| 22 | EXTRA_OEMAKE += "-I ${S} VPATH=${S}" | ||
| 23 | CXXFLAGS += "-I ${S}" | ||
| 24 | |||
| 25 | do_install() { | ||
| 26 | oe_runmake eprefix='${D}${exec_prefix}' install-bin | ||
| 27 | } | ||
| 28 | |||
| 29 | PACKAGE_BEFORE_PN += "${PN}-scripts" | ||
| 30 | |||
| 31 | FILES:${PN}-scripts = "${bindir}/bon_csv2*" | ||
| 32 | |||
| 33 | RDEPENDS:${PN}-scripts += "perl" | ||
