From: Matt Corallo Date: Sun, 10 Oct 2021 17:16:50 +0000 (+0000) Subject: Reduce bash CPU time for high-core-count machines in dropcount.sh X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=dc5a8c8f1d9227f4741a57dee92e326302ec062d;p=flowspec-xdp Reduce bash CPU time for high-core-count machines in dropcount.sh --- diff --git a/dropcount.sh b/dropcount.sh index 541dd30..5f15b5e 100755 --- a/dropcount.sh +++ b/dropcount.sh @@ -17,7 +17,7 @@ fi CNT=0 } MAP_CONTENTS="$(bpftool map show | grep drop_cnt_map | awk '{ print $1 }' | tr -d ':' | while read IF; do - bpftool map dump id "$IF" + bpftool map dump id "$IF" | grep "bytes\|packets\|key" | grep -v '\(bytes\|packets\)": 0\(,\)*$' done)" echo "$MAP_CONTENTS" | { declare -a BYTES