This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 72cb897b46 Cleanup: Collect micro-benchmark programs (#9998)
72cb897b46 is described below

commit 72cb897b469eece1e956b90e5433182dc99e5f96
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Tue Jul 25 08:23:47 2023 +0900

    Cleanup: Collect micro-benchmark programs (#9998)
---
 .gitignore                                         |  7 +-
 configure.ac                                       |  1 +
 iocore/eventsystem/Makefile.am                     |  8 +--
 src/tscore/Makefile.am                             | 11 +---
 tools/Makefile.am                                  |  2 +
 tools/benchmark/Makefile.am                        | 75 ++++++++++++++++++++++
 .../benchmark/benchmark_FreeList.cc                |  0
 .../benchmark}/benchmark_ProxyAllocator.cc         |  0
 .../benchmark/benchmark_SharedMutex.cc             |  0
 9 files changed, 84 insertions(+), 20 deletions(-)

diff --git a/.gitignore b/.gitignore
index cd8a5e475a..a4983d434b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,13 +87,11 @@ src/tscore/ink_autoconf.h
 src/tscore/ink_autoconf.h.in
 include/tscore/ink_config.h
 include/ts/apidefs.h
-src/tscore/benchmark_shared_mutex
 src/tscore/CompileParseRules
 src/tscore/CompileParseRules.dSYM
 src/tscore/ParseRulesCType
 src/tscore/ParseRulesCTypeToLower
 src/tscore/ParseRulesCTypeToUpper
-src/tscore/freelist_benchmark
 src/tscore/mkdfa
 src/tscore/test_atomic
 src/tscore/test_freelist
@@ -114,7 +112,6 @@ iocore/aio/test_AIO
 iocore/eventsystem/test_IOBuffer
 iocore/eventsystem/test_EventSystem
 iocore/eventsystem/test_MIOBufferWriter
-iocore/eventsystem/benchmark_ProxyAllocator
 
 iocore/hostdb/test_RefCountCache
 iocore/hostdb/test_HostFile
@@ -164,6 +161,10 @@ plugins/esi/vars_test
 
 plugins/experimental/uri_signing/test_uri_signing
 
+tools/benchmark/benchmark_FreeList
+tools/benchmark/benchmark_ProxyAllocator
+tools/benchmark/benchmark_SharedMutex
+
 mgmt/rpc/overridable_txn_vars.cc
 mgmt/rpc/IPCSocketClient.cc
 mgmt/rpc/test_jsonrpc
diff --git a/configure.ac b/configure.ac
index 3dc8c3d18d..0eb8249053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2403,6 +2403,7 @@ AC_CONFIG_FILES([
   tools/Makefile
   tools/trafficserver.pc
   tools/tsxs
+  tools/benchmark/Makefile
   tests/Makefile
 ])
 
diff --git a/iocore/eventsystem/Makefile.am b/iocore/eventsystem/Makefile.am
index b49cb0091d..9701c2cdf9 100644
--- a/iocore/eventsystem/Makefile.am
+++ b/iocore/eventsystem/Makefile.am
@@ -76,8 +76,7 @@ libinkevent_a_SOURCES = \
 
 check_PROGRAMS = test_IOBuffer \
        test_EventSystem \
-       test_MIOBufferWriter \
-       benchmark_ProxyAllocator
+       test_MIOBufferWriter
 
 test_LD_FLAGS = \
        @AM_LDFLAGS@ \
@@ -115,11 +114,6 @@ test_MIOBufferWriter_SOURCES = 
unit_tests/test_MIOBufferWriter.cc
 test_MIOBufferWriter_CPPFLAGS = $(test_CPP_FLAGS)
 test_MIOBufferWriter_LDFLAGS = $(test_LD_FLAGS)
 
-benchmark_ProxyAllocator_SOURCES = unit_tests/benchmark_ProxyAllocator.cc
-benchmark_ProxyAllocator_CPPFLAGS = $(test_CPP_FLAGS)
-benchmark_ProxyAllocator_LDFLAGS = $(test_LD_FLAGS)
-benchmark_ProxyAllocator_LDADD = $(test_LD_ADD)
-
 include $(top_srcdir)/mk/tidy.mk
 
 clang-tidy-local: $(DIST_SOURCES)
diff --git a/src/tscore/Makefile.am b/src/tscore/Makefile.am
index b97c022729..2012d49918 100644
--- a/src/tscore/Makefile.am
+++ b/src/tscore/Makefile.am
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/mk/tidy.mk
 
-noinst_PROGRAMS = CompileParseRules freelist_benchmark benchmark_shared_mutex
+noinst_PROGRAMS = CompileParseRules
 check_PROGRAMS = test_geometry test_X509HostnameValidator test_tscore
 
 if EXPENSIVE_TESTS
@@ -190,15 +190,6 @@ test_tscore_SOURCES += \
        unit_tests/test_HKDF.cc
 endif
 
-freelist_benchmark_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS) 
-I$(abs_top_srcdir)/lib/catch2
-freelist_benchmark_LDADD = libtscore.a @HWLOC_LIBS@ @LIBPCRE@ @LIBCAP@
-freelist_benchmark_SOURCES = unit_tests/freelist_benchmark.cc
-
-benchmark_shared_mutex_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS) 
-I$(abs_top_srcdir)/lib/catch2
-benchmark_shared_mutex_LDADD = libtscore.a @LIBPCRE@ @LIBCAP@
-
-benchmark_shared_mutex_SOURCES = unit_tests/benchmark_shared_mutex.cc
-
 CompileParseRules_SOURCES = CompileParseRules.cc
 
 CompileParseRules$(BUILD_EXEEXT): $(CompileParseRules_OBJECTS)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c092f23776..3592e938f1 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -17,6 +17,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+SUBDIRS = benchmark
+
 bin_SCRIPTS = tsxs tspush
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/tools/benchmark/Makefile.am b/tools/benchmark/Makefile.am
new file mode 100644
index 0000000000..93417a0fff
--- /dev/null
+++ b/tools/benchmark/Makefile.am
@@ -0,0 +1,75 @@
+#
+#  Collection of Catch2 based micro benchmark programs
+#
+#  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.
+
+include $(top_srcdir)/mk/tidy.mk
+
+noinst_PROGRAMS = \
+    benchmark_FreeList \
+    benchmark_ProxyAllocator \
+    benchmark_SharedMutex
+
+benchmark_LD_FLAGS = \
+    @AM_LDFLAGS@ \
+    @OPENSSL_LDFLAGS@ \
+    @SWOC_LDFLAGS@ \
+    @YAMLCPP_LDFLAGS@
+
+benchmark_CPP_FLAGS = \
+    -Wno-array-bounds \
+    $(AM_CPPFLAGS) \
+    $(iocore_include_dirs) \
+    -I$(abs_top_srcdir)/include \
+    -I$(abs_top_srcdir)/proxy \
+    -I$(abs_top_srcdir)/proxy/hdrs \
+    -I$(abs_top_srcdir)/proxy/http \
+    -I$(abs_top_srcdir)/proxy/logging \
+    -I$(abs_top_srcdir)/mgmt \
+    -I$(abs_top_srcdir)/mgmt/utils \
+    -I$(abs_top_srcdir)/lib/catch2 \
+    @OPENSSL_INCLUDES@ \
+    @SWOC_INCLUDES@
+
+benchmark_LD_ADD = \
+       $(top_builddir)/iocore/eventsystem/libinkevent.a \
+       $(top_builddir)/src/records/librecords_p.a \
+       $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/tscpp/util/libtscpputil.la \
+       @HWLOC_LIBS@ \
+    @LIBPCRE@ \
+    @LIBCAP@ \
+    @SWOC_LIBS@ \
+    @YAMLCPP_LIBS@
+
+benchmark_FreeList_SOURCES = benchmark_FreeList.cc
+benchmark_FreeList_CPPFLAGS = $(benchmark_CPP_FLAGS)
+benchmark_FreeList_LDFLAGS = $(benchmark_LD_FLAGS)
+benchmark_FreeList_LDADD = $(benchmark_LD_ADD)
+
+benchmark_ProxyAllocator_SOURCES = benchmark_ProxyAllocator.cc
+benchmark_ProxyAllocator_CPPFLAGS = $(benchmark_CPP_FLAGS)
+benchmark_ProxyAllocator_LDFLAGS = $(benchmark_LD_FLAGS)
+benchmark_ProxyAllocator_LDADD = $(benchmark_LD_ADD)
+
+benchmark_SharedMutex_SOURCES = benchmark_SharedMutex.cc
+benchmark_SharedMutex_CPPFLAGS = $(benchmark_CPP_FLAGS)
+benchmark_SharedMutex_LDFLAGS = $(benchmark_LD_FLAGS)
+benchmark_SharedMutex_LDADD = $(benchmark_LD_ADD)
+
+clang-tidy-local: $(DIST_SOURCES)
+       $(CXX_Clang_Tidy)
diff --git a/src/tscore/unit_tests/freelist_benchmark.cc 
b/tools/benchmark/benchmark_FreeList.cc
similarity index 100%
rename from src/tscore/unit_tests/freelist_benchmark.cc
rename to tools/benchmark/benchmark_FreeList.cc
diff --git a/iocore/eventsystem/unit_tests/benchmark_ProxyAllocator.cc 
b/tools/benchmark/benchmark_ProxyAllocator.cc
similarity index 100%
rename from iocore/eventsystem/unit_tests/benchmark_ProxyAllocator.cc
rename to tools/benchmark/benchmark_ProxyAllocator.cc
diff --git a/src/tscore/unit_tests/benchmark_shared_mutex.cc 
b/tools/benchmark/benchmark_SharedMutex.cc
similarity index 100%
rename from src/tscore/unit_tests/benchmark_shared_mutex.cc
rename to tools/benchmark/benchmark_SharedMutex.cc

Reply via email to