• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 PARSE_PLUGIN_CONFIG_H
17 #define PARSE_PLUGIN_CONFIG_H
18 
19 #include <map>
20 #include <string>
21 
22 #include "profiler_service.grpc.pb.h"
23 
24 class ParsePluginConfig {
25 public:
26     static ParsePluginConfig& GetInstance();
27 
28     std::string GetPluginsConfig(std::string& content);
29     std::string GetPluginsPath(std::string& name);
30     bool SetSerializePluginsConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
31 
32     bool SetSerializeCpuConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
33     bool SetSerializeDiskioConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
34     bool SetSerializeFtraceConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
35     bool SetSerializeHidumpConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
36     bool SetSerializeHilogConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
37     bool SetSerializeMemoryConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
38     bool SetSerializeHookConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
39     bool SetSerializeNetworkConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
40     bool SetSerializeProcessConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
41     bool SetSerializeHiperfConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
42     bool SetSerializeHisyseventConfig(const std::string& pluginName, ProfilerPluginConfig& pluginConfig);
43 
44 private:
ParsePluginConfig()45     ParsePluginConfig() {}
~ParsePluginConfig()46     ~ParsePluginConfig() {}
47 
48     std::map<std::string, std::string> pluginConfigMap;
49 };
50 
51 
52 #endif