From 02a1c7ac6b4c1a1b49ddcf48860dc9d30bbeb265 Mon Sep 17 00:00:00 2001 From: Jie Zhou Date: Thu, 23 Mar 2023 11:30:42 +0800 Subject: [PATCH] enable uperf test suite Link: https://github.com/intel/lkp-tests/issues/205 Signed-off-by: Jie Zhou --- daemon/uperf-server | 11 ++++++++ distro/adaptation-pkg/amazon_linux | 1 + distro/adaptation-pkg/centos | 1 + distro/adaptation-pkg/debian | 1 + distro/adaptation-pkg/exaleap-riscv-linux | 1 + distro/adaptation-pkg/fedora | 1 + distro/adaptation-pkg/ubuntu | 1 + etc/index-perf-all.yaml | 1 + etc/index-perf.yaml | 1 + jobs/uperf.yaml | 31 +++++++++++++++++++++++ lib/stats.rb | 2 +- programs/uperf/meta.yaml | 24 ++++++++++++++++++ programs/uperf/parse | 29 +++++++++++++++++++++ programs/uperf/pkg/PKGBUILD | 18 +++++++++++++ programs/uperf/pkg/depends | 1 + programs/uperf/pkg/depends-dev | 2 ++ programs/uperf/run | 16 ++++++++++++ programs/uperf/uperf_web.xml | 16 ++++++++++++ spec/stats/uperf/01 | 21 +++++++++++++++ spec/stats/uperf/01.yaml | 6 +++++ spec/stats/uperf/02 | 28 ++++++++++++++++++++ spec/stats/uperf/02.yaml | 6 +++++ 22 files changed, 218 insertions(+), 1 deletion(-) create mode 100755 daemon/uperf-server create mode 100644 jobs/uperf.yaml create mode 100644 programs/uperf/meta.yaml create mode 100755 programs/uperf/parse create mode 100644 programs/uperf/pkg/PKGBUILD create mode 100644 programs/uperf/pkg/depends create mode 100644 programs/uperf/pkg/depends-dev create mode 100755 programs/uperf/run create mode 100644 programs/uperf/uperf_web.xml create mode 100644 spec/stats/uperf/01 create mode 100644 spec/stats/uperf/01.yaml create mode 100644 spec/stats/uperf/02 create mode 100644 spec/stats/uperf/02.yaml diff --git a/daemon/uperf-server b/daemon/uperf-server new file mode 100755 index 000000000..1efbe4a47 --- /dev/null +++ b/daemon/uperf-server @@ -0,0 +1,11 @@ +#!/bin/sh + +. $LKP_SRC/lib/reproduce-log.sh + +uperf_path=$BENCHMARK_ROOT/uperf/usr/local/bin/uperf +[ -f "$uperf_path" ] || die "can not find $uperf_path" + +export PATH=$BENCHMARK_ROOT/uperf/usr/local/bin:$PATH + +# start uperf server +log_eval "uperf -s &" diff --git a/distro/adaptation-pkg/amazon_linux b/distro/adaptation-pkg/amazon_linux index ddec8d751..4047cd8f2 100644 --- a/distro/adaptation-pkg/amazon_linux +++ b/distro/adaptation-pkg/amazon_linux @@ -20,6 +20,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: igt:: iozone:: diff --git a/distro/adaptation-pkg/centos b/distro/adaptation-pkg/centos index dd6060aaa..41283b658 100644 --- a/distro/adaptation-pkg/centos +++ b/distro/adaptation-pkg/centos @@ -19,6 +19,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: iozone:: intel-ipsec-mb:: diff --git a/distro/adaptation-pkg/debian b/distro/adaptation-pkg/debian index 3f02326c2..2d2c4a313 100644 --- a/distro/adaptation-pkg/debian +++ b/distro/adaptation-pkg/debian @@ -20,6 +20,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: igt:: iozone:: diff --git a/distro/adaptation-pkg/exaleap-riscv-linux b/distro/adaptation-pkg/exaleap-riscv-linux index aca784317..66a86c56b 100644 --- a/distro/adaptation-pkg/exaleap-riscv-linux +++ b/distro/adaptation-pkg/exaleap-riscv-linux @@ -20,6 +20,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: iozone:: kbuild:: diff --git a/distro/adaptation-pkg/fedora b/distro/adaptation-pkg/fedora index 36013cf17..12d2f4f9c 100644 --- a/distro/adaptation-pkg/fedora +++ b/distro/adaptation-pkg/fedora @@ -18,6 +18,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: iozone:: kbuild:: diff --git a/distro/adaptation-pkg/ubuntu b/distro/adaptation-pkg/ubuntu index fd5b3d68a..14a9ff687 100644 --- a/distro/adaptation-pkg/ubuntu +++ b/distro/adaptation-pkg/ubuntu @@ -19,6 +19,7 @@ ftq:: fwq:: fxmark:: hackbench:: +uperf:: hwsim:: iozone:: intel-ipsec-mb:: diff --git a/etc/index-perf-all.yaml b/etc/index-perf-all.yaml index 232346a4f..e4bb1d08a 100644 --- a/etc/index-perf-all.yaml +++ b/etc/index-perf-all.yaml @@ -26,6 +26,7 @@ fwq\.fwq\.min: 1 fxmark\..+\.works\/sec: 1 glbenchmark\.fps: 1 hackbench\.throughput: 1 +uperf\..+bps: 1 hpcc\.HPL_Tflops: 1 hpcc\.PTRANS_GBs: 1 iostat\..+\.wkB\/s: 1 diff --git a/etc/index-perf.yaml b/etc/index-perf.yaml index c5e5107ac..d5bee59d2 100644 --- a/etc/index-perf.yaml +++ b/etc/index-perf.yaml @@ -16,6 +16,7 @@ ftrace-onoff\.ops: 1 fwq\.counts: 1 glbenchmark\.fps: 1 hackbench\.throughput: 1 +uperf\..+bps: 1 iostat\..+\.wkB\/s: 1 iozone\.average_KBps: 1 iperf\..+\.bps: 1 diff --git a/jobs/uperf.yaml b/jobs/uperf.yaml new file mode 100644 index 000000000..9d0fba940 --- /dev/null +++ b/jobs/uperf.yaml @@ -0,0 +1,31 @@ +suite: uperf +testcase: uperf +category: benchmark + +# upto 90% CPU cycles may be used by latency stats +disable_latency_stats: 1 + +set_nic_irq_affinity: 1 + +runtime: 30s +nr_threads: + - 1 + +cluster: cs-localhost + +if role server: + uperf-server: + +if role client: + uperf: + test: + - uperf + +protocol: + - TCP + - UDP + - SCTP +winsize: + - 32k +datasize: + - 64 diff --git a/lib/stats.rb b/lib/stats.rb index 23917a19a..79678f720 100755 --- a/lib/stats.rb +++ b/lib/stats.rb @@ -40,7 +40,7 @@ class LinuxTestcasesTableSet LINUX_PERF_TESTCASES = %w[aim7 aim9 angrybirds blogbench dbench dd-write ebizzy fileio fishtank fsmark glbenchmark - hackbench hpcc idle iozone iperf jsbenchmark kbuild + hackbench uperf hpcc idle iozone iperf jsbenchmark kbuild ku-latency linpack mlc nepim netperf netpipe nuttcp octane oltp openarena pbzip2 rcurefscale perf-bench-numa-mem perf-bench-sched-pipe pft diff --git a/programs/uperf/meta.yaml b/programs/uperf/meta.yaml new file mode 100644 index 000000000..e419c2e24 --- /dev/null +++ b/programs/uperf/meta.yaml @@ -0,0 +1,24 @@ +short_description: > + uperf is a network performance tool that supports modelling and replay of various networking patterns. + +description: | + uperf represents a new kind of benchmarking tool (like filebench) where instead of + running a fixed benchmark or workload, a description (or model) of the workload is + provided and the tool generates the load according to the model. By distilling the + benchmark or workload into a model, you can now do various things like change the + scale of the workload, change different parameters, change protocols, etc and + analyse the effect of these changes on your model. You can also study the effect + of interleaving CPU activity, or think times or the use of SSL instead of TCP + among many other things. + +homepage: https://github.com/uperf/uperf + +parameters: + nr_threads: number of threads + protocol: transport protocol and can be "tcp", "udp" or "sctp" + winsize: window size + runtime: duration of the run + datasize: read/write message size + +results: + uperf.throughput: unit-Mb/s diff --git a/programs/uperf/parse b/programs/uperf/parse new file mode 100755 index 000000000..79542ea3d --- /dev/null +++ b/programs/uperf/parse @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME))) + +while (line = $stdin.gets) + case line + when /Netstat statistics for this run/ + @runtest = 'Netstat' + when /Run Statistics/ + @runtest = 'Runstat' + when /(\S+)\s+\d+\s+\d+\s+(.+)([KM][Bb]\/s)\s+(.+)([KM][Bb]\/s)/ + # ens1 2 2 4.65Kb/s 1.21Kb/s + netcard = $1 + outstat = $2 + outunit = $3.to_s.strip.tr('/', 'p') + instat = $4 + inunit = $5.to_s.strip.tr('/', 'p') + if @runtest =~ /Netstat/ + puts "Netstat_#{netcard}_out_#{outunit}: #{outstat}" + puts "Netstat_#{netcard}_in_#{inunit}: #{instat}" + end + when /(\S+)\s+\S+\s+\S+\s+(.+)([KM][Bb]\/s)\s+\d+\s+\d+/ + # master 32.34s 259.89MB 67.42Mb/s 3027910 0.00 + hostname = $1 + outstat = $2 + outunit = $3.to_s.strip.tr('/', 'p') + puts "Runstat_#{hostname}_#{outunit}: #{outstat}" unless @runtest !~ /Runstat/ + end +end diff --git a/programs/uperf/pkg/PKGBUILD b/programs/uperf/pkg/PKGBUILD new file mode 100644 index 000000000..4dda698cd --- /dev/null +++ b/programs/uperf/pkg/PKGBUILD @@ -0,0 +1,18 @@ +pkgname=uperf +pkgver=git +pkgrel=1 +arch=('i386' 'x86_64' 'aarch64') +license=('GPL') +source=("https://github.com/uperf/uperf.git") +sha256sums=('SKIP') + +build() { + cd "$srcdir/$pkgname" || return + autoreconf --install && ./configure && make +} + +package() { + mkdir -p "${pkgdir}/lkp/benchmarks/${pkgname}" + cd "$srcdir/$pkgname" || return + make install DESTDIR="${pkgdir}/lkp/benchmarks/${pkgname}" +} diff --git a/programs/uperf/pkg/depends b/programs/uperf/pkg/depends new file mode 100644 index 000000000..a70388627 --- /dev/null +++ b/programs/uperf/pkg/depends @@ -0,0 +1 @@ +libsctp1 diff --git a/programs/uperf/pkg/depends-dev b/programs/uperf/pkg/depends-dev new file mode 100644 index 000000000..6176f8547 --- /dev/null +++ b/programs/uperf/pkg/depends-dev @@ -0,0 +1,2 @@ +autoconf +libsctp-dev diff --git a/programs/uperf/run b/programs/uperf/run new file mode 100755 index 000000000..83b7d73c3 --- /dev/null +++ b/programs/uperf/run @@ -0,0 +1,16 @@ +#!/bin/sh +# - nr_threads +# - protocol +# - winsize +# - runtime +# - datasize + +run_uperf() +{ + local uperf_path + uperf_path=/lkp/benchmarks/uperf/usr/local/bin/uperf + [ -f "$uperf_path" ] || die "can not find $uperf_path" + log_cmd $uperf_path -m $LKP_SRC/programs/uperf/uperf_web.xml +} + +run_uperf diff --git a/programs/uperf/uperf_web.xml b/programs/uperf/uperf_web.xml new file mode 100644 index 000000000..894807c69 --- /dev/null +++ b/programs/uperf/uperf_web.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/spec/stats/uperf/01 b/spec/stats/uperf/01 new file mode 100644 index 000000000..cbe5aba42 --- /dev/null +++ b/spec/stats/uperf/01 @@ -0,0 +1,21 @@ +Starting 1 threads running profile:netperf ... 0.00 seconds +Txn1 0 / 1.00(s) = 0 1op/s +Txn2 259.89M / 30.23(s) = 72.11Mb/s 100153op/s +Txn3 0 / 0.00(s) = 0 0op/s +--------------------------------------------------------------------------------------------------------------------- +Total 259.89M / 32.34(s) = 67.42Mb/s 93638op/s + +Netstat statistics for this run +--------------------------------------------------------------------------------------------------------------------- +Nic opkts/s ipkts/s obits/s ibits/s +lo 93638 93638 106.37Mb/s 106.37Mb/s +ens1 2 2 4.65Kb/s 1.21Kb/s +--------------------------------------------------------------------------------------------------------------------- + +Run Statistics +Hostname Time Data Throughput Operations Errors +--------------------------------------------------------------------------------------------------------------------- +127.0.0.1 32.34s 259.89MB 67.42Mb/s 3027910 0.00 +master 32.34s 259.89MB 67.42Mb/s 3027910 0.00 +--------------------------------------------------------------------------------------------------------------------- +Difference(%) -0.00% 0.00% 0.00% 0.00% 0.00% diff --git a/spec/stats/uperf/01.yaml b/spec/stats/uperf/01.yaml new file mode 100644 index 000000000..8f9a203cd --- /dev/null +++ b/spec/stats/uperf/01.yaml @@ -0,0 +1,6 @@ +Netstat_lo_out_Mbps: 106.37 +Netstat_lo_in_Mbps: 106.37 +Netstat_ens1_out_Kbps: 4.65 +Netstat_ens1_in_Kbps: 1.21 +Runstat_127.0.0.1_Mbps: 67.42 +Runstat_master_Mbps: 67.42 diff --git a/spec/stats/uperf/02 b/spec/stats/uperf/02 new file mode 100644 index 000000000..1087660d3 --- /dev/null +++ b/spec/stats/uperf/02 @@ -0,0 +1,28 @@ +Starting 1 threads running profile:netperf ... 0.00 seconds +Txn1 0 / 1.00(s) = 0 1op/s +Txn2 197.80M / 30.23(s) = 54.89Mb/s 107204op/s +Txn3 0 / 0.00(s) = 0 0op/s +--------------------------------------------------------------------------------------------------------------------- +Total 197.80M / 32.33(s) = 51.32Mb/s 100228op/s +** Warning: Send buffer: 64.00KB (Requested:32.00KB) +** Warning: Recv buffer: 64.00KB (Requested:32.00KB) + +Netstat statistics for this run +--------------------------------------------------------------------------------------------------------------------- +Nic opkts/s ipkts/s obits/s ibits/s +lo 100228 100228 93.01Mb/s 93.01Mb/s +ens1 2 3 8.10Kb/s 1.60Kb/s +--------------------------------------------------------------------------------------------------------------------- + +Run Statistics +Hostname Time Data Throughput Operations Errors +--------------------------------------------------------------------------------------------------------------------- +127.0.0.1 32.33s 197.80MB 51.32Mb/s 3240816 0.00 +master 32.33s 197.80MB 51.32Mb/s 3240816 0.00 +--------------------------------------------------------------------------------------------------------------------- +Difference(%) -0.00% 0.00% 0.00% 0.00% 0.00% + +** Warning: Send buffer: 64.00KB (Requested:32.00KB) +** Warning: Recv buffer: 64.00KB (Requested:32.00KB) +** [127.0.0.1] Warning: Send buffer: 64.00KB (Requested:32.00KB) +Warning: Recv buffer: 64.00KB (Requested:32.00KB) diff --git a/spec/stats/uperf/02.yaml b/spec/stats/uperf/02.yaml new file mode 100644 index 000000000..aac9be88e --- /dev/null +++ b/spec/stats/uperf/02.yaml @@ -0,0 +1,6 @@ +Netstat_lo_out_Mbps: 93.01 +Netstat_lo_in_Mbps: 93.01 +Netstat_ens1_out_Kbps: 8.10 +Netstat_ens1_in_Kbps: 1.60 +Runstat_127.0.0.1_Mbps: 51.32 +Runstat_master_Mbps: 51.32