You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

profiling_stub.cc 3.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <string>
  17. #include "prof_mgr_core.h"
  18. #include "prof_callback.h"
  19. #include "acl/acl_prof.h"
  20. namespace Msprof {
  21. namespace Engine {
  22. class EngineIntf;
  23. /**
  24. * @name : RegisterEngine
  25. * @berif : API of libmsprof, register an engine with a name
  26. * @param [in]: module: the name of plugin
  27. engine: the plugin
  28. * @return: PROFILING_SUCCESS 0 (success)
  29. * PROFILING_FAILED -1 (failed)
  30. */
  31. int RegisterEngine(const std::string& module, const EngineIntf* engine) { return 0; }
  32. } // namespace Engine
  33. } // namespace Msprof
  34. /**
  35. * @name : ProfMgrStartUP
  36. * @berif : start Profiling task
  37. * @param : ProfMgrCfg cfg : config of start_up profiling
  38. * @return: NO_NULL (success)
  39. * NULL (failed)
  40. */
  41. void* ProfMgrStartUp(const ProfMgrCfg* cfg) { return const_cast<void*>(reinterpret_cast<const void*>(cfg)); }
  42. /**
  43. * @name : ProfMgrStop
  44. * @berif : stop Profiling task
  45. * @param : void * handle return by ProfMgrStartUP
  46. * @return: PROFILING_SUCCESS 0 (success)
  47. * PROFILING_FAILED -1 (failed)
  48. */
  49. int ProfMgrStop(void* handle) { return 0; }
  50. namespace Analysis::Dvvp::ProfilerSpecial {
  51. uint32_t MsprofilerInit() { return 0; }
  52. }
  53. /*
  54. * @name MsprofInit
  55. * @brief Profiling module init
  56. * @param [in] dataType: profiling type: ACL Env/ACL Json/GE Option
  57. * @param [in] data: profiling switch data
  58. * @param [in] dataLen: Length of data
  59. * @return 0:SUCCESS, >0:FAILED
  60. */
  61. int32_t MsprofInit(uint32_t dataType, void *data, uint32_t dataLen) { return 0; }
  62. /*
  63. * @name AscendCL
  64. * @brief Finishing Profiling
  65. * @param NULL
  66. * @return 0:SUCCESS, >0:FAILED
  67. */
  68. int32_t MsprofFinalize() { return 0; }
  69. ACL_FUNC_VISIBILITY aclError aclprofInit(const char *profilerResultPath, size_t length) { return ACL_SUCCESS; }
  70. ACL_FUNC_VISIBILITY aclError aclprofStart(const aclprofConfig *profilerConfig) { return ACL_SUCCESS; }
  71. ACL_FUNC_VISIBILITY aclError aclprofStop(const aclprofConfig *profilerConfig) { return ACL_SUCCESS; }
  72. ACL_FUNC_VISIBILITY aclError aclprofFinalize() { return ACL_SUCCESS; }
  73. ACL_FUNC_VISIBILITY aclprofConfig *aclprofCreateConfig(uint32_t *deviceIdList, uint32_t deviceNums,
  74. aclprofAicoreMetrics aicoreMetrics,
  75. aclprofAicoreEvents *aicoreEvents, uint64_t dataTypeConfig) {
  76. return nullptr;
  77. }
  78. ACL_FUNC_VISIBILITY aclError aclprofDestroyConfig(const aclprofConfig *profilerConfig) { return ACL_SUCCESS; }