From 5915c8e562cf01e4686e8eec0409e151bb046146 Mon Sep 17 00:00:00 2001 From: Rayhaan Jaufeerally Date: Fri, 9 Oct 2026 00:07:46 +0200 Subject: [PATCH] profile: configure the peers and report the kernel's change counts The full-table profiling script took its peers as unconfigured ones under the permissive policy, which is not how a router is set up. Now it writes a peer block for each of them, with `expected_routes` set to the table's size, so that the default import policy and anything that sizes itself by the expected routes are in the measurement. The few bogon prefixes in the synthetic table are refused by that policy, as the output says. After the table is in, the script also prints `bgp_kernel_route_changes_total`, so that a run shows how many installs and removals the kernel was asked for and not only how many routes it ended up with. Co-Authored-By: Claude Fable 5.1 --- scripts/profile/full-table.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/profile/full-table.sh b/scripts/profile/full-table.sh index 930e297..e2b1935 100755 --- a/scripts/profile/full-table.sh +++ b/scripts/profile/full-table.sh @@ -78,14 +78,27 @@ peer ping -c 1 -W 2 192.0.2.254 > /dev/null || fail "the namespaces do not reach # An AS number that is in none of the synthetic paths: a route with the # daemon's own AS in its path is refused as a loop. +prefixes=$(( 1000000 / scale + 230000 / scale )) +routes=$(( prefixes * peers )) cat > "$out/daemon.textpb" <> "$out/daemon.textpb" <> "$out/daemon.textpb" fi @@ -100,9 +113,6 @@ status() { run curl -sf "http://127.0.0.1:8080/api/$1" | jq -r "$2"; } now() { date +%s.%N; } since() { echo "$(now) - $1" | bc; } -prefixes=$(( 1000000 / scale + 230000 / scale )) -routes=$(( prefixes * peers )) - sudo perf record -F "$freq" -g -o "$out/perf.data" -p "$daemon_pid" > "$out/perf.log" 2>&1 & perf_pid=$! sleep 1 @@ -136,6 +146,7 @@ if [ "$kernel" = 1 ]; then fi rss=$(awk '/VmRSS/ { printf "%.0f", $2 / 1024 }' "/proc/$daemon_pid/status") echo "daemon: $rss MiB resident with the table in" +run curl -sf http://127.0.0.1:8080/metrics | grep '^bgp_kernel_route_changes_total' | sed 's/^/kernel: /' sleep 1 sudo kill -INT "$perf_pid" wait "$perf_pid" || true