@@ -102,6 +102,7 @@ Output control:
102102 the specified java process.
103103 default from all java process.
104104 -c, --count <num> set the thread count to show, default is 5.
105+ set count 0 to show all threads.
105106 -a, --append-file <file> specifies the file to append output as log.
106107 -S, --store-dir <dir> specifies the directory for storing
107108 the intermediate files, and keep files.
@@ -306,7 +307,11 @@ findBusyJavaThreadsByPs() {
306307 echo " $ps_out " | logAndCat " ${ps_cmd_line[@]} " > " ${store_file_prefix} $(( i + 1 )) _ps"
307308 fi
308309
309- echo " $ps_out " | head -n " ${count} "
310+ if (( count > 0 )) ; then
311+ echo " $ps_out " | head -n " ${count} "
312+ else
313+ echo " $ps_out "
314+ fi
310315}
311316
312317# top with output field: thread id, %cpu
@@ -355,7 +360,7 @@ __complete_pid_user_by_ps() {
355360
356361 local idx=0 threadId pcpu
357362 while read threadId pcpu ; do
358- (( idx < count )) || break
363+ (( count <= 0 || idx < count )) || break
359364
360365 # output field: pid, threadId, pcpu, user
361366 local output_fields=" $( echo " $ps_out " |
0 commit comments