From 872b64f5e35bb5a997f8ef7cea757389e248ce61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Sun, 25 Apr 2021 16:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!1565=20?= =?UTF-8?q?:=20=20profiling=20report=20data=20add=20lock'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ge/common/profiling/profiling_manager.cc | 3 +-- tests/ut/ge/profiling/ge_profiling_manager_unittest.cc | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index 7435b587..fbbf1f04 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -355,7 +355,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa reporter_data.deviceId = device_id; ret = memcpy_s(reporter_data.tag, MSPROF_ENGINE_MAX_TAG_LEN + 1, tag_name.c_str(), tag_name.size()); GE_IF_BOOL_EXEC(ret != EOK, GELOGE(ret, "Report data tag [%s] memcpy error!", tag_name.c_str()); return;); - std::lock_guard lock(mutex_); for (size_t i = 0; i < index; ++i) { reporter_data.data = (unsigned char *)data.c_str() + report_max_len * i; reporter_data.dataLen = report_max_len; @@ -376,7 +375,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa reporter_data.dataLen = data.size(); ret = memcpy_s(reporter_data.tag, MSPROF_ENGINE_MAX_TAG_LEN + 1, tag_name.c_str(), tag_name.size()); GE_IF_BOOL_EXEC(ret != EOK, GELOGE(ret, "Report data tag [%s] memcpy error!", tag_name.c_str()); return;); - std::lock_guard lock(mutex_); + cb_ret = CallMsprofReport(reporter_data); GE_IF_BOOL_EXEC(cb_ret != 0, GELOGE(cb_ret, "Reporter data [%s] failed, ret:%d", tag_name.c_str(), cb_ret); return;); diff --git a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc index 2da80b32..3dfbff41 100644 --- a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc +++ b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc @@ -78,9 +78,3 @@ TEST_F(UtestGeProfilinganager, plungin_init_) { EXPECT_EQ(ret, INTERNAL_ERROR); ProfilingManager::Instance().prof_cb_.msprofReporterCallback = nullptr; } - -TEST_F(UtestGeProfilinganager, report_data_) { - std::string data = "ge is better than tensorflow."; - std::string tag_name = "fmk"; - ProfilingManager::Instance().ReportData(0, data, tag_name); -} \ No newline at end of file