Skip to content

Commit 72cb897

Browse files
authored
Cleanup: Collect micro-benchmark programs (#9998)
1 parent ef616ff commit 72cb897

File tree

9 files changed

+84
-20
lines changed

9 files changed

+84
-20
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,11 @@ src/tscore/ink_autoconf.h
8787
src/tscore/ink_autoconf.h.in
8888
include/tscore/ink_config.h
8989
include/ts/apidefs.h
90-
src/tscore/benchmark_shared_mutex
9190
src/tscore/CompileParseRules
9291
src/tscore/CompileParseRules.dSYM
9392
src/tscore/ParseRulesCType
9493
src/tscore/ParseRulesCTypeToLower
9594
src/tscore/ParseRulesCTypeToUpper
96-
src/tscore/freelist_benchmark
9795
src/tscore/mkdfa
9896
src/tscore/test_atomic
9997
src/tscore/test_freelist
@@ -114,7 +112,6 @@ iocore/aio/test_AIO
114112
iocore/eventsystem/test_IOBuffer
115113
iocore/eventsystem/test_EventSystem
116114
iocore/eventsystem/test_MIOBufferWriter
117-
iocore/eventsystem/benchmark_ProxyAllocator
118115

119116
iocore/hostdb/test_RefCountCache
120117
iocore/hostdb/test_HostFile
@@ -164,6 +161,10 @@ plugins/esi/vars_test
164161

165162
plugins/experimental/uri_signing/test_uri_signing
166163

164+
tools/benchmark/benchmark_FreeList
165+
tools/benchmark/benchmark_ProxyAllocator
166+
tools/benchmark/benchmark_SharedMutex
167+
167168
mgmt/rpc/overridable_txn_vars.cc
168169
mgmt/rpc/IPCSocketClient.cc
169170
mgmt/rpc/test_jsonrpc

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,7 @@ AC_CONFIG_FILES([
24032403
tools/Makefile
24042404
tools/trafficserver.pc
24052405
tools/tsxs
2406+
tools/benchmark/Makefile
24062407
tests/Makefile
24072408
])
24082409

iocore/eventsystem/Makefile.am

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ libinkevent_a_SOURCES = \
7676

7777
check_PROGRAMS = test_IOBuffer \
7878
test_EventSystem \
79-
test_MIOBufferWriter \
80-
benchmark_ProxyAllocator
79+
test_MIOBufferWriter
8180

8281
test_LD_FLAGS = \
8382
@AM_LDFLAGS@ \
@@ -115,11 +114,6 @@ test_MIOBufferWriter_SOURCES = unit_tests/test_MIOBufferWriter.cc
115114
test_MIOBufferWriter_CPPFLAGS = $(test_CPP_FLAGS)
116115
test_MIOBufferWriter_LDFLAGS = $(test_LD_FLAGS)
117116

118-
benchmark_ProxyAllocator_SOURCES = unit_tests/benchmark_ProxyAllocator.cc
119-
benchmark_ProxyAllocator_CPPFLAGS = $(test_CPP_FLAGS)
120-
benchmark_ProxyAllocator_LDFLAGS = $(test_LD_FLAGS)
121-
benchmark_ProxyAllocator_LDADD = $(test_LD_ADD)
122-
123117
include $(top_srcdir)/mk/tidy.mk
124118

125119
clang-tidy-local: $(DIST_SOURCES)

src/tscore/Makefile.am

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
include $(top_srcdir)/mk/tidy.mk
2020

21-
noinst_PROGRAMS = CompileParseRules freelist_benchmark benchmark_shared_mutex
21+
noinst_PROGRAMS = CompileParseRules
2222
check_PROGRAMS = test_geometry test_X509HostnameValidator test_tscore
2323

2424
if EXPENSIVE_TESTS
@@ -190,15 +190,6 @@ test_tscore_SOURCES += \
190190
unit_tests/test_HKDF.cc
191191
endif
192192

193-
freelist_benchmark_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS) -I$(abs_top_srcdir)/lib/catch2
194-
freelist_benchmark_LDADD = libtscore.a @HWLOC_LIBS@ @LIBPCRE@ @LIBCAP@
195-
freelist_benchmark_SOURCES = unit_tests/freelist_benchmark.cc
196-
197-
benchmark_shared_mutex_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS) -I$(abs_top_srcdir)/lib/catch2
198-
benchmark_shared_mutex_LDADD = libtscore.a @LIBPCRE@ @LIBCAP@
199-
200-
benchmark_shared_mutex_SOURCES = unit_tests/benchmark_shared_mutex.cc
201-
202193
CompileParseRules_SOURCES = CompileParseRules.cc
203194

204195
CompileParseRules$(BUILD_EXEEXT): $(CompileParseRules_OBJECTS)

tools/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# See the License for the specific language governing permissions and
1818
# limitations under the License.
1919

20+
SUBDIRS = benchmark
21+
2022
bin_SCRIPTS = tsxs tspush
2123

2224
pkgconfigdir = $(libdir)/pkgconfig

tools/benchmark/Makefile.am

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# Collection of Catch2 based micro benchmark programs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one
5+
# or more contributor license agreements. See the NOTICE file
6+
# distributed with this work for additional information
7+
# regarding copyright ownership. The ASF licenses this file
8+
# to you under the Apache License, Version 2.0 (the
9+
# "License"); you may not use this file except in compliance
10+
# with the License. You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
include $(top_srcdir)/mk/tidy.mk
21+
22+
noinst_PROGRAMS = \
23+
benchmark_FreeList \
24+
benchmark_ProxyAllocator \
25+
benchmark_SharedMutex
26+
27+
benchmark_LD_FLAGS = \
28+
@AM_LDFLAGS@ \
29+
@OPENSSL_LDFLAGS@ \
30+
@SWOC_LDFLAGS@ \
31+
@YAMLCPP_LDFLAGS@
32+
33+
benchmark_CPP_FLAGS = \
34+
-Wno-array-bounds \
35+
$(AM_CPPFLAGS) \
36+
$(iocore_include_dirs) \
37+
-I$(abs_top_srcdir)/include \
38+
-I$(abs_top_srcdir)/proxy \
39+
-I$(abs_top_srcdir)/proxy/hdrs \
40+
-I$(abs_top_srcdir)/proxy/http \
41+
-I$(abs_top_srcdir)/proxy/logging \
42+
-I$(abs_top_srcdir)/mgmt \
43+
-I$(abs_top_srcdir)/mgmt/utils \
44+
-I$(abs_top_srcdir)/lib/catch2 \
45+
@OPENSSL_INCLUDES@ \
46+
@SWOC_INCLUDES@
47+
48+
benchmark_LD_ADD = \
49+
$(top_builddir)/iocore/eventsystem/libinkevent.a \
50+
$(top_builddir)/src/records/librecords_p.a \
51+
$(top_builddir)/src/tscore/libtscore.a \
52+
$(top_builddir)/src/tscpp/util/libtscpputil.la \
53+
@HWLOC_LIBS@ \
54+
@LIBPCRE@ \
55+
@LIBCAP@ \
56+
@SWOC_LIBS@ \
57+
@YAMLCPP_LIBS@
58+
59+
benchmark_FreeList_SOURCES = benchmark_FreeList.cc
60+
benchmark_FreeList_CPPFLAGS = $(benchmark_CPP_FLAGS)
61+
benchmark_FreeList_LDFLAGS = $(benchmark_LD_FLAGS)
62+
benchmark_FreeList_LDADD = $(benchmark_LD_ADD)
63+
64+
benchmark_ProxyAllocator_SOURCES = benchmark_ProxyAllocator.cc
65+
benchmark_ProxyAllocator_CPPFLAGS = $(benchmark_CPP_FLAGS)
66+
benchmark_ProxyAllocator_LDFLAGS = $(benchmark_LD_FLAGS)
67+
benchmark_ProxyAllocator_LDADD = $(benchmark_LD_ADD)
68+
69+
benchmark_SharedMutex_SOURCES = benchmark_SharedMutex.cc
70+
benchmark_SharedMutex_CPPFLAGS = $(benchmark_CPP_FLAGS)
71+
benchmark_SharedMutex_LDFLAGS = $(benchmark_LD_FLAGS)
72+
benchmark_SharedMutex_LDADD = $(benchmark_LD_ADD)
73+
74+
clang-tidy-local: $(DIST_SOURCES)
75+
$(CXX_Clang_Tidy)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)