-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bench/nfvconfig] Added benchmark template for cperf.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# NOTE: Replace <PCIADDR> below with the pci address of an Intel 10G NIC | ||
# and replace <FIXTURE-[X|Y]> which the fixtures you want to benchmark. | ||
# | ||
# There is a reason for this Shell script being so weird | ||
# (by using `set -e' and `echo $out | ...'): | ||
# | ||
# If a benchmark script fails it MUST exit with a non-zero status. Thus | ||
# we make sure that the status returned reflects the benchmarks results | ||
# and NOT the commands that extract the desired portion of the benchmarks | ||
# output. (Last time I checked, even with `set -e ', a plain pipe will | ||
# exit with status 0 even if one of the commands does not). | ||
|
||
set -e | ||
|
||
out=$(sudo src/snabb src/designs/bench/nfvconfig <PCIADDR> \ | ||
src/test_fixtures/nfvconfig/<FIXTURE-X> \ | ||
src/test_fixtures/nfvconfig/<FIXTURE-Y> \ | ||
64) | ||
|
||
# Extract score from output. | ||
echo "$out" | grep "score" | cut -f 2 |