Skip to content

Commit 2f2ffed

Browse files
YifanYuan3facebook-github-bot
authored andcommitted
add vdso_bench
Summary: as titled. this is mainly about clock Differential Revision: D82088271
1 parent f2f8a55 commit 2f2ffed

8 files changed

Lines changed: 65 additions & 3 deletions

File tree

benchpress/config/benchmarks_wdl.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ wdl_bench:
1313
- app
1414
- folly
1515
- fbthrift
16+
- vdso
1617
component:
1718
- cpu
1819
metrics: []

benchpress/config/jobs_wdl.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,28 @@
147147
after:
148148
- 'benchmarks/wdl_bench/wdl_bench_results.txt'
149149
- 'benchmarks/wdl_bench/out_*.json'
150+
151+
- name: vdso_bench
152+
benchmark: wdl_bench
153+
description: >
154+
Common vdso operations. Compute intensive.
155+
args:
156+
- '--name {name}'
157+
- '--type {type}'
158+
- '--output {output}'
159+
vars:
160+
- 'name=vdso_bench'
161+
- 'type=single_core'
162+
- 'output=wdl_bench_results.txt'
163+
hooks:
164+
- hook: cpu-mpstat
165+
options:
166+
args:
167+
- '-u' # utilization
168+
- '1' # second interval
169+
- hook: copymove
170+
options:
171+
is_move: true
172+
after:
173+
- 'benchmarks/wdl_bench/wdl_bench_results.txt'
174+
- 'benchmarks/wdl_bench/out_*.json'

benchpress/plugins/parsers/wdl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def parse(self, stdout, stderr, returncode):
2727
with open(out_file, "r") as out_f:
2828
out = json.load(out_f)
2929
for k, v in out.items():
30-
metrics[benchmark + k] = v
30+
metrics[benchmark + "_" + k] = v
3131

3232
if len(metrics.keys()) >= 20:
3333
metrics = {}

packages/wdl_bench/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ WDLBench and its job information are located in separate files. To use it (insta
2424
```
2525

2626
## Run WDLBench
27-
As of 2024 Q3, we have three libraries included -- `folly`, `lzbench`, and `openssl`,
27+
As of 2025 Q3, we have the following libraries included -- `folly`, `lzbench`, `openssl`, and `vdso_bench`,
2828
each can run on a single core or all cores.
2929

3030
for `folly`, the user can choose to run them all together (i.e., run all microbenchmarks with one DCPerf run) or individually (i.e., one microbenchmark per DCPerf run) with different jobs.
@@ -35,11 +35,13 @@ for `folly`, the user can choose to run them all together (i.e., run all microbe
3535
```
3636
for list of functions to run then individually, see [list of benchmarks in folly](#list-of-benchmarks-in-folly).
3737

38-
For `lzbench` and `openssl`, the user can pass parameters to select how to run them.
38+
For `lzbench`, `openssl` and `vdso_bench`, the user can pass parameters to select how to run them.
3939
```
4040
./benchpress_cli.py -b wdl run lzbench -i '{"type": "single_core|all_core"}'
4141
4242
./benchpress_cli.py -b wdl run openssl -i '{"type": "single_core|all_core"}'
43+
44+
./benchpress_cli.py -b wdl run vdso_bench -i '{"type": "single_core|multi_thread"}'
4345
```
4446
For `lzbench` and `openssl`, the user can also pass the `algo` parameter to specify the algorithm used, for `lzbench`, the default algorithm is `zstd`, while for `openssl`, the default algorithm is `ctr` (`aes-256-ctr`).
4547

packages/wdl_bench/convert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
parse_line.parse_line_lzbench(f, sum_c)
2323
elif sys.argv[1] == "openssl":
2424
parse_line.parse_line_openssl(f, sum_c)
25+
elif sys.argv[1] == "vdso_bench":
26+
parse_line.parse_line_vdso_bench(f, sum_c)
2527
else:
2628
parse_line.parse_line(f, sum_c)
2729

packages/wdl_bench/install_wdl_bench.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ declare -A REPOS=(
1212
['fbthrift']='https://github.com/facebook/fbthrift.git'
1313
['lzbench']='https://github.com/inikep/lzbench.git'
1414
['openssl']='https://github.com/openssl/openssl.git'
15+
['vdso']='https://github.com/leitao/debug.git'
1516
)
1617

1718
declare -A TAGS=(
1819
['folly']='v2025.05.12.00'
1920
['fbthrift']='v2025.08.18.00'
2021
['lzbench']='d138844ea56b36ff1c1c43b259c866069deb64ad'
2122
['openssl']='openssl-3.3.1'
23+
['vdso']='main'
2224
)
2325

2426
declare -A DATASETS=(
@@ -152,6 +154,18 @@ build_openssl()
152154
popd || exit
153155
}
154156

157+
build_vdso()
158+
{
159+
lib='vdso'
160+
pushd "${WDL_SOURCE}"
161+
clone $lib || echo "Failed to clone $lib"
162+
cd "$lib/vdso_bench" || exit
163+
make -j
164+
cp ./vdso_bench "${WDL_ROOT}/" || exit
165+
166+
popd || exit
167+
}
168+
155169

156170
##################### BUILD AND INSTALL #########################
157171

@@ -161,6 +175,7 @@ build_folly
161175
build_fbthrift
162176
build_lzbench
163177
build_openssl
178+
build_vdso
164179

165180
folly_benchmark_list="concurrency_concurrent_hash_map_bench hash_hash_benchmark hash_maps_bench stats_digest_builder_benchmark fibers_fibers_benchmark lt_hash_benchmark memcpy_benchmark memset_benchmark event_base_benchmark iobuf_benchmark function_benchmark random_benchmark small_locks_benchmark range_find_benchmark"
166181

packages/wdl_bench/parse_line.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,12 @@ def parse_line_openssl(f, sum_c):
121121
sum_c[name + " 1KB: KB/s"] = float(elements[4][:-1])
122122
sum_c[name + " 8KB: KB/s"] = float(elements[5][:-1])
123123
sum_c[name + " 16KB: KB/s"] = float(elements[6][:-1])
124+
125+
126+
def parse_line_vdso_bench(f, sum_c):
127+
for line in f:
128+
elements = line.split()
129+
if re.search("Number", elements[0]):
130+
name = elements[4]
131+
value = float(elements[7])
132+
sum_c[name + ": M/s"] = value

packages/wdl_bench/run.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ main() {
142142
run_allcore "$name" "$algo"
143143
fi
144144

145+
elif [ "$name" = "vdso_bench" ]; then
146+
run_list=$name
147+
if [ "$run_type" = "multi_thread" ]; then
148+
./vdso_bench -t 10 -p 20 > "out_${name}".txt
149+
elif [ "$run_type" = "single_core" ]; then
150+
./vdso_bench -t 10 -p 1 > "out_${name}".txt
151+
fi
152+
145153
elif [ "$name" != "none" ]; then
146154
run_list=$name
147155
if [ "$name" = "small_locks_benchmark" ] || [ "$name" = "iobuf_benchmark" ]; then

0 commit comments

Comments
 (0)