diff --git a/device/BUILD.gn b/device/BUILD.gn index a75a390d23ef794e75675c2e387f51d1926e076c..4f935c37e720e3bbe8497d66ffd9135e206f9236 100755 --- a/device/BUILD.gn +++ b/device/BUILD.gn @@ -35,7 +35,7 @@ group("hiprofiler_targets") { "services/profiler_service:hiprofilerd", "services/shared_memory:shared_memory", ] - if (is_ohos) { + if (is_ohos && use_musl) { deps += [ "plugins/native_daemon:native_daemon", "plugins/native_hook:native_hook", @@ -61,7 +61,7 @@ group("unittest") { "services/profiler_service/test:unittest", "services/shared_memory/test:unittest", ] - if (is_ohos) { + if (is_ohos && use_musl) { deps += [ "plugins/native_daemon/test:unittest", "plugins/native_hook/test:unittest", diff --git a/device/plugins/native_daemon/src/hook_manager.cpp b/device/plugins/native_daemon/src/hook_manager.cpp index 18392eb064cff9ed8628905e4311c87c4b195ee0..2186468e5ee5a216d50606059b9177205944ff8a 100755 --- a/device/plugins/native_daemon/src/hook_manager.cpp +++ b/device/plugins/native_daemon/src/hook_manager.cpp @@ -34,11 +34,11 @@ void HookManager::writeFrames(int type, const struct timespec& ts, void* addr, u const std::vector& callsFrames) { if (type == 0) { - fprintf(fpHookData_.get(), "malloc;%" PRId64 ";%ld;0x%" PRIx64 ";%u\n", ts.tv_sec, ts.tv_nsec, - (uint64_t)addr, mallocSize); + fprintf(fpHookData_.get(), "malloc;%" PRId64 ";%ld;0x%" PRIx64 ";%u\n", + (int64_t)ts.tv_sec, ts.tv_nsec, (uint64_t)addr, mallocSize); } else if (type == 1) { - fprintf(fpHookData_.get(), "free;%" PRId64 ";%ld;0x%" PRIx64 "\n", ts.tv_sec, ts.tv_nsec, - (uint64_t)addr); + fprintf(fpHookData_.get(), "free;%" PRId64 ";%ld;0x%" PRIx64 "\n", + (int64_t)ts.tv_sec, ts.tv_nsec, (uint64_t)addr); } else { return; } diff --git a/device/plugins/native_daemon/src/hook_standalone.cpp b/device/plugins/native_daemon/src/hook_standalone.cpp index 6fe51ce4a67fb1cbb8c2762798b00efff82ca1e4..c60e8aea3fcf13bad2e073b9ced15b095ef6822d 100755 --- a/device/plugins/native_daemon/src/hook_standalone.cpp +++ b/device/plugins/native_daemon/src/hook_standalone.cpp @@ -41,11 +41,11 @@ void writeFrames(int type, const struct timespec& ts, void* addr, uint32_t mallo const std::vector& callsFrames) { if (type == 0) { - fprintf(g_fpHookFile.get(), "malloc;%" PRId64 ";%ld;0x%" PRIx64 ";%u\n", ts.tv_sec, ts.tv_nsec, - (uint64_t)addr, mallocSize); + fprintf(g_fpHookFile.get(), "malloc;%" PRId64 ";%ld;0x%" PRIx64 ";%u\n", + (int64_t)ts.tv_sec, ts.tv_nsec, (uint64_t)addr, mallocSize); } else if (type == 1) { - fprintf(g_fpHookFile.get(), "free;%" PRId64 ";%ld;0x%" PRIx64 "\n", ts.tv_sec, ts.tv_nsec, - (uint64_t)addr); + fprintf(g_fpHookFile.get(), "free;%" PRId64 ";%ld;0x%" PRIx64 "\n", + (int64_t)ts.tv_sec, ts.tv_nsec, (uint64_t)addr); } else { return; } @@ -195,4 +195,4 @@ bool StartHook(HookData& hookData) } // namespace Hook } // namespace Profiler } // namespace Developtools -} // namespace OHOS \ No newline at end of file +} // namespace OHOS