From 2fb1640c5bbde597d38c99e94183ca51f95485ba Mon Sep 17 00:00:00 2001 From: "dongbosi@huawei.com" Date: Mon, 30 Dec 2024 20:58:32 +0800 Subject: [PATCH] read wchan if in linux Signed-off-by: dongbosi@huawei.com --- interfaces/innerkits/dump_catcher/dfx_dump_catcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/dump_catcher/dfx_dump_catcher.cpp b/interfaces/innerkits/dump_catcher/dfx_dump_catcher.cpp index 61691b6da..95d7f2589 100644 --- a/interfaces/innerkits/dump_catcher/dfx_dump_catcher.cpp +++ b/interfaces/innerkits/dump_catcher/dfx_dump_catcher.cpp @@ -664,7 +664,9 @@ void DfxDumpCatcher::CollectKernelStack(pid_t pid, int waitMilliSeconds) void DfxDumpCatcher::AsyncGetAllTidKernelStack(pid_t pid, int waitMilliSeconds) { ReadProcessStatus(halfProcStatus_, pid); - ReadProcessWchan(halfProcWchan_, pid, false, true); + if (IsLinuxKernel()) { + ReadProcessWchan(halfProcWchan_, pid, false, true); + } if (g_asyncThreadRunning) { DFXLOGI("pid(%{public}d) get kernel stack thread is running, not get pid(%{public}d)", g_kernelStackPid, pid); return; -- Gitee