@@ -536,7 +536,7 @@ printStackOfThreads() {
536536 while read -r pid threadId pcpu user; do
537537 printf -v threadId0x ' %#x' " $threadId "
538538
539- (( idx++ ))
539+ (( idx++ > 0 )) && normalOutput
540540 local jstackFile=" $store_file_prefix $(( update_round_num + 1 )) _jstack_$pid "
541541 [ -f " $jstackFile " ] || {
542542 # shellcheck disable=SC2206
@@ -552,17 +552,14 @@ printStackOfThreads() {
552552 redOutput " [$idx ] Fail to jstack busy(${pcpu} %) thread($threadId /$threadId0x ) stack of java process($pid ) under user($user )."
553553 redOutput " User of java process($user ) is not current user($USER ), need sudo to rerun:"
554554 yellowOutput " sudo $( printCallingCommandLine) "
555- normalOutput
556555 continue
557556 fi || {
558557 redOutput " [$idx ] Fail to jstack busy(${pcpu} %) thread(${threadId} /${threadId0x} ) stack of java process(${pid} ) under user(${user} )."
559- normalOutput
560558 rm " $jstackFile " & > /dev/null
561559 continue
562560 }
563561 }
564562
565- (( idx > 1 )) && normalOutput
566563 blueOutput " [$idx ] Busy($pcpu %) thread($threadId /$threadId0x ) stack of java process($pid ) under user($user ):"
567564
568565 if [ -n " $mix_native_frames " ]; then
0 commit comments