sched/dumpstack: Print "backtrace:" only in the first iteration

to avoid the same label print multiple time in one dumpstack

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-22 17:37:39 +08:00 committed by Masayuki Ishikawa
parent 23cfded18f
commit 0fcb4575bb

View File

@ -84,7 +84,11 @@ void sched_dumpstack(pid_t tid)
}
}
#else
syslog(LOG_EMERG, "backtrace:\n");
if (skip == 0)
{
syslog(LOG_EMERG, "backtrace:\n");
}
for (i = 0; i < size; i++)
{
syslog(LOG_EMERG, "[%2d] [<%p>] %pS\n",