Skip to content

Commit

Permalink
Merge pull request ceph#23962 from aclamk/fio-fix-compilation
Browse files Browse the repository at this point in the history
objectstore/test/fio: Fixed fio compilation when tcmalloc is used.

Reviewed-by: Casey Bodley <[email protected]>
Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored Oct 25, 2018
2 parents 75eb578 + a0025db commit 7a3bf10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
7 changes: 5 additions & 2 deletions cmake/modules/BuildFIO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ function(build_fio)
# we use an external project and copy the sources to bin directory to ensure
# that object files are built outside of the source tree.
include(ExternalProject)
if(ALLOCATOR)
set(FIO_EXTLIBS EXTLIBS=-l${ALLOCATOR})
endif()
ExternalProject_Add(fio_ext
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/src/
UPDATE_COMMAND "" # this disables rebuild on each run
GIT_REPOSITORY "https://github.com/axboe/fio.git"
GIT_TAG "bf0b7e75c1ccca4026c8880ed8a76fc7ef85f2f3"
GIT_TAG "fio-3.10"
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/fio
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure
BUILD_COMMAND $(MAKE) fio EXTFLAGS=-Wno-format-truncation
BUILD_COMMAND $(MAKE) fio EXTFLAGS=-Wno-format-truncation ${FIO_EXTLIBS}
INSTALL_COMMAND cp <BINARY_DIR>/fio ${CMAKE_BINARY_DIR}/bin)
endfunction()
28 changes: 11 additions & 17 deletions src/test/fio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ FIO
===

Ceph uses the fio workload generator and benchmarking utility.
(https://github.com/axboe/fio.git)

To fetch the fio sources:

git clone git://git.kernel.dk/fio.git

To build fio:

./configure
make
FIO tool is automatically fetched to build/src/fio, and build if necessary.

RBD
---
Expand All @@ -31,6 +25,10 @@ To build fio with rbd:
If configure fails with "Rados Block Device engine no", see config.log for
details and adjust the cflags as necessary.

If ceph was compiled with tcmalloc, it may be necessary to compile fio with:
make EXTLIBS=tcmalloc
Otherwise fio might crash in malloc_usable_size().

To view the fio options specific to the rbd engine:

./fio --enghelp=rbd
Expand All @@ -49,18 +47,14 @@ Because the ObjectStore is not a public-facing interface, we build it inside
of the ceph tree and load libfio_ceph_objectstore.so into fio as an external
engine.

To build fio_ceph_objectstore against external(downloadable) FIO source code:
```
./do_cmake.sh -DWITH_FIO=ON -DCMAKE_BUILD_TYPE=Release
cd build
make fio_ceph_objectstore install
```
To build against existing FIO source code:
To build fio_ceph_objectstore run:
```
FIO_ROOT_DIR=<path to fio source code> ./do_cmake.sh -DWITH_SYSTEM_FIO=ON
./do_cmake.sh -DWITH_FIO=ON
cd build
make fio_ceph_objectstore install
make fio_ceph_objectstore
```
This will fetch FIO to build/src/fio directory,
compile fio tool and libfio_ceph_objectstore.so.

If you install the ceph libraries to a location that isn't in your
LD_LIBRARY_PATH, be sure to add it:
Expand Down

0 comments on commit 7a3bf10

Please sign in to comment.