aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-23 20:25:02 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-23 20:25:02 +0200
commit755b134fe958927deec84c0d945453cc0df215b1 (patch)
treeeeed0a0cf95f2efaa6276da52bebad3b44b133d8
parentc6d85babd9e60d830c347eb2650df10804ba7d40 (diff)
downloaddns-755b134fe958927deec84c0d945453cc0df215b1.tar.gz
scripts
-rwxr-xr-xscripts/analyze_dump.sh42
-rwxr-xr-xscripts/testzonefile.sh23
2 files changed, 65 insertions, 0 deletions
diff --git a/scripts/analyze_dump.sh b/scripts/analyze_dump.sh
new file mode 100755
index 0000000..1ccb800
--- /dev/null
+++ b/scripts/analyze_dump.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+binimg=build/dnsd
+
+# Today and yesterdays cores
+cores=$(find ./dumps/ -name '*.core' -mtime -1)
+
+for core in $cores
+do
+ gdblogfile="$core-gdb.log"
+ rm -f "$gdblogfile"
+
+ bininfo=$(ls -l $binimg)
+ coreinfo=$(ls -l "$core")
+
+ gdb -batch \
+ -ex "set logging file $gdblogfile" \
+ -ex "set logging on" \
+ -ex "set pagination off" \
+ -ex "printf \"**\n** Process info for $binimg - $core \n** Generated $(date)\n\"" \
+ -ex "printf \"**\n** $bininfo \n** $coreinfo\n**\n\"" \
+ -ex "file $binimg" \
+ -ex "core-file $core" \
+ -ex "bt" \
+ -ex "info proc" \
+ -ex "printf \"*\n* Libraries \n*\n\"" \
+ -ex "info sharedlib" \
+ -ex "printf \"*\n* Memory map \n*\n\"" \
+ -ex "info target" \
+ -ex "printf \"*\n* Registers \n*\n\"" \
+ -ex "info registers" \
+ -ex "printf \"*\n* Current instructions \n*\n\"" -ex "x/16i \$pc" \
+ -ex "printf \"*\n* Threads (full) \n*\n\"" \
+ -ex "info threads" \
+ -ex "bt" \
+ -ex "thread apply all bt full" \
+ -ex "printf \"*\n* Threads (basic) \n*\n\"" \
+ -ex "info threads" \
+ -ex "thread apply all bt" \
+ -ex "printf \"*\n* Done \n*\n\"" \
+ -ex "quit"
+done
diff --git a/scripts/testzonefile.sh b/scripts/testzonefile.sh
new file mode 100755
index 0000000..3b870dc
--- /dev/null
+++ b/scripts/testzonefile.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ "$1" = "test" ]; then
+ for i in $(seq 250); do
+ echo "$i"
+ for o in $(seq 10); do
+ HOST="t$i-$o.example.com."
+ dig -p 5333 +short "$HOST" @localhost > /dev/null &
+ done
+ sleep 1
+ done
+elif [ "$1" = gen ]; then
+ for i in $(seq 250); do
+ for o in $(seq 10); do
+ HOST="t$i-$o.example.com."
+ IP="10.10.$i.$o"
+
+ echo "$HOST 3600 IN A $IP"
+ done
+ done
+else
+ echo "Usage $0 gen|test"
+fi