diff --git a/app/iscsi_tgt/Makefile b/app/iscsi_tgt/Makefile index 3ac8aabb6..068042df8 100644 --- a/app/iscsi_tgt/Makefile +++ b/app/iscsi_tgt/Makefile @@ -46,7 +46,7 @@ C_SRCS := iscsi_tgt.c SPDK_LIB_LIST = event_bdev event_copy event_iscsi event_net event_scsi SPDK_LIB_LIST += jsonrpc json rpc bdev_rpc bdev iscsi scsi copy trace conf -SPDK_LIB_LIST += util log log_rpc event app_rpc +SPDK_LIB_LIST += thread util log log_rpc event app_rpc ifeq ($(OS),Linux) SPDK_LIB_LIST += event_nbd nbd diff --git a/app/nvmf_tgt/Makefile b/app/nvmf_tgt/Makefile index 2f161d553..9afab0a7d 100644 --- a/app/nvmf_tgt/Makefile +++ b/app/nvmf_tgt/Makefile @@ -41,7 +41,7 @@ APP = nvmf_tgt C_SRCS := nvmf_main.c SPDK_LIB_LIST = event_bdev event_copy event_nvmf -SPDK_LIB_LIST += nvmf event log trace conf util bdev copy rpc jsonrpc json +SPDK_LIB_LIST += nvmf event log trace conf thread util bdev copy rpc jsonrpc json SPDK_LIB_LIST += app_rpc log_rpc bdev_rpc ifeq ($(OS),Linux) diff --git a/app/spdk_tgt/Makefile b/app/spdk_tgt/Makefile index 1b7bb2500..501d69390 100644 --- a/app/spdk_tgt/Makefile +++ b/app/spdk_tgt/Makefile @@ -41,7 +41,7 @@ APP = spdk_tgt C_SRCS := spdk_tgt.c SPDK_LIB_LIST = event_bdev event_copy event_iscsi event_net event_scsi event_nvmf -SPDK_LIB_LIST += nvmf event log trace conf util bdev iscsi scsi copy rpc jsonrpc json +SPDK_LIB_LIST += nvmf event log trace conf thread util bdev iscsi scsi copy rpc jsonrpc json SPDK_LIB_LIST += app_rpc log_rpc bdev_rpc ifeq ($(OS),Linux) diff --git a/app/vhost/Makefile b/app/vhost/Makefile index 52ee99742..1b5584081 100644 --- a/app/vhost/Makefile +++ b/app/vhost/Makefile @@ -42,7 +42,7 @@ C_SRCS := vhost.c SPDK_LIB_LIST = event_bdev event_copy event_net event_scsi event_vhost SPDK_LIB_LIST += jsonrpc json rpc bdev_rpc bdev scsi copy trace conf -SPDK_LIB_LIST += util log log_rpc event app_rpc +SPDK_LIB_LIST += thread util log log_rpc event app_rpc SPDK_LIB_LIST += vhost rte_vhost event_nbd nbd LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) \ diff --git a/doc/concurrency.md b/doc/concurrency.md index c95b37d15..dcc3c0c1c 100644 --- a/doc/concurrency.md +++ b/doc/concurrency.md @@ -65,7 +65,7 @@ fundamental libraries in SPDK, for instance, don't do any message passing on their own and instead enumerate rules about when functions may be called in their documentation (e.g. @ref nvme). Most libraries, however, depend on SPDK's [io_channel](http://www.spdk.io/doc/io__channel_8h.html) infrastructure, -located in `libspdk_util.a`. The io_channel infrastructure is an abstraction +located in `libspdk_thread.a`. The io_channel infrastructure is an abstraction around a basic message passing framework and defines a few key abstractions. First, spdk_thread is an abstraction for a thread of execution and diff --git a/examples/bdev/fio_plugin/Makefile b/examples/bdev/fio_plugin/Makefile index e47fadfa2..4f16751bb 100644 --- a/examples/bdev/fio_plugin/Makefile +++ b/examples/bdev/fio_plugin/Makefile @@ -43,7 +43,7 @@ C_SRCS = fio_plugin.c CFLAGS += -I$(FIO_SOURCE_DIR) LDFLAGS += -shared -rdynamic -SPDK_LIB_LIST += util bdev conf copy rpc jsonrpc json log +SPDK_LIB_LIST += thread util bdev conf copy rpc jsonrpc json log LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/examples/bdev/hello_world/Makefile b/examples/bdev/hello_world/Makefile index 38dc2186f..dc85b27d1 100644 --- a/examples/bdev/hello_world/Makefile +++ b/examples/bdev/hello_world/Makefile @@ -39,7 +39,7 @@ APP = hello_bdev C_SRCS := hello_bdev.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += bdev copy event util conf trace log jsonrpc json rpc +SPDK_LIB_LIST += bdev copy event thread util conf trace log jsonrpc json rpc LIBS += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_MODULES_LINKER_ARGS) LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/examples/blob/cli/Makefile b/examples/blob/cli/Makefile index 5f5817850..2eaca606a 100644 --- a/examples/blob/cli/Makefile +++ b/examples/blob/cli/Makefile @@ -39,7 +39,7 @@ APP = blobcli C_SRCS := blobcli.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event util conf trace \ +SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event thread util conf trace \ log jsonrpc json rpc LIBS += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_NO_LVOL_MODULES_LINKER_ARGS) diff --git a/examples/blob/hello_world/Makefile b/examples/blob/hello_world/Makefile index fc7660ad4..d98ecaa08 100644 --- a/examples/blob/hello_world/Makefile +++ b/examples/blob/hello_world/Makefile @@ -39,7 +39,7 @@ APP = hello_blob C_SRCS := hello_blob.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event util conf trace \ +SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event thread util conf trace \ log jsonrpc json rpc LIBS += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_MODULES_LINKER_ARGS) diff --git a/examples/ioat/perf/Makefile b/examples/ioat/perf/Makefile index 55de07d3e..518a35072 100644 --- a/examples/ioat/perf/Makefile +++ b/examples/ioat/perf/Makefile @@ -39,7 +39,7 @@ APP = perf C_SRCS := perf.c -SPDK_LIB_LIST = ioat util log +SPDK_LIB_LIST = ioat thread util log LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/examples/ioat/verify/Makefile b/examples/ioat/verify/Makefile index de3276f42..d7a7b0b2c 100644 --- a/examples/ioat/verify/Makefile +++ b/examples/ioat/verify/Makefile @@ -39,7 +39,7 @@ APP = verify C_SRCS := verify.c -SPDK_LIB_LIST = ioat util log +SPDK_LIB_LIST = ioat thread util log LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/lib/Makefile b/lib/Makefile index e1b4bdd4b..c3c6b6527 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk DIRS-y += bdev blob blobfs conf copy cunit event json jsonrpc \ - log lvol net rpc trace util nvme nvmf scsi ioat \ + log lvol net rpc thread trace util nvme nvmf scsi ioat \ ut_mock iscsi ifeq ($(OS),Linux) DIRS-y += nbd diff --git a/lib/rocksdb/spdk.rocksdb.mk b/lib/rocksdb/spdk.rocksdb.mk index 39d872ef7..2f7a4a86a 100644 --- a/lib/rocksdb/spdk.rocksdb.mk +++ b/lib/rocksdb/spdk.rocksdb.mk @@ -55,7 +55,7 @@ endif SPDK_LIB_LIST = event_bdev event_copy SPDK_LIB_LIST += blobfs bdev copy event util conf trace \ - log jsonrpc json rpc + log jsonrpc json rpc thread AM_LINK += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_MODULES_LINKER_ARGS) AM_LINK += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/lib/thread/Makefile b/lib/thread/Makefile new file mode 100644 index 000000000..467e32ff9 --- /dev/null +++ b/lib/thread/Makefile @@ -0,0 +1,40 @@ +# +# BSD LICENSE +# +# Copyright (c) Intel Corporation. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) +include $(SPDK_ROOT_DIR)/mk/spdk.common.mk + +C_SRCS = thread.c +LIBNAME = thread + +include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk diff --git a/lib/util/io_channel.c b/lib/thread/thread.c similarity index 100% rename from lib/util/io_channel.c rename to lib/thread/thread.c diff --git a/lib/util/Makefile b/lib/util/Makefile index 4e2773a4f..4b993590f 100644 --- a/lib/util/Makefile +++ b/lib/util/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -C_SRCS = bit_array.c cpuset.c crc16.c crc32.c crc32c.c crc32_ieee.c fd.c io_channel.c strerror_tls.c string.c uuid.c +C_SRCS = bit_array.c cpuset.c crc16.c crc32.c crc32c.c crc32_ieee.c fd.c strerror_tls.c string.c uuid.c LIBNAME = util include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk diff --git a/mk/nvme.libtest.mk b/mk/nvme.libtest.mk index 38eec850b..f6da77a03 100644 --- a/mk/nvme.libtest.mk +++ b/mk/nvme.libtest.mk @@ -38,7 +38,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.app.mk C_SRCS = $(APP:%=%.c) -SPDK_LIB_LIST = nvme util log +SPDK_LIB_LIST = nvme thread util log LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/mk/spdk.unittest.mk b/mk/spdk.unittest.mk index 84e4ef111..df5afe383 100644 --- a/mk/spdk.unittest.mk +++ b/mk/spdk.unittest.mk @@ -40,7 +40,7 @@ C_SRCS = $(TEST_FILE) CFLAGS += -I$(SPDK_ROOT_DIR)/lib CFLAGS += -I$(SPDK_ROOT_DIR)/test -SPDK_LIB_LIST += util log spdk_mock +SPDK_LIB_LIST += thread util log spdk_mock LIBS += -lcunit $(SPDK_LIB_LINKER_ARGS) diff --git a/test/app/bdev_svc/Makefile b/test/app/bdev_svc/Makefile index 28b81c08d..7b10aa941 100644 --- a/test/app/bdev_svc/Makefile +++ b/test/app/bdev_svc/Makefile @@ -41,7 +41,7 @@ APP = bdev_svc C_SRCS := bdev_svc.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += nvmf event log trace conf util bdev copy rpc jsonrpc json +SPDK_LIB_LIST += nvmf event log trace conf thread util bdev copy rpc jsonrpc json SPDK_LIB_LIST += app_rpc log_rpc bdev_rpc ifeq ($(OS),Linux) diff --git a/test/app/histogram_perf/Makefile b/test/app/histogram_perf/Makefile index 93123bf16..a586307c7 100644 --- a/test/app/histogram_perf/Makefile +++ b/test/app/histogram_perf/Makefile @@ -39,7 +39,7 @@ APP = histogram_perf C_SRCS = histogram_perf.c -SPDK_LIB_LIST = util +SPDK_LIB_LIST = thread util LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/test/app/jsoncat/Makefile b/test/app/jsoncat/Makefile index 959c69603..407e86e62 100644 --- a/test/app/jsoncat/Makefile +++ b/test/app/jsoncat/Makefile @@ -39,7 +39,7 @@ APP = jsoncat C_SRCS = jsoncat.c -SPDK_LIB_LIST = json util +SPDK_LIB_LIST = json thread util LIBS += $(SPDK_LIB_LINKER_ARGS) diff --git a/test/app/stub/Makefile b/test/app/stub/Makefile index c08996536..774097495 100644 --- a/test/app/stub/Makefile +++ b/test/app/stub/Makefile @@ -39,7 +39,7 @@ APP = stub C_SRCS := stub.c -SPDK_LIB_LIST = event conf nvme log trace rpc jsonrpc json util +SPDK_LIB_LIST = event conf nvme log trace rpc jsonrpc json thread util LIBS += $(SPDK_LIB_LINKER_ARGS) LIBS += $(ENV_LINKER_ARGS) diff --git a/test/bdev/bdevio/Makefile b/test/bdev/bdevio/Makefile index 7348b1698..d78b1d739 100644 --- a/test/bdev/bdevio/Makefile +++ b/test/bdev/bdevio/Makefile @@ -41,7 +41,7 @@ APP = bdevio C_SRCS := bdevio.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += bdev copy event trace log conf util rpc jsonrpc json +SPDK_LIB_LIST += bdev copy event trace log conf thread util rpc jsonrpc json LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) \ $(COPY_MODULES_LINKER_ARGS) diff --git a/test/bdev/bdevperf/Makefile b/test/bdev/bdevperf/Makefile index de59c62f2..5e45b4cbf 100644 --- a/test/bdev/bdevperf/Makefile +++ b/test/bdev/bdevperf/Makefile @@ -41,7 +41,7 @@ APP = bdevperf C_SRCS := bdevperf.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += bdev copy event trace log conf util rpc jsonrpc json +SPDK_LIB_LIST += bdev copy event trace log conf thread util rpc jsonrpc json LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) \ $(COPY_MODULES_LINKER_ARGS) diff --git a/test/blobfs/fuse/Makefile b/test/blobfs/fuse/Makefile index 56a19de00..a3fad0cf7 100644 --- a/test/blobfs/fuse/Makefile +++ b/test/blobfs/fuse/Makefile @@ -41,7 +41,7 @@ APP = fuse C_SRCS := fuse.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event util conf trace \ +SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event thread util conf trace \ log jsonrpc json rpc LIBS += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_MODULES_LINKER_ARGS) diff --git a/test/blobfs/mkfs/Makefile b/test/blobfs/mkfs/Makefile index 54f860ad1..a6349d234 100644 --- a/test/blobfs/mkfs/Makefile +++ b/test/blobfs/mkfs/Makefile @@ -41,7 +41,7 @@ APP = mkfs C_SRCS := mkfs.c SPDK_LIB_LIST = event_bdev event_copy -SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event util conf trace \ +SPDK_LIB_LIST += blobfs blob bdev blob_bdev copy event thread util conf trace \ log jsonrpc json rpc LIBS += $(COPY_MODULES_LINKER_ARGS) $(BLOCKDEV_MODULES_LINKER_ARGS) diff --git a/test/event/event_perf/Makefile b/test/event/event_perf/Makefile index 8cd9c8a3e..a3aef2ea0 100644 --- a/test/event/event_perf/Makefile +++ b/test/event/event_perf/Makefile @@ -38,7 +38,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk APP = event_perf C_SRCS := event_perf.c -SPDK_LIB_LIST = event trace conf util log rpc jsonrpc json +SPDK_LIB_LIST = event trace conf thread util log rpc jsonrpc json LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/test/event/reactor/Makefile b/test/event/reactor/Makefile index bab970cf2..c5a6168a7 100644 --- a/test/event/reactor/Makefile +++ b/test/event/reactor/Makefile @@ -38,7 +38,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk APP = reactor C_SRCS := reactor.c -SPDK_LIB_LIST = event trace conf util log rpc jsonrpc json +SPDK_LIB_LIST = event trace conf thread util log rpc jsonrpc json LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/test/event/reactor_perf/Makefile b/test/event/reactor_perf/Makefile index 4b19e52fb..820a6042a 100644 --- a/test/event/reactor_perf/Makefile +++ b/test/event/reactor_perf/Makefile @@ -38,7 +38,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk APP = reactor_perf C_SRCS := reactor_perf.c -SPDK_LIB_LIST = event trace conf util log rpc jsonrpc json +SPDK_LIB_LIST = event trace conf thread util log rpc jsonrpc json LIBS += $(SPDK_LIB_LINKER_ARGS) $(ENV_LINKER_ARGS) diff --git a/test/unit/lib/Makefile b/test/unit/lib/Makefile index 190ff9762..78ba916a1 100644 --- a/test/unit/lib/Makefile +++ b/test/unit/lib/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = bdev blob blobfs event ioat iscsi json jsonrpc log lvol net nvme nvmf scsi util +DIRS-y = bdev blob blobfs event ioat iscsi json jsonrpc log lvol net nvme nvmf scsi thread util ifeq ($(OS),Linux) DIRS-$(CONFIG_VHOST) += vhost endif diff --git a/test/unit/lib/thread/Makefile b/test/unit/lib/thread/Makefile new file mode 100644 index 000000000..d73816947 --- /dev/null +++ b/test/unit/lib/thread/Makefile @@ -0,0 +1,44 @@ +# +# BSD LICENSE +# +# Copyright (c) Intel Corporation. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) +include $(SPDK_ROOT_DIR)/mk/spdk.common.mk + +DIRS-y = thread.c + +.PHONY: all clean $(DIRS-y) + +all: $(DIRS-y) +clean: $(DIRS-y) + +include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk diff --git a/test/unit/lib/thread/thread.c/.gitignore b/test/unit/lib/thread/thread.c/.gitignore new file mode 100644 index 000000000..1a165acb8 --- /dev/null +++ b/test/unit/lib/thread/thread.c/.gitignore @@ -0,0 +1 @@ +thread_ut diff --git a/test/unit/lib/util/io_channel.c/Makefile b/test/unit/lib/thread/thread.c/Makefile similarity index 98% rename from test/unit/lib/util/io_channel.c/Makefile rename to test/unit/lib/thread/thread.c/Makefile index 6e44ffc53..23cfa45a5 100644 --- a/test/unit/lib/util/io_channel.c/Makefile +++ b/test/unit/lib/thread/thread.c/Makefile @@ -36,6 +36,6 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.app.mk include $(SPDK_ROOT_DIR)/mk/spdk.mock.unittest.mk -TEST_FILE = io_channel_ut.c +TEST_FILE = thread_ut.c include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk diff --git a/test/unit/lib/util/io_channel.c/io_channel_ut.c b/test/unit/lib/thread/thread.c/thread_ut.c similarity index 99% rename from test/unit/lib/util/io_channel.c/io_channel_ut.c rename to test/unit/lib/thread/thread.c/thread_ut.c index 0febd151d..3f39ce9bf 100644 --- a/test/unit/lib/util/io_channel.c/io_channel_ut.c +++ b/test/unit/lib/thread/thread.c/thread_ut.c @@ -35,7 +35,7 @@ #include "spdk_cunit.h" -#include "util/io_channel.c" +#include "thread/thread.c" #include "common/lib/test_env.c" #include "common/lib/ut_multithread.c" diff --git a/test/unit/lib/util/Makefile b/test/unit/lib/util/Makefile index 8ce9670e9..00f68d63b 100644 --- a/test/unit/lib/util/Makefile +++ b/test/unit/lib/util/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = bit_array.c cpuset.c crc16.c crc32_ieee.c crc32c.c io_channel.c string.c +DIRS-y = bit_array.c cpuset.c crc16.c crc32_ieee.c crc32c.c string.c .PHONY: all clean $(DIRS-y) diff --git a/test/unit/lib/util/io_channel.c/.gitignore b/test/unit/lib/util/io_channel.c/.gitignore deleted file mode 100644 index f957986fd..000000000 --- a/test/unit/lib/util/io_channel.c/.gitignore +++ /dev/null @@ -1 +0,0 @@ -io_channel_ut diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 11b10502f..5b421ef31 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -107,11 +107,12 @@ $valgrind $testdir/lib/iscsi/iscsi.c/iscsi_ut $valgrind $testdir/lib/iscsi/init_grp.c/init_grp_ut $testdir/lib/iscsi/init_grp.c/init_grp.conf $valgrind $testdir/lib/iscsi/portal_grp.c/portal_grp_ut $testdir/lib/iscsi/portal_grp.c/portal_grp.conf +$valgrind $testdir/lib/thread/thread.c/thread_ut + $valgrind $testdir/lib/util/bit_array.c/bit_array_ut $valgrind $testdir/lib/util/crc16.c/crc16_ut $valgrind $testdir/lib/util/crc32_ieee.c/crc32_ieee_ut $valgrind $testdir/lib/util/crc32c.c/crc32c_ut -$valgrind $testdir/lib/util/io_channel.c/io_channel_ut $valgrind $testdir/lib/util/string.c/string_ut if [ $(uname -s) = Linux ]; then