Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ option(ENABLE_JEMALLOC "Use jemalloc (default OFF)")
option(ENABLE_LUAJIT "Use LuaJIT (default OFF)")
option(ENABLE_MIMALLOC "Use mimalloc (default OFF)")
option(ENABLE_DOCS "Build docs (default OFF)")
option(ENABLE_BENCHMARKS "Build benchmarks (default OFF)")

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(DEFAULT_POSIX_CAP ON)
Expand Down Expand Up @@ -262,7 +263,7 @@ check_symbol_exists(eventfd sys/eventfd.h HAVE_EVENTFD)

option(USE_IOURING "Use experimental io_uring (linux only)" 0)
if (HAVE_IOURING AND USE_IOURING)
message(Using io_uring)
message(STATUS "Using io_uring")
set(TS_USE_LINUX_IO_URING 1)
endif(HAVE_IOURING AND USE_IOURING)

Expand Down Expand Up @@ -308,7 +309,7 @@ set(CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/lib/catch2)
include(CTest)
set(TS_HAS_TESTS ${BUILD_REGRESSION_TESTING})

message("Configuring for ${HOST_OS}")
message(STATUS "Configuring for ${HOST_OS}")

if(HOST_OS STREQUAL "linux")
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
Expand Down Expand Up @@ -409,6 +410,11 @@ if(ENABLE_DOCS)
add_subdirectory(doc)
endif()

if(ENABLE_BENCHMARKS)
message(STATUS "Building benchmarks in tools/benchmark")
add_subdirectory(tools/benchmark)
endif()

add_custom_target(clang-format-install
COMMAND ${CMAKE_SOURCE_DIR}/tools/clang-format.sh --install
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Expand Down Expand Up @@ -459,7 +465,7 @@ add_custom_target(format
)

if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit)
message("Installing github hook")
message(STATUS "Installing github hook")
configure_file(${CMAKE_SOURCE_DIR}/tools/git/pre-commit ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit COPYONLY)
endif()

Expand All @@ -469,7 +475,7 @@ install(DIRECTORY DESTINATION var/trafficserver)

# Display build summary
include(CMakePrintHelpers)
message("Build Summary:")
message(STATUS "Build Summary:")
cmake_print_variables(CMAKE_SYSTEM_NAME)
cmake_print_variables(CMAKE_SYSTEM_VERSION)
cmake_print_variables(CMAKE_SYSTEM_PROCESSOR)
Expand Down
44 changes: 44 additions & 0 deletions tools/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################

add_executable(benchmark_FreeList benchmark_FreeList.cc)
target_link_libraries(benchmark_FreeList
PRIVATE
catch2::catch2
ts::tscore
libswoc
)
if(TS_USE_HWLOC)
target_link_libraries(benchmark_FreeList PRIVATE hwloc)
endif()

add_executable(benchmark_ProxyAllocator benchmark_ProxyAllocator.cc)
target_link_libraries(benchmark_ProxyAllocator
PRIVATE
catch2::catch2
ts::tscore
ts::inkevent
libswoc
)

add_executable(benchmark_SharedMutex benchmark_SharedMutex.cc)
target_link_libraries(benchmark_SharedMutex
PRIVATE
catch2::catch2
ts::tscore
libswoc
)