From 14876e942cd310eda0f1e68e329ad9c6aad06730 Mon Sep 17 00:00:00 2001 From: ZouTao Date: Thu, 8 Jun 2023 09:56:49 +0800 Subject: [PATCH] tasktop: fix the counter of most stack. --- source/tools/detect/sched/tasktop/tasktop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/tools/detect/sched/tasktop/tasktop.c b/source/tools/detect/sched/tasktop/tasktop.c index 1d225756..f4314d67 100644 --- a/source/tools/detect/sched/tasktop/tasktop.c +++ b/source/tools/detect/sched/tasktop/tasktop.c @@ -74,7 +74,7 @@ const char argp_program_doc[] = " tasktop -e 10 # limit the d-stack no more than 10, default is " "20.\n" " tasktop -H # output time string, not timestamp." - " tasktop -f a.log # log to a.log.\n"; + " tasktop -f a.log # log to a.log.\n" " tasktop -e 10 # most record 10 d-task stack.\n"; static const struct argp_option opts[] = { @@ -1057,7 +1057,8 @@ static void group_by_stack(struct record_t* rec, FILE* dest, int d_num) { } if (!match) { - stack[empty_slot++] = s; + stack[empty_slot] = s; + counter[empty_slot++] = 1; } } -- Gitee