aboutsummaryrefslogtreecommitdiffstats
path: root/extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2025-03-03 16:19:01 -0500
committerDave Barach <vpp@barachs.net>2025-03-04 21:39:00 +0000
commitbf0146b21192cc8e97c7f3b5a427b8013b77c721 (patch)
tree1ca619ab6c0002c6e2d4d1e54554084898a41ef9 /extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh
parent75b66b374067ddfc4d9ed316d66250c4e60db985 (diff)
misc: add and consolidate host stack scripts
Move all existing host stack scripts under extras/scripts/host-stack Also add scripts for iperf/vcl performance testing Type: improvement Change-Id: Ia79b6bd061db49f61a0e4c6577cf45afe0323eb1 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh')
-rwxr-xr-xextras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh b/extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh
new file mode 100755
index 00000000000..a5d6be3dfee
--- /dev/null
+++ b/extras/scripts/host-stack/vcl-ldpreload/test/emacs_gdb_curl.sh
@@ -0,0 +1,33 @@
+#! /bin/bash
+
+if [ -z "$WS_ROOT" ] ; then
+ echo "ERROR: WS_ROOT environment variable is not set!"
+ exit 1
+fi
+
+source $WS_ROOT/extras/vcl-ldpreload/env.sh
+tmp_gdb_cmdfile="/tmp/gdb_cmdfile_curl.$$"
+
+trap "rm -f $tmp_gdb_cmdfile" SIGINT SIGTERM EXIT
+
+cat <<EOF > $tmp_gdb_cmdfile
+set confirm off
+source $WS_ROOT/extras/gdb/gdb_cmdfile.vpp
+set exec-wrapper env LD_PRELOAD=$VCL_LDPRELOAD_LIB_DIR/libvcl_ldpreload.so.0.0.0
+start
+EOF
+
+gdb_in_emacs() {
+ sudo -E emacs --eval "(gdb \"gdb -x $tmp_gdb_cmdfile -i=mi --args $*\")" --eval "(setq frame-title-format \"CURL-DEBUG (VCL-LDPRELOAD)\")"
+}
+
+# Extract nginx IPv4 address from docker bridge
+#
+nginx_addr=$(docker network inspect bridge | grep IPv4Address | awk -e '{print $2}' | sed -e 's,/16,,' -e 's,",,g' -e 's/,//')
+
+if [ -z "$nginx_addr" ] ; then
+ echo "ERROR: Unable to determine docker container address!"
+ exit 1
+fi
+
+gdb_in_emacs /usr/bin/curl http://$nginx_addr