• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 namespace Msprof {
21 namespace Engine {
22 
23 class EngineIntf;
24 /**
25  * @name  : RegisterEngine
26  * @berif : API of libmsprof, register an engine with a name
27  * @param [in]: module: the name of plugin
28                 engine: the plugin
29  * @return: PROFILING_SUCCESS 0 (success)
30  *          PROFILING_FAILED -1 (failed)
31  */
RegisterEngine(const std::string & module,const EngineIntf * engine)32 int RegisterEngine(const std::string& module, const EngineIntf* engine) { return 0; }
33 
34 }  // namespace Engine
35 }  // namespace Msprof
36 
37 /**
38  * @name  : ProfMgrStartUP
39  * @berif : start Profiling task
40  * @param : ProfMgrCfg cfg : config of start_up profiling
41  * @return: NO_NULL (success)
42  *        NULL (failed)
43  */
ProfMgrStartUp(const ProfMgrCfg * cfg)44 void* ProfMgrStartUp(const ProfMgrCfg* cfg) { return const_cast<void*>(reinterpret_cast<const void*>(cfg)); }
45 
46 /**
47  * @name  : ProfMgrStop
48  * @berif : stop Profiling task
49  * @param : void * handle return by ProfMgrStartUP
50  * @return: PROFILING_SUCCESS 0 (success)
51  *        PROFILING_FAILED -1 (failed)
52  */
ProfMgrStop(void * handle)53 int ProfMgrStop(void* handle) { return 0; }
54 
55 namespace Analysis::Dvvp::ProfilerSpecial {
MsprofilerInit()56 uint32_t MsprofilerInit() { return 0; }
57 }
58 
59 /*
60  * @name  MsprofInit
61  * @brief Profiling module init
62  * @param [in] dataType: profiling type: ACL Env/ACL Json/GE Option
63  * @param [in] data: profiling switch data
64  * @param [in] dataLen: Length of data
65  * @return 0:SUCCESS, >0:FAILED
66  */
MsprofInit(uint32_t dataType,void * data,uint32_t dataLen)67 int32_t MsprofInit(uint32_t dataType, void *data, uint32_t dataLen) { return 0; }
68 
69 /*
70  * @name AscendCL
71  * @brief Finishing Profiling
72  * @param NULL
73  * @return 0:SUCCESS, >0:FAILED
74  */
MsprofFinalize()75 int32_t MsprofFinalize() { return 0; }