• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SERVICE_PLUGIN_H
17 #define SERVICE_PLUGIN_H
18 
19 #include "string"
20 #include "map"
21 #include "thread"
22 #include "sp_profiler.h"
23 
24 namespace OHOS {
25     namespace SmartPerf {
26         class ServicePluginHandler : public SpProfiler {
27         public:
28             enum ServicePluginType {
29                 GAME_PLUGIN,
30                 TEST_PLUGIN,
31                 PERF_GENIUS_PLUGIN,
32                 PLUGIN_COUNT
33             };
34 
35             std::map<std::string, std::string> ItemData() override;
GetInstance()36             static ServicePluginHandler &GetInstance()
37             {
38                 static ServicePluginHandler instance;
39                 return instance;
40             }
41             void* GetSoHandler(enum ServicePluginType type);
42 
43         private:
44             ServicePluginHandler();
45             ~ServicePluginHandler() override;
46             ServicePluginHandler(const ServicePluginHandler &);
47             ServicePluginHandler &operator = (const ServicePluginHandler &);
48 
49             const std::vector<std::string> pluginSoPath = {
50                 "/system/lib64/libgameservice_gpucounter_plugin.z.so",
51                 "/system/lib64/libtest_server_client.z.so",
52                 "/system/lib64/libperfgenius_client.z.so"
53             };
54             std::vector<void*> pluginHandle;
55         };
56     }
57 }
58 
59 #endif