Skip to content

Commit

Permalink
freebsd: Disable options needing research, ticks [4.5-alpha-1]
Browse files Browse the repository at this point in the history
  • Loading branch information
freebsdfrau committed May 14, 2020
1 parent 4dbe0ba commit 9438e29
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions freebsd/nfsdtop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# $Title: Script to generate top-like statistics for nfsd I/O $
# $Copyright: 2020 Devin Teske. All rights reserved. $
# $FrauBSD: nfsdtop/freebsd/nfsdtop 2020-05-13 20:09:27 -0700 freebsdfrau $
# $FrauBSD: nfsdtop/freebsd/nfsdtop 2020-05-13 20:29:50 -0700 freebsdfrau $
#
############################################################ INFORMATION
#
Expand Down Expand Up @@ -45,7 +45,7 @@ DEFAULT_IP_MAP=.nfsd.hosts

############################################################ GLOBALS

VERSION='$Version: 4.5-alpha-0 $'
VERSION='$Version: 4.5-alpha-1 $'

pgm="${0##*/}" # Program basename

Expand Down Expand Up @@ -121,20 +121,21 @@ usage()
printf "Options:\n"
printf "$optfmt" "-a" "Always enable color."
printf "$optfmt" "-b" "Show bytes instead of bandwidth."
printf "$optfmt" "-C ip" "Client filter (IPv4 only)."
#? printf "$optfmt" "-C ip" "Client filter (IPv4 only)."
printf "$optfmt" "-c" "View read/write activity by client."
printf "$optfmt" "-D" "Enable debugger."
printf "$optfmt" "-d" "Debug. Print dtrace script and exit."
printf "$optfmt" "-F regex" "File filter. Implies \`-f'."
printf "$optfmt" "-f" \
"View read/write activity by file. Implies \`-w'."
#? printf "$optfmt" "-F regex" "File filter. Implies \`-f'."
#? printf "$optfmt" "-f" \
#? "View read/write activity by file. Implies \`-w'."
printf "$optfmt" "-G group" "Group filter (name or id)."
printf "$optfmt" "-g" "View read/write activity by group."
printf "$optfmt" "-h" "Print usage statement and exit."
printf "$optfmt" "-I file" "IP map file. Default \`$DEFAULT_IP_MAP'."
printf "$optfmt" "-i sec" \
"Set interval seconds. Default \`$DEFAULT_INTERVAL'."
printf "$optfmt" "-J" "Output most JSON data. Same as \`-jcgsu'."
#? printf "$optfmt" "-J" "Output most JSON data. Same as \`-jcgsu'."
printf "$optfmt" "-J" "Output most JSON data. Same as \`-jcgu'."
printf "$optfmt" "-j" "Output JSON formatted data."
printf "$optfmt" "-N num" "Perform num samples and exit."
printf "$optfmt" "-n" "Do not attempt to map uid/gid/ip to names."
Expand All @@ -143,8 +144,8 @@ usage()
printf "$optfmt" "-p file" \
"User map file. Default \`$DEFAULT_PASSWD_MAP'."
printf "$optfmt" "-r" "Raw view. Do not format output of dtrace."
printf "$optfmt" "-S ip" "Server filtter (IPv4 only)."
printf "$optfmt" "-s" "View read/write activity by server."
#? printf "$optfmt" "-S ip" "Server filtter (IPv4 only)."
#? printf "$optfmt" "-s" "View read/write activity by server."
printf "$optfmt" "-U user" "User filter (name or id)."
printf "$optfmt" "-u" "View read/write activity by user (default)."
printf "$optfmt" "-v" "Print version and exit."
Expand Down Expand Up @@ -234,16 +235,17 @@ resize()
#
# Process command-line options
#
while getopts abC:cDdF:fG:ghi:JjN:nP:p:rS:sU:uvw flag; do
#?while getopts abC:cDdF:fG:ghi:JjN:nP:p:rS:sU:uvw flag; do
while getopts abcDdG:ghi:JjN:nP:p:rU:uvw flag; do
case "$flag" in
a) COLOR=1 ;;
b) SHOW_BYTES=1 ;;
C) FILTER_CLIENT="$OPTARG" ;;
#? C) FILTER_CLIENT="$OPTARG" ;;
c) VIEW=CLIENT VIEW_CLIENT=1 ;;
D) DEBUGGER=1 RAW_VIEW=1 ;;
d) DEBUG=1 RAW_VIEW=1 ;;
F) VIEW=FILE VIEW_FILE=1 WIDE_VIEW=1 FILTER_FILE="$OPTARG" ;;
f) VIEW=FILE VIEW_FILE=1 WIDE_VIEW=1 ;;
#? F) VIEW=FILE VIEW_FILE=1 WIDE_VIEW=1 FILTER_FILE="$OPTARG" ;;
#? f) VIEW=FILE VIEW_FILE=1 WIDE_VIEW=1 ;;
G) FILTER_GROUP="$OPTARG" ;;
g) VIEW=GROUP VIEW_GROUP=1 ;;
i) INTERVAL="$OPTARG" ;;
Expand All @@ -256,8 +258,8 @@ while getopts abC:cDdF:fG:ghi:JjN:nP:p:rS:sU:uvw flag; do
P) GROUP_MAP="$OPTARG" ;;
p) PASSWD_MAP="$OPTARG" ;;
r) RAW_VIEW=1 ;;
S) FILTER_SERVER="$OPTARG" ;;
s) VIEW=SERVER VIEW_SERVER=1 ;;
#? S) FILTER_SERVER="$OPTARG" ;;
#? s) VIEW=SERVER VIEW_SERVER=1 ;;
U) FILTER_USER="$OPTARG" ;;
u) VIEW=USER VIEW_USER=1 ;;
v) VERSION="${VERSION#*: }"
Expand Down Expand Up @@ -289,9 +291,9 @@ fi
if [ ! "$OUTPUT_JSON" ]; then
case "$VIEW" in # ST: VIEWS
CLIENT) VIEW_FILE= VIEW_GROUP= VIEW_SERVER= VIEW_USER= ;;
FILE) VIEW_CLIENT= VIEW_GROUP= VIEW_SERVER= VIEW_USER= ;;
#? FILE) VIEW_CLIENT= VIEW_GROUP= VIEW_SERVER= VIEW_USER= ;;
GROUP) VIEW_CLIENT= VIEW_FILE= VIEW_SERVER= VIEW_USER= ;;
SERVER) VIEW_CLIENT= VIEW_FILE= VIEW_GROUP= VIEW_USER= ;;
#? SERVER) VIEW_CLIENT= VIEW_FILE= VIEW_GROUP= VIEW_USER= ;;
USER) VIEW_CLIENT= VIEW_FILE= VIEW_GROUP= VIEW_SERVER= ;;
esac
fi
Expand Down Expand Up @@ -326,11 +328,11 @@ case "$INTERVAL" in
""|0) die "-i sec must be at least 0.001" ;;
esac

INTERVAL_PROBE=interval:ms:$ms
INTERVAL_PROBE=profile:::tick-${ms}ms
;;
*)
INTERVAL_SECONDS=$INTERVAL
INTERVAL_PROBE=interval:s:$INTERVAL_SECONDS
INTERVAL_PROBE=profile:::tick-${INTERVAL_SECONDS}s
esac

#
Expand Down

0 comments on commit 9438e29

Please sign in to comment.