From 8e11fb6cc00f0ab738f4bdf28d663dce90a99cb7 Mon Sep 17 00:00:00 2001 From: zhengyuanhua Date: Fri, 26 Mar 2021 15:12:47 +0800 Subject: [PATCH] sync profiling interface --- ge/common/profiling/profiling_manager.cc | 9 ++------- ge/common/profiling/profiling_manager.h | 2 -- third_party/fwkacllib/inc/toolchain/prof_callback.h | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index f604aeb8..e64f64a7 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -31,7 +31,6 @@ const char *const kFpPoint = "fp_point"; const char *const kBpPoint = "bp_point"; #ifdef DAVINCI_SUPPORT_PROFILING -const size_t kReportMaxLen = 1024; const int32_t kMaxDeviceNum = 256; const uint32_t kInteval = 2; const std::string kConfigNumsdev = "devNums"; @@ -293,10 +292,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa ReporterData reporter_data{}; int ret = -1; int32_t cb_ret = -1; - size_t report_max_len = kReportMaxLen; -#ifdef ONLY_COMPILE_OPEN_SRC - report_max_len = reporter_max_len_; -#endif + size_t report_max_len = reporter_max_len_; size_t index = data.size() / report_max_len; if (index >= 1) { reporter_data.deviceId = device_id; @@ -763,7 +759,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::Plugin GELOGE(INTERNAL_ERROR, "[Init][ProfilingReporter] profiling init failed, ret = %d.", cb_ret); return INTERNAL_ERROR; } -#ifdef ONLY_COMPILE_OPEN_SRC + cb_ret = prof_cb_.msprofReporterCallback( static_cast(MsprofReporterModuleId::MSPROF_MODULE_FRAMEWORK), static_cast(MsprofReporterCallbackType::MSPROF_REPORTER_DATA_MAX_LEN), @@ -773,7 +769,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::Plugin GELOGE(INTERNAL_ERROR, "[Init][ProfilingReporter] Get profiling reporter data max len failed, ret = %d.", cb_ret); return INTERNAL_ERROR; } -#endif return SUCCESS; } diff --git a/ge/common/profiling/profiling_manager.h b/ge/common/profiling/profiling_manager.h index 9dcc5dab..b34c74c3 100755 --- a/ge/common/profiling/profiling_manager.h +++ b/ge/common/profiling/profiling_manager.h @@ -119,9 +119,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager { MsprofCallback prof_cb_; std::string fp_point_; std::string bp_point_; -#ifdef ONLY_COMPILE_OPEN_SRC uint32_t reporter_max_len_ = 0; -#endif }; } // namespace ge #endif // GE_COMMON_PROFILING_PROFILING_MANAGER_H_ diff --git a/third_party/fwkacllib/inc/toolchain/prof_callback.h b/third_party/fwkacllib/inc/toolchain/prof_callback.h index 3fad74bc..18550157 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_callback.h +++ b/third_party/fwkacllib/inc/toolchain/prof_callback.h @@ -74,6 +74,7 @@ enum MsprofReporterCallbackType { MSPROF_REPORTER_REPORT = 0, // report data MSPROF_REPORTER_INIT, // init reporter MSPROF_REPORTER_UNINIT, // uninit reporter + MSPROF_REPORTER_DATA_MAX_LEN, // data max length for calling report callback }; /**