执行hiprofiler_cmd -k 时停止native_daemon sa 服务

Signed-off-by: wenlong_12 <wenlong12@huawei.com>
This commit is contained in:
wenlong_12 2024-01-02 03:10:46 +00:00 committed by Gitee
parent 03f5efdd57
commit e2ed8ae6a8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -461,6 +461,9 @@ bool CheckProcessExit(const std::string& processName, int& pid)
void KillDependentProcess()
{
constexpr int waitProcMills = 300;
OHOS::system::SetParameter("hiviewdfx.hiprofiler.memprofiler.start", "0");
std::this_thread::sleep_for(std::chrono::milliseconds(waitProcMills));
if (getuid() == 0) {
// if pid is equal to -1, need to get pid first.
if (g_nativeDaemonPid == -1) {