From 76c214bd00d235d870534df22e4d8bbeefcfe8e1 Mon Sep 17 00:00:00 2001 From: pengyiqiang Date: Mon, 11 Sep 2023 19:41:35 +0800 Subject: [PATCH] tools/showstack: add configurable rank parameters Signed-off-by: pengyiqiang --- tools/showstack.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/showstack.sh b/tools/showstack.sh index 57d74fb4a5..bc82c0ed65 100755 --- a/tools/showstack.sh +++ b/tools/showstack.sh @@ -29,10 +29,17 @@ function analyse() } if [[ $# == 0 ]]; then - echo "usage: $0 ..." + echo "usage: $0 ..." exit fi +rank=20 + +if [[ "$1" =~ ^[0-9]+$ ]]; then + rank=$1 + shift +fi + for dir in $@; do - analyse $dir 20 + analyse $dir $rank done