]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CONTRIB: debug: add the show-fd-to-flags script
authorWilly Tarreau <w@1wt.eu>
Fri, 2 Apr 2021 11:40:03 +0000 (13:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Apr 2021 15:48:42 +0000 (17:48 +0200)
This script reads the output of a "show fd" command and for each line
showing a connection, will decode its flags by calling "flags".

contrib/debug/show-fd-to-flags.sh [new file with mode: 0755]

diff --git a/contrib/debug/show-fd-to-flags.sh b/contrib/debug/show-fd-to-flags.sh
new file mode 100755 (executable)
index 0000000..29757c3
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+awk '{print $12}' | grep cflg= | sort | uniq -c | sort -nr | while read a b; do c=${b##*=}; d=$(${0%/*}/flags conn $c);d=${d##*= }; printf "%6d %s    %s\n" $a "$b" "$d";done