summaryrefslogtreecommitdiff
path: root/samples/bpf/lwt_len_hist.sh
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2023-01-15 10:16:05 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-01-16 00:32:45 +0300
commitf20f064e84eb9c9229a7044e30f9b99720a8c2ea (patch)
treea854809a4c4a57d218cc855dc202dd88bcecee65 /samples/bpf/lwt_len_hist.sh
parentd982a2e306954c9269a5e53561b38259e26f08bc (diff)
downloadlinux-f20f064e84eb9c9229a7044e30f9b99720a8c2ea.tar.xz
samples/bpf: refactor BPF functionality testing scripts
Currently, some test scripts are experiencing minor errors related to executing tests. $ sudo ./test_cgrp2_sock.sh ./test_cgrp2_sock.sh: 22: test_cgrp2_sock: not found This problem occurs because the path to the execution target is not properly specified. Therefore, this commit solves this problem by specifying a relative path to its executables. This commit also makes a concise refactoring of hard-coded BPF program names. Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Link: https://lore.kernel.org/r/20230115071613.125791-3-danieltimlee@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/lwt_len_hist.sh')
-rwxr-xr-xsamples/bpf/lwt_len_hist.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/lwt_len_hist.sh b/samples/bpf/lwt_len_hist.sh
index 0eda9754f50b..ff7d1ba0f7ed 100755
--- a/samples/bpf/lwt_len_hist.sh
+++ b/samples/bpf/lwt_len_hist.sh
@@ -4,7 +4,7 @@
NS1=lwt_ns1
VETH0=tst_lwt1a
VETH1=tst_lwt1b
-
+BPF_PROG=lwt_len_hist_kern.o
TRACE_ROOT=/sys/kernel/debug/tracing
function cleanup {
@@ -30,7 +30,7 @@ ip netns exec $NS1 netserver
echo 1 > ${TRACE_ROOT}/tracing_on
cp /dev/null ${TRACE_ROOT}/trace
-ip route add 192.168.253.2/32 encap bpf out obj lwt_len_hist_kern.o section len_hist dev $VETH0
+ip route add 192.168.253.2/32 encap bpf out obj $BPF_PROG section len_hist dev $VETH0
netperf -H 192.168.253.2 -t TCP_STREAM
cat ${TRACE_ROOT}/trace | grep -v '^#'
./lwt_len_hist