From 0a2ed2e49842d49518b5401e7ede4fdc0e638328 Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Wed, 5 Dec 2018 14:52:59 +0800 Subject: [PATCH] add profiling support for sdk --- sdk/android-ios/sdk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/android-ios/sdk.go b/sdk/android-ios/sdk.go index a11a45a..6da6253 100644 --- a/sdk/android-ios/sdk.go +++ b/sdk/android-ios/sdk.go @@ -483,11 +483,11 @@ func Version() string { return SDK_VERSION } func StartProfiling(storePath string) { - if isProfiling { + if !isProfiling { + isProfiling = true if storePath == "" { storePath = "." } - isProfiling = true cpuProfilingFile, _ = os.Create(filepath.Join(storePath, "cpu.prof")) memProfilingFile, _ = os.Create(filepath.Join(storePath, "memory.prof")) blockProfilingFile, _ = os.Create(filepath.Join(storePath, "block.prof"))