[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/iozone/0001-Add-new-targets-for-iozone.patch b/ap/app/iozone/0001-Add-new-targets-for-iozone.patch
new file mode 100644
index 0000000..3cc184e
--- /dev/null
+++ b/ap/app/iozone/0001-Add-new-targets-for-iozone.patch
@@ -0,0 +1,103 @@
+From 5b1e973b2333e838624abf195b3ba9716591f304 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Sun, 10 Oct 2021 10:15:26 +0200
+Subject: [PATCH] Add new targets for iozone:
+
+linux-noaio is for linux targets without AIO (use case: uClibc)
+linux-noth is for linux target without threads or AIO
+
+And make largefile support optional via CFLAGS.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
+---
+ src/current/makefile | 56 +++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 47 insertions(+), 9 deletions(-)
+
+diff --git a/src/current/makefile b/src/current/makefile
+index 3a54701..3b17b1b 100644
+--- a/src/current/makefile
++++ b/src/current/makefile
+@@ -172,10 +172,28 @@ hpux_no_ansi: iozone_hpux_no.o libbif.o
+ # GNU 'C' compiler Linux build with threads, largefiles, async I/O
+ #
+ linux: iozone_linux.o libasync.o libbif.o fileop_linux.o pit_server.o
+- $(CC) -O3 $(CFLAGS) iozone_linux.o libasync.o libbif.o -lpthread \
++ $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux.o libasync.o libbif.o \
++ -lpthread -lrt -o iozone
++ $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop
++ $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server
++
++#
++# GNU 'C' compiler Linux build with threads, largefiles
++#
++linux-noaio: iozone_linux-noaio.o libbif.o fileop_linux.o pit_server.o
++ $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux-noaio.o libbif.o \
++ -lpthread -lrt -o iozone
++ $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop
++ $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server
++
++#
++# GNU 'C' compiler Linux build with largefiles
++#
++linux-noth: iozone_linux-noth.o libbif.o fileop_linux.o pit_server.o
++ $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux-noth.o libbif.o \
+ -lrt -o iozone
+- $(CC) -O3 $(CFLAGS) -Dlinux fileop_linux.o -o fileop
+- $(CC) -O3 $(CFLAGS) -Dlinux pit_server.o -o pit_server
++ $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop
++ $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server
+
+ #
+ # GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O
+@@ -841,13 +859,33 @@ iozone_linux.o: iozone.c libbif.c libasync.c
+ @echo ""
+ @echo "Building iozone for Linux"
+ @echo ""
+- $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -DHAVE_ANSIC_C -DASYNC_IO -DHAVE_PREAD \
+- -DSHARED_MEM -Dlinux -D_LARGEFILE64_SOURCE $(CFLAGS) iozone.c \
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DASYNC_IO -DHAVE_PREAD \
++ -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \
+ -DNAME='"linux"' -o iozone_linux.o
+- $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -DHAVE_ANSIC_C -DASYNC_IO -D_LARGEFILE64_SOURCE \
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DASYNC_IO \
++ -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -Dlinux -DHAVE_ANSIC_C -DASYNC_IO \
++ $(CFLAGS) libasync.c -o libasync.o
++
++iozone_linux-noaio.o: iozone.c libbif.c
++ @echo ""
++ @echo "Building iozone for Linux no AIO"
++ @echo ""
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DHAVE_PREAD \
++ -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \
++ -DNAME='"linux"' -o iozone_linux-noaio.o
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C \
++ -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o
++
++iozone_linux-noth.o: iozone.c libbif.c
++ @echo ""
++ @echo "Building iozone for Linux with no threads"
++ @echo ""
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DNO_THREADS -DHAVE_PREAD \
++ -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \
++ -DNAME='"linux"' -o iozone_linux-noth.o
++ $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DNO_THREADS \
+ -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o
+- $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -Dlinux -DHAVE_ANSIC_C -DASYNC_IO \
+- -D_LARGEFILE64_SOURCE $(CFLAGS) libasync.c -o libasync.o
+
+ fileop_AIX.o: fileop.c
+ @echo ""
+@@ -951,7 +989,7 @@ fileop_linux.o: fileop.c
+ @echo ""
+ @echo "Building fileop for Linux"
+ @echo ""
+- $(CC) -Wall -c -O3 $(CFLAGS) fileop.c -o fileop_linux.o
++ $(CC) -Wall -c $(CFLAGS) fileop.c -o fileop_linux.o
+
+ fileop_openbsd.o: fileop.c
+ @echo ""
+--
+2.27.0
+
diff --git a/ap/app/iozone/0002-Reduce-maximum-buffer-size.patch b/ap/app/iozone/0002-Reduce-maximum-buffer-size.patch
new file mode 100644
index 0000000..2e0ef5b
--- /dev/null
+++ b/ap/app/iozone/0002-Reduce-maximum-buffer-size.patch
@@ -0,0 +1,11 @@
+--- a/src/current/iozone.c
++++ b/src/current/iozone.c
+@@ -875,7 +875,7 @@ struct master_neutral_command {
+ /* At 16 Meg switch to large records */
+ #define CROSSOVER (16*1024)
+ /* Maximum buffer size*/
+-#define MAXBUFFERSIZE (16*1024*1024)
++#define MAXBUFFERSIZE (2*1024*1024)
+ #endif
+
+ /* Maximum number of children. Threads/procs/clients */
diff --git a/ap/app/iozone/Makefile b/ap/app/iozone/Makefile
new file mode 100644
index 0000000..1686776
--- /dev/null
+++ b/ap/app/iozone/Makefile
@@ -0,0 +1,16 @@
+
+include $(COMMON_BASE_MK)
+
+NAME=iozone
+SRC_DIR=iozone3_493/src/current
+
+all:
+ make CC=$(CC) -C $(SRC_DIR) linux-noaio
+
+clean:
+ -make -C $(SRC_DIR) clean
+
+romfs:
+ $(ROMFSINST) $(SRC_DIR)/iozone /sbin/iozone
+ #$(ROMFSINST) $(SRC_DIR)/fileop /sbin/fileop
+ #$(ROMFSINST) $(SRC_DIR)/pit_server /sbin/pit_server
diff --git a/ap/app/iozone/readme.txt b/ap/app/iozone/readme.txt
new file mode 100644
index 0000000..51b2b46
--- /dev/null
+++ b/ap/app/iozone/readme.txt
@@ -0,0 +1,7 @@
+打补丁的方法:
+
+wget https://www.iozone.org/src/current/iozone3_493.tgz
+tar xf iozone3_493.tgz
+cd iozone3_493
+patch -p1 < ../0001-Add-new-targets-for-iozone.patch
+patch -p1 < ../0002-Reduce-maximum-buffer-size.patch