From f44ec65856b781b078ca56ad7f8733e898d44c4f Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Fri, 22 Aug 2014 14:40:08 +0200 Subject: [PATCH] [bench/nfvconfig] Added benchmark template for cperf. --- .../cperf/benchmarks/nfvconfig-template | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/scripts/cperf/benchmarks/nfvconfig-template diff --git a/src/scripts/cperf/benchmarks/nfvconfig-template b/src/scripts/cperf/benchmarks/nfvconfig-template new file mode 100644 index 0000000000..e3b58bca3e --- /dev/null +++ b/src/scripts/cperf/benchmarks/nfvconfig-template @@ -0,0 +1,23 @@ +#!/bin/bash + +# NOTE: Replace below with the pci address of an Intel 10G NIC +# and replace 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 \ + src/test_fixtures/nfvconfig/ \ + src/test_fixtures/nfvconfig/ \ + 64) + +# Extract score from output. +echo "$out" | grep "score" | cut -f 2