X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=9a5dea7fd552a13414f189ff9e5e34212401305f;hp=e8e15fe863ae1a4bbf5511f222000dfd5c6b800f;hb=95f31f7d42ee755d9a8ff72cdfb189cec72c1375;hpb=a06be957386f23a0ac94f215cd1e23e6f4c93161 diff --git a/Makefile b/Makefile index e8e15fe8..9a5dea7f 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ SOURCE := $(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \ pshared.c options.c \ smalloc.c filehash.c profile.c debug.c engines/cpu.c \ engines/mmap.c engines/sync.c engines/null.c engines/net.c \ - engines/ftruncate.c engines/filecreate.c \ + engines/ftruncate.c engines/filecreate.c engines/filestat.c \ server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \ gettime-thread.c helpers.c json.c idletime.c td_error.c \ profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \ @@ -59,6 +59,18 @@ ifdef CONFIG_LIBHDFS SOURCE += engines/libhdfs.c endif +ifdef CONFIG_LIBISCSI + CFLAGS += $(LIBISCSI_CFLAGS) + LIBS += $(LIBISCSI_LIBS) + SOURCE += engines/libiscsi.c +endif + +ifdef CONFIG_LIBNBD + CFLAGS += $(LIBNBD_CFLAGS) + LIBS += $(LIBNBD_LIBS) + SOURCE += engines/nbd.c +endif + ifdef CONFIG_64BIT CFLAGS += -DBITS_PER_LONG=64 endif @@ -86,9 +98,6 @@ endif ifdef CONFIG_GUASI SOURCE += engines/guasi.c endif -ifdef CONFIG_FUSION_AW - SOURCE += engines/fusion-aw.c -endif ifdef CONFIG_SOLARISAIO SOURCE += engines/solarisaio.c endif @@ -123,6 +132,9 @@ endif ifndef CONFIG_INET_ATON SOURCE += oslib/inet_aton.c endif +ifndef CONFIG_HAVE_STATX + SOURCE += oslib/statx.c +endif ifdef CONFIG_GFAPI SOURCE += engines/glusterfs.c SOURCE += engines/glusterfs_sync.c @@ -148,17 +160,20 @@ endif ifdef CONFIG_IME SOURCE += engines/ime.c endif +ifdef CONFIG_LINUX_BLKZONED + SOURCE += zbd.c +endif ifeq ($(CONFIG_TARGET_OS), Linux) SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \ - oslib/linux-dev-lookup.c + oslib/linux-dev-lookup.c engines/io_uring.c LIBS += -lpthread -ldl LDFLAGS += -rdynamic endif ifeq ($(CONFIG_TARGET_OS), Android) SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \ oslib/linux-dev-lookup.c - LIBS += -ldl + LIBS += -ldl -llog LDFLAGS += -rdynamic endif ifeq ($(CONFIG_TARGET_OS), SunOS) @@ -196,9 +211,10 @@ ifeq ($(CONFIG_TARGET_OS), Darwin) LIBS += -lpthread -ldl endif ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) - SOURCE += os/windows/posix.c - LIBS += -lpthread -lpsapi -lws2_32 - CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static + SOURCE += os/windows/cpu-affinity.c os/windows/posix.c + WINDOWS_OBJS = os/windows/cpu-affinity.o os/windows/posix.o lib/hweight.o + LIBS += -lpthread -lpsapi -lws2_32 -lssp + CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format endif OBJS := $(SOURCE:.c=.o) @@ -263,6 +279,9 @@ T_VS_PROGS = t/fio-verify-state T_PIPE_ASYNC_OBJS = t/read-to-pipe-async.o T_PIPE_ASYNC_PROGS = t/read-to-pipe-async +T_IOU_RING_OBJS = t/io_uring.o +T_IOU_RING_PROGS = t/io_uring + T_MEMLOCK_OBJS = t/memlock.o T_MEMLOCK_PROGS = t/memlock @@ -281,11 +300,12 @@ T_OBJS += $(T_VS_OBJS) T_OBJS += $(T_PIPE_ASYNC_OBJS) T_OBJS += $(T_MEMLOCK_OBJS) T_OBJS += $(T_TT_OBJS) +T_OBJS += $(T_IOU_RING_OBJS) ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) - T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o - T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o - T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o + T_DEDUPE_OBJS += $(WINDOWS_OBJS) + T_SMALLOC_OBJS += $(WINDOWS_OBJS) + T_LFSR_TEST_OBJS += $(WINDOWS_OBJS) endif T_TEST_PROGS = $(T_SMALLOC_PROGS) @@ -297,9 +317,37 @@ T_TEST_PROGS += $(T_GEN_RAND_PROGS) T_PROGS += $(T_BTRACE_FIO_PROGS) T_PROGS += $(T_DEDUPE_PROGS) T_PROGS += $(T_VS_PROGS) +T_TEST_PROGS += $(T_MEMLOCK_PROGS) +ifdef CONFIG_PREAD +T_TEST_PROGS += $(T_PIPE_ASYNC_PROGS) +endif +ifneq (,$(findstring Linux,$(CONFIG_TARGET_OS))) +T_TEST_PROGS += $(T_IOU_RING_PROGS) +endif PROGS += $(T_PROGS) +ifdef CONFIG_HAVE_CUNIT +UT_OBJS = unittests/unittest.o +UT_OBJS += unittests/lib/memalign.o +UT_OBJS += unittests/lib/strntol.o +UT_OBJS += unittests/oslib/strlcat.o +UT_OBJS += unittests/oslib/strndup.o +UT_OBJS += unittests/oslib/strcasestr.o +UT_OBJS += unittests/oslib/strsep.o +UT_TARGET_OBJS = lib/memalign.o +UT_TARGET_OBJS += lib/strntol.o +UT_TARGET_OBJS += oslib/strlcat.o +UT_TARGET_OBJS += oslib/strndup.o +UT_TARGET_OBJS += oslib/strcasestr.o +UT_TARGET_OBJS += oslib/strsep.o +UT_PROGS = unittests/unittest +else +UT_OBJS = +UT_TARGET_OBJS = +UT_PROGS = +endif + ifneq ($(findstring $(MAKEFLAGS),s),s) ifndef V QUIET_CC = @echo ' ' CC $@; @@ -326,7 +374,7 @@ mandir = $(prefix)/man sharedir = $(prefix)/share/fio endif -all: $(PROGS) $(T_TEST_PROGS) $(SCRIPTS) FORCE +all: $(PROGS) $(T_TEST_PROGS) $(UT_PROGS) $(SCRIPTS) FORCE .PHONY: all install clean test .PHONY: FORCE cscope @@ -343,13 +391,14 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d @mv -f $*.d $*.d.tmp @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d -ifeq ($(CONFIG_TARGET_OS), NetBSD) - @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \ - sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d -else - @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \ - sed -e 's/^ *//' -e 's/$$/:/' >> $*.d -endif + @if type -p fmt >/dev/null 2>&1; then \ + sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \ + sed -e 's/^ *//' -e 's/$$/:/' >> $*.d; \ + else \ + sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | \ + tr -cs "[:graph:]" "\n" | \ + sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d; \ + fi @rm -f $*.d.tmp ifdef CONFIG_ARITHMETIC @@ -382,19 +431,6 @@ parse.o: lex.yy.o y.tab.o endif init.o: init.c FIO-VERSION-FILE - @mkdir -p $(dir $@) - $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< - @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d - @mv -f $*.d $*.d.tmp - @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d -ifeq ($(CONFIG_TARGET_OS), NetBSD) - @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \ - sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d -else - @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \ - sed -e 's/^ *//' -e 's/$$/:/' >> $*.d -endif - @rm -f $*.d.tmp gcompat.o: gcompat.c gcompat.h $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $< @@ -423,6 +459,10 @@ cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h printing.o: printing.c printing.h $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $< +t/io_uring.o: os/linux/io_uring.h +t/io_uring: $(T_IOU_RING_OBJS) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IOU_RING_OBJS) $(LIBS) + t/read-to-pipe-async: $(T_PIPE_ASYNC_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_PIPE_ASYNC_OBJS) $(LIBS) @@ -467,8 +507,14 @@ t/fio-verify-state: $(T_VS_OBJS) t/time-test: $(T_TT_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_TT_OBJS) $(LIBS) +ifdef CONFIG_HAVE_CUNIT +unittests/unittest: $(UT_OBJS) $(UT_TARGET_OBJS) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit $(LIBS) +endif + clean: FORCE - @rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) $(T_TEST_PROGS) core.* core gfio FIO-VERSION-FILE *.[do] lib/*.d oslib/*.[do] crc/*.d engines/*.[do] profiles/*.[do] t/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h + @rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(UT_OBJS) $(PROGS) $(T_PROGS) $(T_TEST_PROGS) core.* core gfio unittests/unittest FIO-VERSION-FILE *.[do] lib/*.d oslib/*.[do] crc/*.d engines/*.[do] profiles/*.[do] t/*.[do] unittests/*.[do] unittests/*/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h + @rm -f t/fio-btrace2fio t/io_uring t/read-to-pipe-async @rm -rf doc/output distclean: clean FORCE @@ -489,6 +535,21 @@ doc: tools/plot/fio2gnuplot.1 test: fio ./fio --minimal --thread --exitall_on_error --runtime=1s --name=nulltest --ioengine=null --rw=randrw --iodepth=2 --norandommap --random_generator=tausworthe64 --size=16T --name=verifyfstest --filename=fiotestfile.tmp --unlink=1 --rw=write --verify=crc32c --verify_state_save=0 --size=16K +fulltest: + sudo modprobe null_blk && \ + if [ ! -e /usr/include/libzbc/zbc.h ]; then \ + git clone https://github.com/hgst/libzbc && \ + (cd libzbc && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j && \ + sudo make install) \ + fi && \ + sudo t/zbd/run-tests-against-regular-nullb && \ + if [ -e /sys/module/null_blk/parameters/zoned ]; then \ + sudo t/zbd/run-tests-against-zoned-nullb; \ + fi + install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) @@ -499,3 +560,5 @@ install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE $(INSTALL) -m 644 $(SRCDIR)/tools/hist/fiologparser_hist.py.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir) $(INSTALL) -m 644 $(SRCDIR)/tools/plot/*gpm $(DESTDIR)$(sharedir)/ + +.PHONY: test fulltest