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 package ohos.devtools.pluginconfig; 17 18 import ohos.devtools.datasources.utils.plugin.IPluginConfig; 19 import ohos.devtools.datasources.utils.plugin.entity.AnalysisType; 20 import ohos.devtools.datasources.utils.plugin.entity.DPlugin; 21 import ohos.devtools.datasources.utils.plugin.entity.PluginConf; 22 import ohos.devtools.datasources.utils.plugin.entity.PluginMode; 23 import ohos.devtools.datasources.utils.profilerlog.ProfilerLogManager; 24 import org.apache.logging.log4j.LogManager; 25 import org.apache.logging.log4j.Logger; 26 27 /** 28 * BytraceConfig 29 * 30 * @since 2021/9/20 31 */ 32 @DPlugin 33 public class BytraceConfig extends IPluginConfig { 34 private static final Logger LOGGER = LogManager.getLogger(BytraceConfig.class); 35 private static final String BYTRACE_PLUGIN_NAME = "/data/local/tmp/libbytraceplugin.z.so"; 36 37 @Override createConfig()38 public PluginConf createConfig() { 39 if (ProfilerLogManager.isInfoEnabled()) { 40 LOGGER.info("createConfig"); 41 } 42 PluginConf bytraceConfig = new PluginConf(BYTRACE_PLUGIN_NAME, "", null, false, null); 43 bytraceConfig.setPluginMode(PluginMode.OFFLINE); 44 bytraceConfig.addAnalysisTypes(AnalysisType.APPLICATION_TYPE); 45 bytraceConfig.addAnalysisTypes(AnalysisType.DISTRIBUTED_TYPE); 46 bytraceConfig.addAnalysisTypes(AnalysisType.SYSTEM_TYPE); 47 return bytraceConfig; 48 } 49 } 50