util name check
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Linux Kernel Programming, 2E
|
||||
# Simple wrapper script to try out stackcount[-bpfcc].
|
||||
# Lightly tested ONLY for Ubuntu x86_64...
|
||||
# TODO:
|
||||
# [ ] work properly on Fedora distro..
|
||||
#
|
||||
# For details, refer to the book, Ch 6.
|
||||
# (c) Kaiwan NB, MIT
|
||||
name=$(basename $0)
|
||||
set -euo pipefail
|
||||
SEP="--------------------------------------------------------------------------------"
|
||||
# Ubuntu specific name for BCC tool(s), adjust as required for other distros
|
||||
PRG=stackcount-bpfcc
|
||||
PRG=stackcount
|
||||
which ${PRG} >/dev/null 2>&1 || {
|
||||
which ${PRG}-bpfcc >/dev/null 2>&1 && PRG=stackcount-bpfcc || {
|
||||
echo "FATAL: requires stackcount[-bpfcc] to be installed."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
which ${PRG} >/dev/null
|
||||
[ $? -ne 0 ] && {
|
||||
echo "${name}: oops, ${PRG} not installed? aborting..."
|
||||
@@ -22,8 +34,13 @@ ${SEP}"
|
||||
eval ${1}
|
||||
}
|
||||
|
||||
HDR="${name}: NOTE: Lightly tested ONLY for Ubuntu x86_64
|
||||
(Patience please, it can take a while...)
|
||||
"
|
||||
echo "${HDR}"
|
||||
|
||||
echo "Running ping in the background..."
|
||||
ping altavista.com >/dev/null 2>&1 &
|
||||
ping yahoo.com >/dev/null 2>&1 &
|
||||
|
||||
cmd="sudo ${PRG} --regex 'net_[rt]x_action' --duration 3 --perpid --delimited 2>/dev/null"
|
||||
desc="Show net_rx_action() and net_tx_action() (the NET_RX_SOFTIRQ and NET_TX_SOFTIRQ softirq's) call stacks:"
|
||||
|
||||
Reference in New Issue
Block a user