hrev48766 adds 1 changeset to branch 'master' old head: 3b8ca9ebdfd1483ab1523df43504a679b91b8c8e new head: 1c646c0bcd776a9f19e5f2a28793c9188088167b overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=1c646c0bcd77+%5E3b8ca9ebdfd1 ---------------------------------------------------------------------------- 1c646c0bcd77: tests/posix: Drop bonnie++, recipe exists and not api test [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev48766 Commit: 1c646c0bcd776a9f19e5f2a28793c9188088167b URL: http://cgit.haiku-os.org/haiku/commit/?id=1c646c0bcd77 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Mon Feb 2 18:21:55 2015 UTC ---------------------------------------------------------------------------- 51 files changed, 10676 deletions(-) src/tests/system/libroot/posix/Jamfile | 1 - .../system/libroot/posix/bonnie++-1.03d/Jamfile | 21 - .../system/libroot/posix/bonnie++-1.03d/Makefile | 57 - .../libroot/posix/bonnie++-1.03d/Makefile.in | 57 - .../libroot/posix/bonnie++-1.03d/bon_csv2html | 101 - .../libroot/posix/bonnie++-1.03d/bon_csv2html.1 | 25 - .../libroot/posix/bonnie++-1.03d/bon_csv2html.in | 101 - .../libroot/posix/bonnie++-1.03d/bon_csv2txt | 98 - .../libroot/posix/bonnie++-1.03d/bon_csv2txt.1 | 1 - .../libroot/posix/bonnie++-1.03d/bon_csv2txt.in | 98 - .../libroot/posix/bonnie++-1.03d/bon_file.cpp | 682 --- .../libroot/posix/bonnie++-1.03d/bon_file.h | 50 - .../libroot/posix/bonnie++-1.03d/bon_io.cpp | 503 -- .../system/libroot/posix/bonnie++-1.03d/bon_io.h | 49 - .../libroot/posix/bonnie++-1.03d/bon_suid.cpp | 83 - .../libroot/posix/bonnie++-1.03d/bon_time.cpp | 406 -- .../libroot/posix/bonnie++-1.03d/bon_time.h | 61 - .../libroot/posix/bonnie++-1.03d/bonnie++.8 | 214 - .../libroot/posix/bonnie++-1.03d/bonnie++.cpp | 689 --- .../libroot/posix/bonnie++-1.03d/bonnie++.spec | 46 - .../posix/bonnie++-1.03d/bonnie++.spec.in | 46 - .../system/libroot/posix/bonnie++-1.03d/bonnie.8 | 1 - .../system/libroot/posix/bonnie++-1.03d/bonnie.h | 64 - .../libroot/posix/bonnie++-1.03d/bonnie.h.in | 64 - .../system/libroot/posix/bonnie++-1.03d/conf.h | 10 - .../libroot/posix/bonnie++-1.03d/conf.h.in | 9 - .../libroot/posix/bonnie++-1.03d/configure | 4897 ------------------ .../libroot/posix/bonnie++-1.03d/configure.in | 78 - .../libroot/posix/bonnie++-1.03d/copyright.txt | 19 - .../libroot/posix/bonnie++-1.03d/credits.txt | 10 - .../posix/bonnie++-1.03d/debian/changelog | 534 -- .../libroot/posix/bonnie++-1.03d/debian/control | 22 - .../posix/bonnie++-1.03d/debian/copyright | 12 - .../libroot/posix/bonnie++-1.03d/debian/dirs | 2 - .../libroot/posix/bonnie++-1.03d/debian/docs | 2 - .../libroot/posix/bonnie++-1.03d/debian/rules | 80 - .../libroot/posix/bonnie++-1.03d/forkit.cpp | 187 - .../system/libroot/posix/bonnie++-1.03d/forkit.h | 52 - .../libroot/posix/bonnie++-1.03d/install.sh | 164 - .../system/libroot/posix/bonnie++-1.03d/port.h | 53 - .../libroot/posix/bonnie++-1.03d/port.h.in | 53 - .../libroot/posix/bonnie++-1.03d/readme.html | 178 - .../libroot/posix/bonnie++-1.03d/semaphore.cpp | 127 - .../libroot/posix/bonnie++-1.03d/semaphore.h | 52 - .../libroot/posix/bonnie++-1.03d/sh.common | 154 - .../libroot/posix/bonnie++-1.03d/sun/Makefile | 17 - .../libroot/posix/bonnie++-1.03d/sun/pkginfo | 9 - .../libroot/posix/bonnie++-1.03d/sun/pkginfo.in | 9 - .../libroot/posix/bonnie++-1.03d/sun/prototype | 16 - .../system/libroot/posix/bonnie++-1.03d/zcav.8 | 95 - .../system/libroot/posix/bonnie++-1.03d/zcav.cpp | 317 -- ---------------------------------------------------------------------------- diff --git a/src/tests/system/libroot/posix/Jamfile b/src/tests/system/libroot/posix/Jamfile index 9b769d3..f93588e 100644 --- a/src/tests/system/libroot/posix/Jamfile +++ b/src/tests/system/libroot/posix/Jamfile @@ -77,6 +77,5 @@ SEARCH on [ FGristFiles syslog.cpp ] = [ FDirName $(HAIKU_TOP) src system libroot posix ] ; -SubInclude HAIKU_TOP src tests system libroot posix bonnie++-1.03d ; SubInclude HAIKU_TOP src tests system libroot posix math ; SubInclude HAIKU_TOP src tests system libroot posix string ; diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/Jamfile b/src/tests/system/libroot/posix/bonnie++-1.03d/Jamfile deleted file mode 100644 index 1bbcca1..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/Jamfile +++ /dev/null @@ -1,21 +0,0 @@ -SubDir HAIKU_TOP src tests system libroot posix bonnie++-1.03d ; - -SimpleTest bonnie++ : - bon_io.cpp - bon_file.cpp - bon_time.cpp - semaphore.cpp - forkit.cpp - bon_suid.cpp - - bonnie++.cpp - : - [ TargetLibsupc++ ] -; - -SimpleTest zcav : - bon_suid.cpp - zcav.cpp - : - [ TargetLibsupc++ ] -; diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile b/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile deleted file mode 100644 index 903b91f..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -EXES=bonnie++ zcav - -all: $(EXES) - -SCRIPTS=bon_csv2html bon_csv2txt - -prefix=/home/rjc/debian/bonnie++-1.03d/debian/bonnie++/usr -eprefix=${prefix} -#MORE_WARNINGS=-Weffc++ -Wcast-align -WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope $(MORE_WARNINGS) -CFLAGS=-O2 -DNDEBUG $(WFLAGS) $(MORECFLAGS) -CXX=g++ $(CFLAGS) - -INSTALL=/usr/bin/install -c -INSTALL_PROGRAM=${INSTALL} - -BONSRC=bon_io.cpp bon_file.cpp bon_time.cpp semaphore.cpp forkit.cpp \ - bon_suid.cpp -BONOBJS=$(BONSRC:.cpp=.o) - -MAN1=bon_csv2html.1 bon_csv2txt.1 -MAN8=bonnie++.8 zcav.8 - -ZCAVSRC=bon_suid.cpp -ZCAVOBJS=$(ZCAVSRC:.cpp=.o) - -ALLOBJS=$(BONOBJS) $(ZCAVOBJS) - -bonnie++: bonnie++.cpp $(BONOBJS) - $(CXX) bonnie++.cpp -o bonnie++ $(BONOBJS) $(LFLAGS) - -zcav: zcav.cpp $(ZCAVOBJS) - $(CXX) zcav.cpp -o zcav $(ZCAVOBJS) $(LFLAGS) - -install-bin: $(EXES) - mkdir -p $(eprefix)/bin $(eprefix)/sbin - ${INSTALL} -s $(EXES) $(eprefix)/sbin - ${INSTALL} $(SCRIPTS) $(eprefix)/bin - -install: install-bin - mkdir -p /home/rjc/debian/bonnie++-1.03d/debian/bonnie++/usr/share/man/man1 /home/rjc/debian/bonnie++-1.03d/debian/bonnie++/usr/share/man/man8 - ${INSTALL} -m 644 $(MAN1) /home/rjc/debian/bonnie++-1.03d/debian/bonnie++/usr/share/man/man1 - ${INSTALL} -m 644 $(MAN8) /home/rjc/debian/bonnie++-1.03d/debian/bonnie++/usr/share/man/man8 - -%.o: %.cpp %.h bonnie.h port.h - $(CXX) -c $< - -bon_suid.o: bon_suid.cpp bonnie.h port.h - $(CXX) -c $< - -clean: - rm -f $(EXES) $(ALLOBJS) build-stamp install-stamp - rm -rf debian/tmp core debian/*.debhelper - rm -f debian/{substvars,files} config.log - -realclean: clean - rm -f config.* Makefile bonnie.h port.h bonnie++.spec bon_csv2html bon_csv2txt sun/pkginfo diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile.in b/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile.in deleted file mode 100644 index 4a174db..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -EXES=@exes@ - -all: $(EXES) - -SCRIPTS=bon_csv2html bon_csv2txt - -prefix=@prefix@ -eprefix=@exec_prefix@ -#MORE_WARNINGS=-Weffc++ -Wcast-align -WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope $(MORE_WARNINGS) -CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS) -CXX=@CXX@ $(CFLAGS) - -INSTALL=@INSTALL@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ - -BONSRC=bon_io.cpp bon_file.cpp bon_time.cpp semaphore.cpp forkit.cpp \ - bon_suid.cpp -BONOBJS=$(BONSRC:.cpp=.o) - -MAN1=bon_csv2html.1 bon_csv2txt.1 -MAN8=@man8@ - -ZCAVSRC=bon_suid.cpp -ZCAVOBJS=$(ZCAVSRC:.cpp=.o) - -ALLOBJS=$(BONOBJS) $(ZCAVOBJS) - -bonnie++: bonnie++.cpp $(BONOBJS) - $(CXX) bonnie++.cpp -o bonnie++ $(BONOBJS) $(LFLAGS) - -zcav: zcav.cpp $(ZCAVOBJS) - $(CXX) zcav.cpp -o zcav $(ZCAVOBJS) $(LFLAGS) - -install-bin: $(EXES) - mkdir -p $(eprefix)/bin $(eprefix)/sbin - @INSTALL_PROGRAM@ @stripping@ $(EXES) $(eprefix)/sbin - @INSTALL_SCRIPT@ $(SCRIPTS) $(eprefix)/bin - -install: install-bin - mkdir -p @mandir@/man1 @mandir@/man8 - @INSTALL_DATA@ $(MAN1) @mandir@/man1 - @INSTALL_DATA@ $(MAN8) @mandir@/man8 - -%.o: %.cpp %.h bonnie.h port.h - $(CXX) -c $< - -bon_suid.o: bon_suid.cpp bonnie.h port.h - $(CXX) -c $< - -clean: - rm -f $(EXES) $(ALLOBJS) build-stamp install-stamp - rm -rf debian/tmp core debian/*.debhelper - rm -f debian/{substvars,files} config.log - -realclean: clean - rm -f config.* Makefile bonnie.h port.h bonnie++.spec bon_csv2html bon_csv2txt sun/pkginfo diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html deleted file mode 100644 index c69cf07..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/perl - -{ - header(); - my $line; - while($line = <STDIN>) - { - while($line =~ /^name,/) - { - $line = <STDIN>; - } - process($line); - } - footer(); -} - -sub header -{ - print <<END; -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd";> -<HTML> -<HEAD><TITLE>Bonnie++ V1.03d Benchmark results</TITLE> -<STYLE type="text/css"> -TD.header {text-align: center; backgroundcolor: "#CCFFFF" } -TD.rowheader {text-align: center; backgroundcolor: "#CCCFFF" } -TD.size {text-align: center; backgroundcolor: "#CCCFFF" } -TD.ksec {text-align: center; fontstyle: italic } -</STYLE> -<BODY> -<TABLE ALIGN=center BORDER=3 CELLPADDING=2 CELLSPACING=1> -<TR><TD COLSPAN=2 class="header"></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Output</B></FONT></TD> -<TD COLSPAN=4 class="header"><FONT SIZE=+2><B>Sequential Input</B></FONT></TD> -<TD COLSPAN=2 ROWSPAN=2 class="header"><FONT SIZE=+2><B>Random<BR>Seeks</B></FONT></TD> -<TD COLSPAN=1 class="header"></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Create</B></FONT></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Random Create</B></FONT></TD> -</tr> -END - print "<TR><TD></TD>"; - print "<TD>Size:Chunk Size</TD>"; - heading("Per Char"); heading("Block"); heading("Rewrite"); - heading("Per Char"); heading("Block"); - print "<TD>Num Files</TD>"; - heading("Create"); heading("Read"); heading("Delete"); - heading("Create"); heading("Read"); heading("Delete"); - print "</TR>"; - - print "<TR><TD COLSPAN=2></TD>"; - my $i; - - for($i = 0; $i < 5; $i++) - { - print '<TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - } - print '<TD class="ksec"><FONT SIZE=-2>/ sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - print "<TD></TD>"; - for($i = 0; $i < 6; $i++) - { - print '<TD class="ksec"><FONT SIZE=-2>/ sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - } - print "</TR>\n"; -} - -sub heading -{ - my($item) = @_; - print "<TD COLSPAN=2>" . $item . "</TD>"; -} - -sub footer -{ - print <<END; -</TABLE> -</BODY> -</HTML> -END -} - -sub process -{ - my($line) = @_; - - chop($line); - my $name = $line; - $name =~ s/,.*$//; - $line =~ s/$name,//; - my $size = $line; - $size =~ s/,.*$//; - $line =~ s/$size,//; - print '<TR><TD class="rowheader"><FONT SIZE=+1><B>' - . $name . "</B></FONT></TD>"; - print '<TD class="size">' . $size . "</TD>"; - - - $line =~ s/,/<\/TD><TD>/g; - print "<TD>" . $line . "</TD></TR>\n"; -} diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.1 b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.1 deleted file mode 100644 index bd76d6a..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.1 +++ /dev/null @@ -1,25 +0,0 @@ -.TH bon_csv2html 1 -.SH "NAME" -.BR bon_csv2html -program to convert CSV format Bonnie++ data to a HTML form -using tables suitable for display on a web page. NB Lynx can't display this -properly, and due to the size it probably requires 1024x768 monitor to display -properly. -.P -.BR bon_csv2txt -program to convert CSV format Bonnie++ data to plain\-text format -suitable for pasting into an email or reading on a Braille display. - -.SH "DESCRIPTION" -They take CSV format (comma\-delimited spreadsheet files AKA Comma Seperated -Values in MS land) data on standard input and produce HTML or plain text on -standard output respectively. - -.SH "AUTHOR" -These programs were written by Russell Coker <russell@xxxxxxxxxxxx>. May be -freely used and distributed without restriction. - -.SH "AVAILABILITY" -The source is available from http://www.coker.com.au/bonnie++ . -.P -See http://etbe.coker.com.au/category/benchmark for further information. diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.in b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.in deleted file mode 100755 index 184ef0a..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2html.in +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/perl - -{ - header(); - my $line; - while($line = <STDIN>) - { - while($line =~ /^name,/) - { - $line = <STDIN>; - } - process($line); - } - footer(); -} - -sub header -{ - print <<END; -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd";> -<HTML> -<HEAD><TITLE>Bonnie++ V@version@ Benchmark results</TITLE> -<STYLE type="text/css"> -TD.header {text-align: center; backgroundcolor: "#CCFFFF" } -TD.rowheader {text-align: center; backgroundcolor: "#CCCFFF" } -TD.size {text-align: center; backgroundcolor: "#CCCFFF" } -TD.ksec {text-align: center; fontstyle: italic } -</STYLE> -<BODY> -<TABLE ALIGN=center BORDER=3 CELLPADDING=2 CELLSPACING=1> -<TR><TD COLSPAN=2 class="header"></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Output</B></FONT></TD> -<TD COLSPAN=4 class="header"><FONT SIZE=+2><B>Sequential Input</B></FONT></TD> -<TD COLSPAN=2 ROWSPAN=2 class="header"><FONT SIZE=+2><B>Random<BR>Seeks</B></FONT></TD> -<TD COLSPAN=1 class="header"></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Create</B></FONT></TD> -<TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Random Create</B></FONT></TD> -</tr> -END - print "<TR><TD></TD>"; - print "<TD>Size:Chunk Size</TD>"; - heading("Per Char"); heading("Block"); heading("Rewrite"); - heading("Per Char"); heading("Block"); - print "<TD>Num Files</TD>"; - heading("Create"); heading("Read"); heading("Delete"); - heading("Create"); heading("Read"); heading("Delete"); - print "</TR>"; - - print "<TR><TD COLSPAN=2></TD>"; - my $i; - - for($i = 0; $i < 5; $i++) - { - print '<TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - } - print '<TD class="ksec"><FONT SIZE=-2>/ sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - print "<TD></TD>"; - for($i = 0; $i < 6; $i++) - { - print '<TD class="ksec"><FONT SIZE=-2>/ sec</FONT></TD>' - . '<TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD>'; - } - print "</TR>\n"; -} - -sub heading -{ - my($item) = @_; - print "<TD COLSPAN=2>" . $item . "</TD>"; -} - -sub footer -{ - print <<END; -</TABLE> -</BODY> -</HTML> -END -} - -sub process -{ - my($line) = @_; - - chop($line); - my $name = $line; - $name =~ s/,.*$//; - $line =~ s/$name,//; - my $size = $line; - $size =~ s/,.*$//; - $line =~ s/$size,//; - print '<TR><TD class="rowheader"><FONT SIZE=+1><B>' - . $name . "</B></FONT></TD>"; - print '<TD class="size">' . $size . "</TD>"; - - - $line =~ s/,/<\/TD><TD>/g; - print "<TD>" . $line . "</TD></TR>\n"; -} diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt deleted file mode 100644 index 7f4d7df..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/perl - -{ - my $line; - $iocount = 0; - $filecount = 0; - while($line = <STDIN>) - { - while($line =~ /^name,/) - { - $line = <STDIN>; - } - process($line); - } - printIOData(); - - printFileData(); -} - -sub IOHeader -{ - my $version = '1.03d'; -print "Version $version ------Sequential Output------ --Sequential Input- --Random-\n"; -print " -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--\n"; -print "Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP\n"; -} - -sub FileHeader -{ -print " ------Sequential Create------ --------Random Create--------\n"; -print " -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--\n"; -print "files:max:min /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP\n"; -} - -sub process -{ - my($line) = @_; - - chop($line); - my $name = $line; - $name =~ s/,.*$//; - $line =~ s/$name,//; - -# $ioline contains the file-IO data, IE we strip off the data on file creation - my $ioline = $line; - $ioline =~ s/,[:0-9\-\+.\/]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+$//; - $ioline =~ s/,,,,,,,,,,,,,$//; - if(join('', split(/,/,$ioline)) != "") - { - $io[$iocount] = $name . "," . $ioline; - $iocount++; - } -# $fileline contains the file creation data - everything but $ioline - my $fileline = substr($line, length($ioline)); - if(join('', split(/,/,$fileline)) != "") - { - $file[$filecount] = $name . $fileline; - $filecount++; - } -} - -sub printFileData -{ - if($filecount < 1){ return; } - FileHeader(); - for($i = 0; $i < $filecount; $i++) - { - @arr = split(/,/,$file[$i]); - my $size = $arr[1]; - $size =~ s/:0:0:/\//; - my $desc = $arr[0] . " "; - $desc = substr($desc, 0, 18 - length($size) ); - $desc .= " " . $size; - printf(STDOUT "%19s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s\n" - , $desc, $arr[2], $arr[3], $arr[4], $arr[5], $arr[6], $arr[7] - , $arr[8], $arr[9], $arr[10], $arr[11], $arr[12], $arr[13] - , $arr[14], $arr[15]); - } -} - -sub printIOData -{ - if($iocount < 1){ return; } - IOHeader(); - for($i = 0; $i < $iocount; $i++) - { - @arr = split(/,/,$io[$i]); - my $size = $arr[1]; - my $desc = $arr[0] . " "; - $desc = substr($desc, 0, 18 - length($size) ); - $desc .= " " . $size; - printf(STDOUT "%19s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s\n" - , $desc, $arr[2], $arr[3], $arr[4], $arr[5], $arr[6], $arr[7] - , $arr[8], $arr[9], $arr[10], $arr[11], $arr[12], $arr[13] - , $arr[14], $arr[15]); - } -} - diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.1 b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.1 deleted file mode 100644 index 94d640f..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.1 +++ /dev/null @@ -1 +0,0 @@ -.so man1/bon_csv2html.1 diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.in b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.in deleted file mode 100755 index 5bd0a95..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_csv2txt.in +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/perl - -{ - my $line; - $iocount = 0; - $filecount = 0; - while($line = <STDIN>) - { - while($line =~ /^name,/) - { - $line = <STDIN>; - } - process($line); - } - printIOData(); - - printFileData(); -} - -sub IOHeader -{ - my $version = '@version@'; -print "Version $version ------Sequential Output------ --Sequential Input- --Random-\n"; -print " -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--\n"; -print "Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP\n"; -} - -sub FileHeader -{ -print " ------Sequential Create------ --------Random Create--------\n"; -print " -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--\n"; -print "files:max:min /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP\n"; -} - -sub process -{ - my($line) = @_; - - chop($line); - my $name = $line; - $name =~ s/,.*$//; - $line =~ s/$name,//; - -# $ioline contains the file-IO data, IE we strip off the data on file creation - my $ioline = $line; - $ioline =~ s/,[:0-9\-\+.\/]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+,[0-9\+.]+$//; - $ioline =~ s/,,,,,,,,,,,,,$//; - if(join('', split(/,/,$ioline)) != "") - { - $io[$iocount] = $name . "," . $ioline; - $iocount++; - } -# $fileline contains the file creation data - everything but $ioline - my $fileline = substr($line, length($ioline)); - if(join('', split(/,/,$fileline)) != "") - { - $file[$filecount] = $name . $fileline; - $filecount++; - } -} - -sub printFileData -{ - if($filecount < 1){ return; } - FileHeader(); - for($i = 0; $i < $filecount; $i++) - { - @arr = split(/,/,$file[$i]); - my $size = $arr[1]; - $size =~ s/:0:0:/\//; - my $desc = $arr[0] . " "; - $desc = substr($desc, 0, 18 - length($size) ); - $desc .= " " . $size; - printf(STDOUT "%19s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s\n" - , $desc, $arr[2], $arr[3], $arr[4], $arr[5], $arr[6], $arr[7] - , $arr[8], $arr[9], $arr[10], $arr[11], $arr[12], $arr[13] - , $arr[14], $arr[15]); - } -} - -sub printIOData -{ - if($iocount < 1){ return; } - IOHeader(); - for($i = 0; $i < $iocount; $i++) - { - @arr = split(/,/,$io[$i]); - my $size = $arr[1]; - my $desc = $arr[0] . " "; - $desc = substr($desc, 0, 18 - length($size) ); - $desc .= " " . $size; - printf(STDOUT "%19s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s %5s %3s\n" - , $desc, $arr[2], $arr[3], $arr[4], $arr[5], $arr[6], $arr[7] - , $arr[8], $arr[9], $arr[10], $arr[11], $arr[12], $arr[13] - , $arr[14], $arr[15]); - } -} - diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.cpp b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.cpp deleted file mode 100644 index cf63061..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.cpp +++ /dev/null @@ -1,682 +0,0 @@ -#include <fcntl.h> -#include <sys/types.h> -#ifdef OS2 -#define INCL_DOSFILEMGR -#include <os2.h> -#else -#include <dirent.h> -#include <unistd.h> -#endif -#include <string.h> -#include <stdlib.h> -#include <sys/stat.h> - -#include "bon_file.h" -#include "bon_time.h" - -CPCCHAR rand_chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - - -COpenTest::COpenTest(int chunk_size, bool use_sync, bool *doExit) - : m_chunk_size(chunk_size) - , m_number(0) - , m_number_directories(1) - , m_max(0) - , m_min(0) - , m_size_range(0) - , m_dirname(NULL) - , m_file_name_buf(NULL) - , m_file_names(NULL) - , m_sync(use_sync) - , m_directoryHandles(NULL) - , m_dirIndex(NULL) - , m_buf(new char[m_chunk_size]) - , m_exit(doExit) - , m_sync_dir(true) -{ -} - -void COpenTest::random_sort() -{ - for(int i = 0; i < m_number; i++) - { - char *tmp = m_file_names[i]; - int newind = rand() % m_number; - m_file_names[i] = m_file_names[newind]; - m_file_names[newind] = tmp; - if(m_dirIndex) - { - int tmpInd = m_dirIndex[i]; - m_dirIndex[i] = m_dirIndex[newind]; - m_dirIndex[newind] = tmpInd; - } - if(*m_exit) return; - } -} - -COpenTest::~COpenTest() -{ - int i; - if(m_dirname) - { - fprintf(stderr, "Cleaning up test directory after error.\n"); - if(m_file_names) - { - for(i = 0; i < m_number; i++) - unlink(m_file_names[i]); - } - if(m_number_directories > 1) - { - char buf[6]; - for(i = 0; i < m_number_directories; i++) - { - sprintf(buf, "%05d", i); - if(rmdir(buf)) - io_error("rmdir"); - } - } - if(chdir("..") || rmdir(m_dirname)) - io_error("rmdir"); - delete m_dirname; - } - if(m_directoryHandles) - { - for(i = 0; i < m_number_directories; i++) - close(m_directoryHandles[i]); - delete m_directoryHandles; - } - delete m_file_name_buf; - delete m_file_names; - delete m_dirIndex; - delete m_buf; -} - -void COpenTest::make_names(bool do_random) -{ - delete m_file_name_buf; - delete m_file_names; - int names_per_directory = m_number / m_number_directories; - int names_in_dir = 0; - int directory_num = 0; - if(!m_dirIndex && m_sync) - m_dirIndex = new int[m_number]; - if(m_number_directories == 1) - { - m_file_name_buf = new char[(MaxNameLen + 1) * m_number]; - } - else - { - m_file_name_buf = new char[(MaxNameLen + 1 + 6) * m_number]; - } - m_file_names = new PCHAR[m_number]; - PCHAR buf = m_file_name_buf; - for(int i = 0; i < m_number; i++) - { - if(*m_exit) - { - delete m_file_names; - m_file_names = NULL; - return; - } - char rand_buf[RandExtraLen + 1]; - int len = rand() % (RandExtraLen + 1); - int j; - for(j = 0; j < len; j++) - { - rand_buf[j] = rand_chars[rand() % strlen(rand_chars)]; - } - rand_buf[j] = '\0'; - m_file_names[i] = buf; - if(m_number_directories != 1) - { - sprintf(buf, "%05d/", directory_num); - buf += strlen(buf); - } - if(m_sync) - m_dirIndex[i] = directory_num; - names_in_dir++; - if(names_in_dir > names_per_directory) - { - names_in_dir = 0; - directory_num++; - } - if(do_random) - { - sprintf(buf, "%s%07d", rand_buf, i); - } - else - { - sprintf(buf, "%07d%s", i, rand_buf); - } - buf += strlen(buf) + 1; - } -} - -int COpenTest::create_a_file(const char *filename, char *buf, int size, int dir) -{ - FILE_TYPE fd = 0; -#ifdef OS2 - ULONG action = 0; - ULONG rc = DosOpen(filename, &fd, &action, 0, FILE_NORMAL - , OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS - , OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE - , NULL); -#else - fd = creat(filename, S_IRUSR | S_IWUSR); -#endif - if(fd == -1) - { - fprintf(stderr, "Can't create file %s\n", filename); - return -1; - } - if(m_max) - { - for(int i = 0; i < size; i += m_chunk_size) - { - int to_write = size - i; - if(to_write > m_chunk_size) to_write = m_chunk_size; -#ifdef OS2 - ULONG actual = 0; - if(DosWrite(fd, PVOID(buf), to_write, &actual)) - { - fprintf(stderr, "Can't write data.\n"); - return -1; - } -#else - if(to_write != write(fd, static_cast<void *>(buf), to_write)) - { - fprintf(stderr, "Can't write data.\n"); - return -1; - } -#endif - } - } - if(m_sync) - { - if(fsync(fd)) - { - fprintf(stderr, "Can't sync file.\n"); - return -1; - } - if(m_sync_dir && fsync(m_directoryHandles[dir])) - { - fprintf(stderr, "Can't sync directory, turning off dir-sync.\n"); - m_sync_dir = false; - } - } - file_close(fd); - return 0; -} - -int COpenTest::create_a_link(const char *original, const char *filename, int dir) -{ -#ifdef OS2 - fprintf(stderr, "Not supported on OS/2\n"); - return -1; -#else - if(m_max == -1) - { - if(link(original, filename)) - { - fprintf(stderr, "Can't create link %s\n", filename); - return -1; - } - if(m_sync) - { - if(fsync(m_directoryHandles[dir])) - { - fprintf(stderr, "Can't sync file.\n"); - return -1; - } - } - } - else - { - if(symlink(original, filename)) - { - fprintf(stderr, "Can't create symlink %s\n", filename); - return -1; - } - if(m_sync) - { - if(fsync(m_directoryHandles[dir])) - { - fprintf(stderr, "Can't sync file.\n"); - return -1; - } - } - } - return 0; -#endif -} - -int COpenTest::create(CPCCHAR dirname, BonTimer &timer, int num, int max_size - , int min_size, int num_directories, bool do_random) -{ - if(num_directories >= 100000) - { - fprintf(stderr, "Can't have more than 99,999 directories.\n"); - return -1; - } - - m_number = num * DirectoryUnit; - m_number_directories = num_directories; - make_names(do_random); - m_max = max_size; - m_min = min_size; - m_size_range = m_max - m_min; - m_dirname = new char[strlen(dirname) + 1]; - strcpy(m_dirname, dirname); - - if(make_directory(dirname)) - { - fprintf(stderr, "Can't make directory %s\n", dirname); - return -1; - } - if(chdir(dirname)) - { - fprintf(stderr, "Can't change to directory %s\n", dirname); - return -1; - } - int i; - if(m_sync) - m_directoryHandles = new FILE_TYPE[num_directories]; - if(num_directories > 1) - { - for(i = 0; i < num_directories; i++) - { - sprintf(m_buf, "%05d", i); - if(make_directory(m_buf)) - { - fprintf(stderr, "Can't make directory %s\n", m_buf); - return -1; - } - if(m_sync) - { - m_directoryHandles[i] = open(m_buf, O_RDONLY); - if(m_directoryHandles[i] == -1) - { - fprintf(stderr, "Can't get directory handle.\n"); - return -1; - } - } - } - } - else if(m_sync) - { - m_directoryHandles[0] = open(".", O_RDONLY); - if(m_directoryHandles[0] == -1) - { - fprintf(stderr, "Can't get directory handle.\n"); - return -1; - } - } - - timer.timestamp(); - for(i = 0; i < m_number; i++) - { - if(*m_exit) - { - return EXIT_CTRL_C; - } - // m_max < 0 means link or sym-link - if(m_max < 0) - { - if(i == 0) - { - if(create_a_file(m_file_names[0], m_buf, 0, m_dirIndex ? m_dirIndex[0] : 0)) - return -1; - } - else - { - // create_a_link() looks at m_max to see what to do - if(create_a_link(m_file_names[0], m_file_names[i], m_dirIndex ? m_dirIndex[i] : 0)) - return -1; - } - } - else - { - int size; - if(m_size_range) - size = m_min + (rand() % (m_size_range + 1)); - else - size = m_max; - if(create_a_file(m_file_names[i], m_buf, size, m_dirIndex ? m_dirIndex[i] : 0)) - return -1; - } - } - timer.get_delta_t(do_random ? CreateRand : CreateSeq); - return 0; -} - -int COpenTest::delete_random(BonTimer &timer) -{ - random_sort(); - timer.timestamp(); - int i; - for(i = 0; i < m_number; i++) - { - if(unlink(m_file_names[i])) - { - fprintf(stderr, "Can't delete file %s\n", m_file_names[i]); - return -1; - } - if(m_sync && m_sync_dir) - { - if(fsync(m_directoryHandles[m_dirIndex[i]])) - { - fprintf(stderr, "Can't sync directory, turning off dir-sync.\n"); - m_sync_dir = false; - } - } - } - if(m_number_directories > 1) - { - char buf[6]; - for(i = 0; i < m_number_directories; i++) - { - sprintf(buf, "%05d", i); - if(m_sync) - { - close(m_directoryHandles[i]); - } - if(rmdir(buf)) - { - io_error("rmdir"); - return -1; - } - } - } - else - { - if(m_sync) - { - close(m_directoryHandles[0]); - } - } - if(chdir("..") || rmdir(m_dirname)) - { - io_error("rmdir"); - return -1; - } - delete m_dirname; - m_dirname = NULL; - timer.get_delta_t(DelRand); - return 0; -} - -int COpenTest::delete_sequential(BonTimer &timer) -{ - timer.timestamp(); - int count = 0; - for(int i = 0; i < m_number_directories; i++) - { - char buf[6]; - if(m_number_directories != 1) - { - sprintf(buf, "%05d", i); - if(chdir(buf)) - { - fprintf(stderr, "Can't change to directory %s\n", buf); - return -1; - } - } -#ifdef OS2 - HDIR d = 0; - ULONG entries = 1; - FILEFINDBUF3 findBuf; - ULONG rc = DosFindFirst("*", &d - , FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN | FILE_READONLY - , &findBuf, sizeof(findBuf), &entries, FIL_STANDARD); - if(rc || !entries) - { - fprintf(stderr, "Can't open directory.\n"); - return -1; - } - do - { - if(unlink(findBuf.achName)) - { - fprintf(stderr, "Can't delete file %s\n", findBuf.achName); - DosFindClose(d); - return -1; - } - count++; - rc = DosFindNext(d, &findBuf, sizeof(findBuf), &entries); - } while(!rc && entries == 1); - DosFindClose(d); -#else - DIR *d = opendir("."); - if(!d) - { - fprintf(stderr, "Can't open directory.\n"); - return -1; - } - dirent *file_ent; - - while((file_ent = readdir(d)) != NULL) - { - if(file_ent->d_name[0] != '.') - { - if(unlink(file_ent->d_name)) - { - fprintf(stderr, "Can't delete file %s\n", file_ent->d_name); - return -1; - } - - - if(m_sync && m_sync_dir) - { - if(fsync(m_directoryHandles[i])) - { - fprintf(stderr, "Can't sync directory, turning off dir-sync.\n"); - m_sync_dir = false; - } - } - count++; - } - } - closedir(d); -#endif - if(m_sync) - { - close(m_directoryHandles[i]); - } - if(m_number_directories != 1) - { - if(chdir("..") || rmdir(buf)) - { - io_error("rmdir"); - return -1; - } - } - } - if(chdir("..") || rmdir(m_dirname)) - { - io_error("rmdir"); - return -1; - } - delete m_dirname; - m_dirname = NULL; - if(count != m_number) - { - fprintf(stderr, "Expected %d files but only got %d\n", m_number, count); - return -1; - } - timer.get_delta_t(DelSeq); - return 0; -} - -int COpenTest::stat_file(CPCCHAR file) -{ - struct stat st; - if(stat(file, &st)) - { - fprintf(stderr, "Can't stat file %s\n", file); - return -1; - } - if(st.st_size) - { - FILE_TYPE fd = 0; -#ifdef OS2 - ULONG action = 0; - ULONG rc = DosOpen(file, &fd, &action, 0, FILE_NORMAL - , OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS - , OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE - , NULL); - if(rc) - fd = -1; -#else - fd = open(file, O_RDONLY); -#endif - if(fd == -1) - { - fprintf(stderr, "Can't open file %s\n", file); - return -1; - } - for(int i = 0; i < st.st_size; i += m_chunk_size) - { - int to_read = st.st_size - i; - if(to_read > m_chunk_size) to_read = m_chunk_size; -#ifdef OS2 - ULONG actual = 0; - rc = DosRead(fd, PVOID(m_buf), to_read, &actual); - if(to_read != actual || rc) -#else - if(to_read != read(fd, static_cast<void *>(m_buf), to_read)) -#endif - { - fprintf(stderr, "Can't read data.\n"); - return -1; - } - } - file_close(fd); - } - return 0; -} - -int COpenTest::stat_random(BonTimer &timer) -{ - random_sort(); - timer.timestamp(); - - int i; - for(i = 0; i < m_number; i++) - { - if(-1 == stat_file(m_file_names[i])) - return -1; - } - timer.get_delta_t(StatRand); - return 0; -} - -int COpenTest::stat_sequential(BonTimer &timer) -{ - timer.timestamp(); - int count = 0; - for(int i = 0; i < m_number_directories; i++) - { - char buf[6]; - if(m_number_directories != 1) - { - sprintf(buf, "%05d", i); - if(chdir(buf)) - { - fprintf(stderr, "Can't change to directory %s\n", buf); - return -1; - } - } -#ifdef OS2 - HDIR d = 0; - ULONG entries = 1; - FILEFINDBUF3 findBuf; - ULONG rc = DosFindFirst("*", &d - , FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN | FILE_READONLY - , &findBuf, sizeof(findBuf), &entries, FIL_STANDARD); - if(rc || !entries) - { - fprintf(stderr, "Can't open directory.\n"); - if(m_number_directories != 1) - { - if(chdir("..")) - fprintf(stderr, "Can't chdir().\n"); - } - return -1; - } - do - { - if(*m_exit) - { - return EXIT_CTRL_C; - } - if(findBuf.achName[0] != '.') // our files do not start with a dot - { - if(-1 == stat_file(findBuf.achName)) - { - if(m_number_directories != 1) - { - if(chdir("..")) - fprintf(stderr, "Can't chdir().\n"); - } - return -1; - } - count++; - } - rc = DosFindNext(d, &findBuf, sizeof(findBuf), &entries); - } while(!rc && entries == 1); - DosFindClose(d); -#else - DIR *d = opendir("."); - if(!d) - { - fprintf(stderr, "Can't open directory.\n"); - if(m_number_directories != 1) - { - if(chdir("..")) - fprintf(stderr, "Can't chdir().\n"); - } - return -1; - } - dirent *file_ent; - while((file_ent = readdir(d)) != NULL) - { - if(*m_exit) - { - if(m_number_directories != 1 && chdir("..")) - { - fprintf(stderr, "Can't change to directory ..\n"); - return -1; - } - return EXIT_CTRL_C; - } - if(file_ent->d_name[0] != '.') // our files do not start with a dot - { - if(-1 == stat_file(file_ent->d_name)) - { - if(m_number_directories != 1) - { - if(chdir("..")) - fprintf(stderr, "Can't chdir().\n"); - } - return -1; - } - count++; - } - } - closedir(d); -#endif - if(m_number_directories != 1 && chdir("..")) - { - fprintf(stderr, "Can't change to directory ..\n"); - return -1; - } - } - if(count != m_number) - { - fprintf(stderr, "Expected %d files but only got %d\n", m_number, count); - return -1; - } - timer.get_delta_t(StatSeq); - return 0; -} - diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.h b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.h deleted file mode 100644 index 2d8f213..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_file.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef BON_IO -#define BON_IO - -#include "bonnie.h" -class BonTimer; - -typedef unsigned long MASK_TYPE; - -class COpenTest -{ -public: - COpenTest(int chunk_size, bool use_sync, bool *doExit); - ~COpenTest(); - - int create(CPCCHAR dirname, BonTimer &timer, int num, int max_size - , int min_size, int num_directories, bool do_random); - int delete_random(BonTimer &timer); - int delete_sequential(BonTimer &timer); - int stat_random(BonTimer &timer); - int stat_sequential(BonTimer &timer); - -private: - void make_names(bool do_random); - int stat_file(CPCCHAR file); - int create_a_file(const char *filename, char *buf, int size, int dir); - int create_a_link(const char *original, const char *filename, int dir); - - const int m_chunk_size; - int m_number; // the total number of files to create - int m_number_directories; // the number of directories to store files in - int m_max; // maximum file size (negative for links) - int m_min; // minimum file size - int m_size_range; // m_max - m_min - char *m_dirname; // name of the master directory - char *m_file_name_buf; // buffer to store all file names - char **m_file_names; // pointer to entries in m_file_name_buf - bool m_sync; // do we sync after every significant operation? - FILE_TYPE *m_directoryHandles; // handles to the directories for m_sync - int *m_dirIndex; // which directory we are in - char *m_buf; - bool *m_exit; - bool m_sync_dir; - - void random_sort(); - - COpenTest(const COpenTest &t); - COpenTest & operator =(const COpenTest &t); -}; - -#endif diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.cpp b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.cpp deleted file mode 100644 index b4c4542..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.cpp +++ /dev/null @@ -1,503 +0,0 @@ -#include <fcntl.h> -#include <sys/types.h> -#ifdef OS2 -#define INCL_DOSPROCESS -#define INCL_DOSFILEMGR -#include <os2.h> -#else -#include <dirent.h> -#include <unistd.h> -#include <sys/wait.h> -#endif -#include <stdlib.h> -#include <sys/stat.h> -#include <string.h> - -#include "bonnie.h" -#include "bon_io.h" -#include "semaphore.h" -#include "bon_time.h" - -#include "forkit.h" - -CFileOp::~CFileOp() -{ - close(); - if(m_name) - { - int len = strlen(m_name); - for(int i = 0; i < m_num_files; i++) - { - sprintf(&m_name[len], ".%03d", i); - unlink(m_name); - } - delete m_name; - } - delete m_buf; -} - -void seeker(Fork *f, PVOID param, int) -{ - struct report_s seeker_report; - CFileOp *file = (CFileOp *)param; - int num_chunks = file->chunks(); - if(file->reopen(false)) - exit(1); - char ticket; - int rc; - int lseek_count = 0; - - rc = f->Read(&ticket, 1, 0); - - file->getTimer().timestamp(); - seeker_report.StartTime = file->getTimer().get_cur_time(); - - if(rc == 1 && ticket) do - { - bool update; - if( (lseek_count++ % UpdateSeek) == 0) - update = true; - else - update = false; - if(file->doseek(rand() % num_chunks, update) ) - exit(1); - } - while((rc = f->Read(&ticket, 1, 0)) == 1 && ticket); - - if(rc != 1) - { - fprintf(stderr, "Can't read ticket.\n"); - exit(1); - } - file->close(); - file->getTimer().get_delta_report(seeker_report); - if(f->Write(&seeker_report, sizeof(seeker_report)) != sizeof(seeker_report)) - { - fprintf(stderr, "Can't write report.\n"); - exit(1); - } -} - -int CFileOp::seek_test(bool quiet, Semaphore &s) -{ - char seek_tickets[SeekProcCount + Seeks]; - int next; - for (next = 0; next < Seeks; next++) - seek_tickets[next] = 1; - for ( ; next < (Seeks + SeekProcCount); next++) - seek_tickets[next] = 0; - Fork f; - f.go(seeker, this, SeekProcCount); - - sleep(5); - if(s.decrement_and_wait(Lseek)) - return 1; - if(!quiet) fprintf(stderr, "start 'em..."); - if(f.Write(seek_tickets, sizeof(seek_tickets)) != int(sizeof(seek_tickets)) ) - { - fprintf(stderr, "Can't write tickets.\n"); - return 1; - } - for (next = 0; next < SeekProcCount; next++) - { /* for each child */ - struct report_s seeker_report; - - int rc; - if((rc = f.Read(&seeker_report, sizeof(seeker_report), 0)) - != sizeof(seeker_report)) - { - fprintf(stderr, "Can't read from pipe, expected %d, got %d.\n" - , int(sizeof(seeker_report)), rc); - return 1; - } - - /* - * each child writes back its CPU, start & end times. The elapsed time - * to do all the seeks is the time the first child started until the - * time the last child stopped - */ - m_timer.add_delta_report(seeker_report, Lseek); -#ifdef OS2 - TID status = 0; - if(DosWaitThread(&status, DCWW_WAIT)) -#else - int status = 0; - if(wait(&status) == -1) -#endif - return io_error("wait"); - if(!quiet) fprintf(stderr, "done..."); - } /* for each child */ - if(!quiet) fprintf(stderr, "\n"); - return 0; -} - -int CFileOp::seek(int offset, int whence) -{ - switch(whence) - { - case SEEK_SET: - m_file_ind = offset / m_chunks_per_file; - m_cur_pos = offset % m_chunks_per_file; - break; - case SEEK_CUR: - m_cur_pos += offset; - while(m_cur_pos < 0) - { - m_file_ind--; - m_cur_pos += m_chunks_per_file; - } - while(m_cur_pos >= m_chunks_per_file) - { - m_file_ind++; - m_cur_pos -= m_chunks_per_file; - } - break; - default: - fprintf(stderr, "unsupported seek option\n"); - return -1; - } - if(m_file_ind == m_num_files) - { - m_file_ind--; - m_cur_pos += m_chunks_per_file; - } - else - { - if(m_file_ind < 0 || m_file_ind >= m_num_files - || (m_file_ind == m_num_files - 1 && m_cur_pos >= m_last_file_chunks)) - { - fprintf(stderr, "Bad seek offset\n"); - return -1; - } - off_t rc; - if(m_fd) - { -#ifdef OS2 - unsigned long actual; - rc = DosSetFilePtr(m_fd[m_file_ind], m_cur_pos << m_chunk_bits, FILE_BEGIN, &actual); - if(rc != 0) rc = -1; -#else - rc = lseek(m_fd[m_file_ind], m_cur_pos << m_chunk_bits, SEEK_SET); -#endif - } - else - { - rc = fseek(m_stream[m_file_ind], m_cur_pos << m_chunk_bits, SEEK_SET); - } - - if(rc == off_t(-1)) - fprintf(stderr, "Error in lseek to %d\n", (m_cur_pos << m_chunk_bits)); - else - rc = 0; - return rc; - } - return 0; -} - -int CFileOp::read_block(PVOID buf) -{ - int total = 0; - bool printed_error = false; - while(total != m_chunk_size) - { -#ifdef OS2 - unsigned long actual; - int rc = DosRead(m_fd[m_file_ind], buf, m_chunk_size - total - , &actual); - if(rc) - rc = -1; - else - rc = actual; -#else - int rc = ::read(m_fd[m_file_ind], buf, m_chunk_size - total); -#endif - m_cur_pos++; - if(m_cur_pos >= m_chunks_per_file) - { - if(seek(0, SEEK_CUR) == -1) - { - fprintf(stderr, "Error in seek(0)\n"); - return -1; - } - } - if(rc == -1) - { - io_error("re-write read"); // exits program - } - else if(rc != m_chunk_size && !printed_error) - { - fprintf(stderr, "Can't read a full block, only got %d bytes.\n", rc); - printed_error = true; - } - total += rc; - } - return total; -} - -int CFileOp::read_block_getc(char *buf) -{ - int next; - for(int i = 0; i < m_chunk_size; i++) - { - if ((next = getc(m_stream[m_file_ind])) == EOF) - { - fprintf(stderr, "Can't getc(3)\n"); - return -1; - } - /* just to fool optimizers */ - buf[next]++; - } - - m_cur_pos++; - if(m_cur_pos >= m_chunks_per_file) - { - if(seek(0, SEEK_CUR) == -1) - return -1; - } - return 0; -} - -int CFileOp::write_block(PVOID buf) -{ -#ifdef OS2 - unsigned long actual; - int rc = DosWrite(m_fd[m_file_ind], buf, m_chunk_size, &actual); - if(rc) - rc = -1; - else - rc = 0; - if(actual != m_chunk_size) - rc = -1; -#else - int rc = ::write(m_fd[m_file_ind], buf, m_chunk_size); - if(rc != m_chunk_size) - { - fprintf(stderr, "Can't write block.\n"); - return -1; - } -#endif - m_cur_pos++; - if(m_cur_pos >= m_chunks_per_file) - { - if(seek(0, SEEK_CUR) == -1) - return -1; - } - return rc; -} - -int CFileOp::write_block_putc() -{ - for(int i = 0; i < m_chunk_size; i++) - { - if (putc(i & 0x7f, m_stream[m_file_ind]) == EOF) - { - fprintf(stderr, "Can't putc() - disk full?\n"); - return -1; - } - } - m_cur_pos++; - if(m_cur_pos >= m_chunks_per_file) - { - if(seek(0, SEEK_CUR) == -1) - return -1; - } - return 0; -} - -int CFileOp::open(CPCCHAR base_name, bool create, bool use_fopen) -{ - m_name = new char[strlen(base_name) + 8]; - strcpy(m_name, base_name); - return reopen(create, use_fopen); -} - -CFileOp::CFileOp(BonTimer &timer, int file_size, int chunk_bits, bool use_sync) - : m_timer(timer) - , m_stream(NULL) - , m_fd(NULL) - , m_isopen(false) - , m_name(NULL) - , m_sync(use_sync) - , m_chunk_bits(chunk_bits) - , m_chunk_size(1 << m_chunk_bits) - , m_chunks_per_file(Unit / m_chunk_size * IOFileSize) - , m_total_chunks(Unit / m_chunk_size * file_size) - , m_last_file_chunks(m_total_chunks % m_chunks_per_file) - , m_cur_pos(0) - , m_file_ind(0) - , m_file_size(file_size) - , m_num_files(m_file_size / IOFileSize + 1) - , m_buf(new char[m_chunk_size]) -{ - if(m_last_file_chunks == 0) - { - m_last_file_chunks = m_chunks_per_file; - m_num_files--; - } -} - -typedef FILE * PFILE; - -int CFileOp::reopen(bool create, bool use_fopen) -{ - int i; - m_cur_pos = 0; - m_file_ind = 0; - - if(m_isopen) close(); - - m_isopen = true; - if(use_fopen) - { - m_stream = new PFILE[m_num_files]; - for(i = 0; i < m_num_files; i++) - m_stream[i] = NULL; - } - else - { -#ifdef OS2 - m_fd = new HFILE[m_num_files]; -#else - m_fd = new int[m_num_files]; -#endif - for(i = 0; i < m_num_files; i++) - m_fd[i] = -1; - } - int len = strlen(m_name); - for(i = 0; i < m_num_files; i++) - { - sprintf(&m_name[len], ".%03d", i); - if(m_open(m_name, i, create)) - return 1; - } - m_name[len] = '\0'; - return 0; -} - -int CFileOp::m_open(CPCCHAR base_name, int ind, bool create) -{ -#ifdef OS2 - ULONG createFlag; -#else - int flags; -#endif - const char *fopen_mode; - if(create) - { /* create from scratch */ -#ifndef OS2 - unlink(base_name); -#endif - fopen_mode = "w+"; -#ifdef OS2 - createFlag = OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS; -#else - flags = O_RDWR | O_CREAT | O_EXCL; -#endif - } - else - { - fopen_mode = "r+"; -#ifdef OS2 - createFlag = OPEN_ACTION_OPEN_IF_EXISTS; -#else - flags = O_RDWR; -#endif - } - if(m_fd) - { -#ifdef OS2 - ULONG action = 0; - ULONG rc = DosOpen(base_name, &m_fd[ind], &action, 0, FILE_NORMAL, createFlag - , OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE - , NULL); - if(rc) - m_fd[ind] = -1; -#else - m_fd[ind] = ::open(base_name, flags, S_IRUSR | S_IWUSR); -#endif - } - else - { - m_stream[ind] = fopen(base_name, fopen_mode); - } - - if( (m_fd && m_fd[ind] == -1) || (m_stream && m_stream[ind] == NULL) ) - { - fprintf(stderr, "Can't open file %s\n", base_name); - return -1; - } - return 0; -} - -void CFileOp::close() -{ - if(!m_isopen) - return; - for(int i = 0; i < m_num_files; i++) - { - if(m_sync) - fflush(NULL); - if(m_stream && m_stream[i]) fclose(m_stream[i]); - if(m_fd && m_fd[i] != -1) - { - if(m_sync) - { - if(fsync(m_fd[i])) - fprintf(stderr, "Can't sync files.\n"); - } - file_close(m_fd[i]); - } - } - m_isopen = false; - delete m_fd; - delete m_stream; - m_fd = NULL; - m_stream = NULL; -} - - -/* - * Do a typical-of-something random I/O. Any serious application that - * has a random I/O bottleneck is going to be smart enough to operate - * in a page mode, and not stupidly pull individual words out at - * odd offsets. To keep the cache from getting too clever, some - * pages must be updated. However an application that updated each of - * many random pages that it looked at is hard to imagine. - * However, it would be wrong to put the update percentage in as a - * parameter - the effect is too nonlinear. Need a profile - * of what Oracle or Ingres or some such actually does. - * Be warned - there is a *sharp* elbow in this curve - on a 1-MiB file, - * most substantial unix systems show >2000 random I/Os per second - - * obviously they've cached the whole thing and are just doing buffer - * copies. - */ -int -CFileOp::doseek(long where, bool update) -{ - if (seek(where, SEEK_SET) == -1) - return io_error("lseek in doseek"); - if (read_block(PVOID(m_buf)) == -1) - return io_error("read in doseek"); - - /* every so often, update a block */ - if (update) - { /* update this block */ - - /* touch a byte */ - m_buf[int(rand()) % m_chunk_size]--; - if(seek(where, SEEK_SET) == -1) - return io_error("lseek in doseek update"); - if (write_block(PVOID(m_buf)) == -1) - return io_error("write in doseek"); - if(m_sync) - { - if(fsync(m_fd[m_file_ind])) - { - fprintf(stderr, "Can't sync file.\n"); - return -1; - } - } - } /* update this block */ - return 0; -} - diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.h b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.h deleted file mode 100644 index 1c8be0b..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_io.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef BON_FILE -#define BON_FILE - -#include "bonnie.h" -class Semaphore; -class BonTimer; - -class CFileOp -{ -public: - CFileOp(BonTimer &timer, int file_size, int chunk_bits, bool use_sync = false); - int open(CPCCHAR base_name, bool create, bool use_fopen = false); - ~CFileOp(); - int write_block_putc(); - int write_block(PVOID buf); - int read_block_getc(char *buf); - int read_block(PVOID buf); - int seek(int offset, int whence); - int doseek(long where, bool update); - int seek_test(bool quiet, Semaphore &s); - void close(); - // reopen a file, bools for whether the file should be unlink()'d and - // creat()'d and for whether fopen should be used - int reopen(bool create, bool use_fopen = false); - BonTimer &getTimer() { return m_timer; } - int chunks() const { return m_total_chunks; } -private: - int m_open(CPCCHAR base_name, int ind, bool create); - - BonTimer &m_timer; - FILE **m_stream; - FILE_TYPE *m_fd; - bool m_isopen; - char *m_name; - bool m_sync; - const int m_chunk_bits, m_chunk_size; - int m_chunks_per_file, m_total_chunks; - int m_last_file_chunks; - int m_cur_pos; - int m_file_ind; - int m_file_size; - int m_num_files; - CFileOp(const CFileOp &f); - CFileOp & operator =(const CFileOp &f); - char *m_buf; -}; - - -#endif diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_suid.cpp b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_suid.cpp deleted file mode 100644 index b0da29d..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_suid.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include <pwd.h> -#include <grp.h> -#include <sys/types.h> -#include <unistd.h> -#include <stdio.h> -#include "bonnie.h" - -int bon_setugid(CPCCHAR userName, CPCCHAR groupName, bool quiet) -{ - int id = 0; - uid_t userId = 0; - gid_t groupId = 0; - bool setGroup = false; - struct passwd *pw; - struct group *gr; - if(userName) - { - if(sscanf(userName, "%d", &id) == 1) - { - userId = uid_t(id); - pw = getpwuid(userId); - if(pw) - { - groupId = pw->pw_gid; - setGroup = true; - } - else - { - gr = getgrnam("nogroup"); - if(gr) - groupId = gr->gr_gid; - setGroup = true; - } - } - else - { - pw = getpwnam(userName); - if(!pw) - { - fprintf(stderr, "Can't find user %s\n", userName); - return 1; - } - userId = pw->pw_uid; - groupId = pw->pw_gid; - setGroup = true; - } - } - if(groupName) - { - if(sscanf(groupName, "%d", &id) == 1) - { - groupId = gid_t(id); - setGroup = true; - } - else - { - gr = getgrnam(groupName); - if(!gr) - { - fprintf(stderr, "Can't find group %s\n", groupName); - return 1; - } - groupId = gr->gr_gid; - setGroup = true; - } - } - if(setGroup) - { - if(setgid(groupId)) - { - fprintf(stderr, "Can't set gid to %d.\n", int(groupId)); - return 1; - } - } - if(setuid(userId)) - { - fprintf(stderr, "Can't set uid to %d.\n", int(userId)); - return 1; - } - if(!quiet) - fprintf(stderr, "Using uid:%d, gid:%d.\n", int(getuid()), int(getgid())); - return 0; -} diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.cpp b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.cpp deleted file mode 100644 index 2a921c3..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.cpp +++ /dev/null @@ -1,406 +0,0 @@ - -using namespace std; - -#include <sys/time.h> -#ifdef OS2 -#define INCL_DOSFILEMGR -#define INCL_BASE -#include <os2.h> -#include "os2-perfutil.h" -/* - Convert 8-byte (low, high) time value to double -*/ -#define LL2F(high, low) (4294967296.0*(high)+(low)) -#else -#include <unistd.h> -#include <sys/resource.h> -#endif -#include "bon_time.h" -#include <time.h> -#include <string.h> - -#ifndef NON_UNIX -#include "conf.h" -#endif - -#ifdef HAVE_ALGORITHM -#include <algorithm> -#else - -#ifdef HAVE_ALGO -#include <algo> -#else -#ifdef HAVE_ALGO_H -#include <algo.h> -#else -#define min(XX,YY) ((XX) < (YY) ? (XX) : (YY)) -#define max(XX,YY) ((XX) > (YY) ? (XX) : (YY)) -#endif -#endif - -#endif - -#define TIMEVAL_TO_DOUBLE(XX) (double((XX).tv_sec) + double((XX).tv_usec) / 1000000.0) - -void BonTimer::timestamp() -{ - m_last_timestamp = get_cur_time(); - m_last_cpustamp = get_cpu_use(); -} - -double -BonTimer::time_so_far() -{ - return get_cur_time() - m_last_timestamp; -} - -double -BonTimer::cpu_so_far() -{ - return get_cpu_use() - m_last_cpustamp; -} - -double -BonTimer::get_cur_time() -{ -#ifdef OS2 - ULONG count = 0; - ULONG rc = DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &count, sizeof(count)); - if(rc) - return 0.0; - return double(count)/1000.0; -#else - struct timeval tp; - - if (gettimeofday(&tp, static_cast<struct timezone *>(NULL)) == -1) - io_error("gettimeofday", true); - return TIMEVAL_TO_DOUBLE(tp); -#endif -} - -double -BonTimer::get_cpu_use() -{ -#ifdef OS2 - double busy_val, busy_val_prev; - double intr_val, intr_val_prev; - CPUUTIL CPUUtil; - - ULONG rc = DosPerfSysCall(CMD_KI_RDCNT,(ULONG) &CPUUtil,0,0); - if(rc) - io_error("times", true); - return LL2F(CPUUtil.ulBusyHigh, CPUUtil.ulBusyLow) - + LL2F(CPUUtil.ulIntrHigh, CPUUtil.ulIntrLow); -#else - struct rusage res_usage; - - getrusage(RUSAGE_SELF, &res_usage); - return TIMEVAL_TO_DOUBLE(res_usage.ru_utime) + TIMEVAL_TO_DOUBLE(res_usage.ru_stime); -#endif -} - -void BonTimer::get_delta_t(tests_t test) -{ - m_delta[test].Elapsed = time_so_far(); - m_delta[test].CPU = cpu_so_far(); - timestamp(); -} - -void BonTimer::get_delta_report(report_s &rep) -{ - rep.EndTime = get_cur_time(); - rep.CPU = cpu_so_far(); - timestamp(); -} - -void BonTimer::add_delta_report(report_s &rep, tests_t test) -{ - if(m_delta[test].CPU == 0.0) - { - m_delta[test].FirstStart = rep.StartTime; - m_delta[test].LastStop = rep.EndTime; - } - else - { - m_delta[test].FirstStart = min(m_delta[test].FirstStart, rep.StartTime); - m_delta[test].LastStop = max(m_delta[test].LastStop, rep.EndTime); - } - m_delta[test].CPU += rep.CPU; - m_delta[test].Elapsed = m_delta[test].LastStop - m_delta[test].FirstStart; -} - -BonTimer::BonTimer() - : m_type(txt) -{ - Initialize(); -} - -void -BonTimer::Initialize() -{ - for(int i = 0; i < TestCount; i++) - { - m_delta[i].CPU = 0.0; - m_delta[i].Elapsed = 0.0; - } - timestamp(); -} - -int BonTimer::print_cpu_stat(tests_t test) -{ - if(m_delta[test].Elapsed == 0.0) - { - if(m_type == txt) - fprintf(m_fp, " "); - else - fprintf(m_fp, ","); - return 0; - } - if(m_delta[test].Elapsed < MinTime) - { - if(m_type == txt) - fprintf(m_fp, " +++"); - else - fprintf(m_fp, ",+++"); - return 0; - } - int cpu = int(m_delta[test].CPU / m_delta[test].Elapsed * 100.0); - if(m_type == txt) - fprintf(m_fp, " %3d", cpu); - else - fprintf(m_fp, ",%d", cpu); - return 0; -} - -int BonTimer::print_stat(tests_t test) -{ - if(m_delta[test].Elapsed == 0.0) - { - if(m_type == txt) - fprintf(m_fp, " "); - else - fprintf(m_fp, ","); - } - else if(m_delta[test].Elapsed < MinTime) - { - if(m_type == txt) - fprintf(m_fp, " +++++"); - else - fprintf(m_fp, ",+++++"); - } - else - { - if(test == Lseek) - { - double seek_stat = double(Seeks) / m_delta[test].Elapsed; - if(m_type == txt) - { - if(seek_stat >= 1000.0) - fprintf(m_fp, " %5.0f", seek_stat); - else - fprintf(m_fp, " %5.1f", seek_stat); - } - else - fprintf(m_fp, ",%.1f", seek_stat); - } - else - { - int res = int(double(m_file_size) / (m_delta[test].Elapsed / 1024.0)); - if(m_type == txt) - fprintf(m_fp, " %5d", res); - else - fprintf(m_fp, ",%d", res); - } - } - return print_cpu_stat(test); -} - -int BonTimer::print_file_stat(tests_t test) -{ - if(m_delta[test].Elapsed == 0.0) - { - if(m_type == txt) - fprintf(m_fp, " "); - else - fprintf(m_fp, ","); - } - else if(m_delta[test].Elapsed < MinTime) - { - if(m_type == txt) - fprintf(m_fp, " +++++"); - else - fprintf(m_fp, ",+++++"); - } - else - { - int res = int(double(m_directory_size) * double(DirectoryUnit) - / m_delta[test].Elapsed); - if(m_type == txt) - fprintf(m_fp, " %5d", res); - else - fprintf(m_fp, ",%d", res); - } - - return print_cpu_stat(test); -} - -void -BonTimer::PrintHeader(FILE *fp) -{ - fprintf(fp, "name"); - fprintf(fp, ",file_size,putc,putc_cpu,put_block,put_block_cpu,rewrite,rewrite_cpu,getc,getc_cpu,get_block,get_block_cpu,seeks,seeks_cpu"); - fprintf(fp, ",num_files,seq_create,seq_create_cpu,seq_stat,seq_stat_cpu,seq_del,seq_del_cpu,ran_create,ran_create_cpu,ran_stat,ran_stat_cpu,ran_del,ran_del_cpu"); - fprintf(fp, "\n"); - fflush(NULL); -} - -int -BonTimer::DoReport(CPCCHAR machine, int file_size, int directory_size - , int max_size, int min_size, int num_directories - , int chunk_size, FILE *fp) -{ - m_fp = fp; - m_file_size = file_size; - m_directory_size = directory_size; - m_chunk_size = chunk_size; - const int txt_machine_size = 20; - if(m_file_size) - { - if(m_type == txt) - { - fprintf(m_fp, "Version %5s ", BON_VERSION); - fprintf(m_fp, - "------Sequential Output------ --Sequential Input- --Random-\n"); - fprintf(m_fp, " "); - fprintf(m_fp, - "-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--\n"); - if(m_chunk_size == DefaultChunkSize) - fprintf(m_fp, "Machine Size "); - else - fprintf(m_fp, "Machine Size:chnk "); - fprintf(m_fp, "K/sec %%CP K/sec %%CP K/sec %%CP K/sec %%CP K/sec "); - fprintf(m_fp, "%%CP /sec %%CP\n"); - } - char size_buf[1024]; - if(m_file_size % 1024 == 0) - sprintf(size_buf, "%dG", m_file_size / 1024); - else - sprintf(size_buf, "%dM", m_file_size); - if(m_chunk_size != DefaultChunkSize) - { - char *tmp = size_buf + strlen(size_buf); - if(m_chunk_size >= 1024) - sprintf(tmp, ":%dk", m_chunk_size / 1024); - else - sprintf(tmp, ":%d", m_chunk_size); - } - char buf[4096]; - if(m_type == txt) - { - // copy machine name to buf - // - snprintf(buf -#ifndef NO_SNPRINTF - , txt_machine_size - 1 -#endif - , "%s ", machine); - buf[txt_machine_size - 1] = '\0'; - // set cur to point to a byte past where we end the machine name - // size of the buf - size of the new data - 1 for the space - 1 for the - // terminating zero on the string - char *cur = &buf[txt_machine_size - strlen(size_buf) - 2]; - *cur = ' '; // make cur a space - cur++; // increment to where we store the size - strcpy(cur, size_buf); // copy the size in - fputs(buf, m_fp); - } - else - { - printf("%s,%s", machine, size_buf); - } - print_stat(Putc); - print_stat(FastWrite); - print_stat(ReWrite); - print_stat(Getc); - print_stat(FastRead); - print_stat(Lseek); - if(m_type == txt) - fprintf(m_fp, "\n"); - } - else if(m_type == csv) - { - fprintf(m_fp, "%s,,,,,,,,,,,,,", machine); - } - - if(m_directory_size) - { - char buf[128]; - char *tmp; - sprintf(buf, "%d", m_directory_size); - if(max_size == -1) - { - strcat(buf, ":link"); - } - else if(max_size == -2) - { - strcat(buf, ":symlink"); - } - else if(max_size) - { - tmp = &buf[strlen(buf)]; - sprintf(tmp, ":%d:%d", max_size, min_size); - } - if(num_directories > 1) - { - tmp = &buf[strlen(buf)]; - sprintf(tmp, "/%d", num_directories); - } - if(m_type == txt) - { - if(m_file_size) - fprintf(m_fp, " "); - else - fprintf(m_fp, "Version %5s ", BON_VERSION); - fprintf(m_fp, - "------Sequential Create------ --------Random Create--------\n"); - if(m_file_size) - fprintf(m_fp, " "); - else - fprintf(m_fp, "%-19.19s ", machine); - fprintf(m_fp, - "-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--\n"); - if(min_size) - { - fprintf(m_fp, "files:max:min "); - } - else - { - if(max_size) - fprintf(m_fp, "files:max "); - else - fprintf(m_fp, " files "); - } - fprintf(m_fp, " /sec %%CP /sec %%CP /sec %%CP /sec %%CP /sec "); - fprintf(m_fp, "%%CP /sec %%CP\n"); - fprintf(m_fp, "%19s", buf); - } - else - { - fprintf(m_fp, ",%s", buf); - } - print_file_stat(CreateSeq); - print_file_stat(StatSeq); - print_file_stat(DelSeq); - print_file_stat(CreateRand); - print_file_stat(StatRand); - print_file_stat(DelRand); - fprintf(m_fp, "\n"); - } - else if(m_type == csv) - { - fprintf(m_fp, ",,,,,,,,,,,,,\n"); - } - fflush(stdout); - return 0; -} - diff --git a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.h b/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.h deleted file mode 100644 index 79f878a..0000000 --- a/src/tests/system/libroot/posix/bonnie++-1.03d/bon_time.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef BON_TIME_H -#define BON_TIME_H - -#include "bonnie.h" - -struct report_s -{ - double CPU; - double StartTime; - double EndTime; -}; - -struct delta_s -{ - double CPU; - double Elapsed; - double FirstStart; - double LastStop; -}; - -class BonTimer -{ -public: - enum RepType { csv, txt }; - - BonTimer(); - - void timestamp(); - void get_delta_t(tests_t test); - void get_delta_report(report_s &rep); - void add_delta_report(report_s &rep, tests_t test); - int DoReport(CPCCHAR machine, int size, int directory_size - , int max_size, int min_size, int num_directories - , int chunk_size, FILE *fp); - void SetType(RepType type) { m_type = type; } - double cpu_so_far(); - double time_so_far(); - void PrintHeader(FILE *fp); - void Initialize(); - static double get_cur_time(); - static double get_cpu_use(); - -private: - int print_cpu_stat(tests_t test); - int print_stat(tests_t test); - int print_file_stat(tests_t test); - - delta_s m_delta[TestCount]; - double m_last_cpustamp; - double m_last_timestamp; - RepType m_type; - int m_file_size; - int m_directory_size; - int m_chunk_size; - FILE *m_fp; - - BonTimer(const BonTimer&); - BonTimer &operator=(const BonTimer&); -}; - -#endif [ *** diff truncated: 8486 lines dropped *** ]