From f7cbef30b111201e2ddbce3abe7b68da294db91c Mon Sep 17 00:00:00 2001 From: Aleksei Vereshchagin Date: Fri, 30 Mar 2018 21:30:05 +0300 Subject: [PATCH] Add posibility to use files as source of configuration --- src/CMakeLists.txt | 2 + src/config/configurationmanager.cpp | 256 +++++++++++++++++++++++ src/config/configurationmanager.h | 88 ++++++++ src/config/environmentconfigprovider.cpp | 142 +------------ src/config/environmentconfigprovider.h | 30 +-- src/config/fileconfigprovider.cpp | 145 +++++++++++++ src/config/fileconfigprovider.h | 43 ++++ src/profiler.cpp | 16 +- src/profilermanager.cpp | 42 ---- src/profilermanager.h | 12 -- 10 files changed, 555 insertions(+), 221 deletions(-) create mode 100644 src/config/configurationmanager.cpp create mode 100644 src/config/configurationmanager.h create mode 100644 src/config/fileconfigprovider.cpp create mode 100644 src/config/fileconfigprovider.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dc37601..c92db8f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,9 @@ add_library(coreprof SHARED classfactory.cpp config/commonconfigconversions.cpp + config/configurationmanager.cpp config/environmentconfigprovider.cpp + config/fileconfigprovider.cpp config/loggerconfig.cpp config/loggerconfigconversions.cpp config/profilerconfig.cpp diff --git a/src/config/configurationmanager.cpp b/src/config/configurationmanager.cpp new file mode 100644 index 0000000..860a290 --- /dev/null +++ b/src/config/configurationmanager.cpp @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include + +#include "profiler.h" + +#include "commonconfig.h" +#include "commonconfigconversions.h" +#include "loggerconfigconversions.h" +#include "tracelogconfigconversions.h" +#include "profilerconfigconversions.h" + +#include "configurationmanager.h" + +ConfigurationManager::ConfigurationManager(Log &logger) + : m_logger(logger) + , m_fileConfigProvider() + , m_environmentConfigProvider() +{ + const char *config_filename = getenv("PROF_CONFIG_FILENAME"); + if (config_filename) + { + m_fileConfigProvider.reset(new FileConfigProvider(config_filename)); + } + + m_environmentConfigProvider.reset(new EnvironmentConfigProvider()); +} + +template +bool ConfigurationManager::FetchValue(const std::string &name, T &value) const +{ + std::string str_value; + + bool from_file = false; + if (m_fileConfigProvider) + { + from_file = m_fileConfigProvider->FetchValue(name, str_value); + } + + bool from_env = m_environmentConfigProvider->FetchValue(name, str_value); + if (from_file && from_env) + { + m_logger.Info() << "Configuration variable " << name << + " was overrided by environment"; + } + + if (from_file || from_env) + { + try + { + value = convert(str_value.c_str()); + } + catch (const std::runtime_error &e) + { + std::stringstream ss; + ss << "variable " << name << "=" << str_value << + " can't be parsed: " << e.what(); + throw config_error(ss.str()); + } + + return true; + } + else + { + return false; + } +} + +void ConfigurationManager::FetchConfig(LoggerConfig &config) const +{ + // Save current configuration to temporary. + LoggerConfig new_config(config); + + // + // Fetching from the environment can cause exceptions. + // + + FetchValue("PROF_LOG_LEVEL", new_config.Level); + + bool file_name_specified = + FetchValue("PROF_LOG_FILENAME", new_config.FileName); + if (file_name_specified) + { + new_config.OutputStream = LoggerOutputStream::File; + } + + FetchValue("PROF_LOG_STREAM", new_config.OutputStream); + + // Apply changes to the current configuration. + config = new_config; +} + +void ConfigurationManager::FetchConfig(TraceLogConfig &config) const +{ + // Save current configuration to temporary. + TraceLogConfig new_config(config); + + // + // Fetching from the environment can cause exceptions. + // + + bool file_name_specified = + FetchValue("PROF_TRACE_FILENAME", new_config.FileName); + if (file_name_specified) + { + new_config.OutputStream = TraceLogOutputStream::File; + } + + FetchValue("PROF_TRACE_STREAM", new_config.OutputStream); + + // Apply changes to the current configuration. + config = new_config; +} + +void ConfigurationManager::FetchConfig(ProfilerConfig &config) const +{ + // Save current configuration to temporary. + ProfilerConfig new_config(config); + + // + // Fetching from the environment can cause exceptions. + // + // We don't check whether the environment variables override the + // configuration or not. + // + + FetchValue("PROF_COLLECT_METHOD", new_config.CollectionMethod); + if (new_config.CollectionMethod != CollectionMethod::Sampling) + { + new_config.SamplingTimeoutMs = 0; + new_config.HighGranularityEnabled = false; + } + if (FetchValue("PROF_SAMPLING_TIMEOUT", new_config.SamplingTimeoutMs)) + { + new_config.CpuTraceTimeoutMs = new_config.SamplingTimeoutMs; + } + FetchValue("PROF_HIGH_GRAN", new_config.HighGranularityEnabled); + FetchValue("PROF_DELAYED_START", new_config.TracingSuspendedOnStart); + FetchValue("PROF_LINE_TRACE", new_config.LineTraceEnabled); + + bool CpuTraceEnabled; + if (FetchValue("PROF_CPU_TRACE", CpuTraceEnabled)) + { + new_config.CpuTraceProcessEnabled = CpuTraceEnabled; + new_config.CpuTraceThreadEnabled = CpuTraceEnabled; + } + FetchValue("PROF_CPU_TRACE_PROC", new_config.CpuTraceProcessEnabled); + FetchValue("PROF_CPU_TRACE_THREAD", new_config.CpuTraceThreadEnabled); + if (!new_config.CpuTraceProcessEnabled && !new_config.CpuTraceThreadEnabled) + { + new_config.CpuTraceTimeoutMs = 0; + } + FetchValue("PROF_CPU_TRACE_TIMEOUT", new_config.CpuTraceTimeoutMs); + + FetchValue("PROF_EXECUTION_TRACE", new_config.ExecutionTraceEnabled); + FetchValue("PROF_MEMORY_TRACE", new_config.MemoryTraceEnabled); + if (new_config.MemoryTraceEnabled && + new_config.ExecutionTraceEnabled && + new_config.CollectionMethod == CollectionMethod::Sampling) + { + new_config.StackTrackingEnabled = true; + } + + FetchValue("PROF_STACK_TRACK", new_config.StackTrackingEnabled); + + bool GcTraceEnabled; + if (FetchValue("PROF_GC_TRACE", GcTraceEnabled)) + { + new_config.GcAllocTableTraceEnabled = GcTraceEnabled; + } + FetchValue("PROF_GC_TRACE_ALT", new_config.GcAllocTableTraceEnabled); + + // Apply changes to the current configuration. + config = new_config; +} + +template +T ConfigurationManager::FetchGenericConfig() const +{ + T config; + + FetchConfig(config); + + config.Validate(); + + auto warnings = config.Verify(); + if (!warnings.empty()) + { + auto logLine = m_logger.Warn(); + logLine << "Some errors detected in " << config.Name() << ":"; + for (const auto &warning : warnings) + { + logLine << "\n\t\t" << warning; + } + } + + return config; +} + +LoggerConfig ConfigurationManager::FetchLoggerConfig() const +{ + return FetchGenericConfig(); +} + +TraceLogConfig ConfigurationManager::FetchTraceLogConfig() const +{ + return FetchGenericConfig(); +} + +ProfilerConfig ConfigurationManager::FetchProfilerConfig() const +{ + return FetchGenericConfig(); +} + +bool ConfigurationManager::CheckUnused() const +{ + if (!m_fileConfigProvider) + { + return true; + } + + auto unused = m_fileConfigProvider->GetUnused(); + if (!unused.empty()) + { + auto logLine = m_logger.Warn(); + logLine << "Some options from configuration file was unused:"; + for (const auto ¶m : unused) + { + auto ¶m_name = param.first; + auto ¶m_value = param.second; + + logLine << "\n\t\t" << param_name << "=" << param_value; + } + + return false; + } + + return true; +} diff --git a/src/config/configurationmanager.h b/src/config/configurationmanager.h new file mode 100644 index 0000000..d0947c4 --- /dev/null +++ b/src/config/configurationmanager.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CONFIGURATION_MANAGER_H_ +#define _CONFIGURATION_MANAGER_H_ + +#include +#include + +#include "log.h" + +#include "loggerconfig.h" +#include "tracelogconfig.h" +#include "profilerconfig.h" + +#include "fileconfigprovider.h" +#include "environmentconfigprovider.h" + +class ConfigurationManager +{ +public: + ConfigurationManager(Log &m_logger); + +private: + // Internal template method that takes name of the configuration variable + // and tries to fetch it from file than from environment and convert it to + // type T. If the value of the variable is incorrect, bad_conversion + // exception should be thrown. + // + // FetchValue() will log info message if some configuration variable from + // file overrided by environment. + // + // FetchValue() will return true on success convertion or false if specified + // variable is not presented. + template + bool FetchValue(const std::string &name, T &value) const; + + // + // FetchConfig() overrides the configuration with values fetched with + // FetchValue(). Other values are not changed. The configuration wouldn't + // chang if exception were thrown. Error messages of runtime exceptions are + // complemented by information about the variable that caused the problem. + // config_error class is used for this exceptions. + // + + void FetchConfig(LoggerConfig &config) const; + + void FetchConfig(TraceLogConfig &config) const; + + void FetchConfig(ProfilerConfig &config) const; + + // Get configuration for config type T from the Global Area. + template + T FetchGenericConfig() const; + +public: + // Get logger configuration from the Global Area. + LoggerConfig FetchLoggerConfig() const; + + // Get trace configuration from the Global Area. + TraceLogConfig FetchTraceLogConfig() const; + + // Get configuration from the Global Area. + ProfilerConfig FetchProfilerConfig() const; + + bool CheckUnused() const; + +private: + Log &m_logger; + + std::unique_ptr m_fileConfigProvider; + std::unique_ptr m_environmentConfigProvider; +}; + +#endif // _CONFIGURATION_MANAGER_H_ diff --git a/src/config/environmentconfigprovider.cpp b/src/config/environmentconfigprovider.cpp index 759ca12..292f562 100644 --- a/src/config/environmentconfigprovider.cpp +++ b/src/config/environmentconfigprovider.cpp @@ -14,148 +14,18 @@ * limitations under the License. */ -#include -#include - #include -#include "commonconfig.h" -#include "commonconfigconversions.h" -#include "loggerconfigconversions.h" -#include "tracelogconfigconversions.h" -#include "profilerconfigconversions.h" #include "environmentconfigprovider.h" -template -bool EnvironmentConfigProvider::FetchValue(const char *name, T &value) const -{ - const char *env = getenv(name); - if (env) - { - try - { - value = convert(env); - } - catch (const std::runtime_error &e) - { - std::stringstream ss; - ss << "variable " << name << "=" << env << - " can't be parsed: " << e.what(); - throw config_error(ss.str()); - } - - return true; - } - else - { - return false; - } -} - -void EnvironmentConfigProvider::FetchConfig(LoggerConfig &config) const -{ - // Save current configuration to temporary. - LoggerConfig new_config(config); - - // - // Fetching from the environment can cause exceptions. - // - - FetchValue("PROF_LOG_LEVEL", new_config.Level); - - bool file_name_specified = - FetchValue("PROF_LOG_FILENAME", new_config.FileName); - if (file_name_specified) - { - new_config.OutputStream = LoggerOutputStream::File; - } - - FetchValue("PROF_LOG_STREAM", new_config.OutputStream); - - // Apply changes to the current configuration. - config = new_config; -} - -void EnvironmentConfigProvider::FetchConfig(TraceLogConfig &config) const -{ - // Save current configuration to temporary. - TraceLogConfig new_config(config); - - // - // Fetching from the environment can cause exceptions. - // - - bool file_name_specified = - FetchValue("PROF_TRACE_FILENAME", new_config.FileName); - if (file_name_specified) - { - new_config.OutputStream = TraceLogOutputStream::File; - } - - FetchValue("PROF_TRACE_STREAM", new_config.OutputStream); - - // Apply changes to the current configuration. - config = new_config; -} - -void EnvironmentConfigProvider::FetchConfig(ProfilerConfig &config) const +bool EnvironmentConfigProvider::FetchValue( + const std::string &name, std::string &value) const { - // Save current configuration to temporary. - ProfilerConfig new_config(config); - - // - // Fetching from the environment can cause exceptions. - // - // We don't check whether the environment variables override the - // configuration or not. - // - - FetchValue("PROF_COLLECT_METHOD", new_config.CollectionMethod); - if (new_config.CollectionMethod != CollectionMethod::Sampling) - { - new_config.SamplingTimeoutMs = 0; - new_config.HighGranularityEnabled = false; - } - if (FetchValue("PROF_SAMPLING_TIMEOUT", new_config.SamplingTimeoutMs)) - { - new_config.CpuTraceTimeoutMs = new_config.SamplingTimeoutMs; - } - FetchValue("PROF_HIGH_GRAN", new_config.HighGranularityEnabled); - FetchValue("PROF_DELAYED_START", new_config.TracingSuspendedOnStart); - FetchValue("PROF_LINE_TRACE", new_config.LineTraceEnabled); - - bool CpuTraceEnabled; - if (FetchValue("PROF_CPU_TRACE", CpuTraceEnabled)) - { - new_config.CpuTraceProcessEnabled = CpuTraceEnabled; - new_config.CpuTraceThreadEnabled = CpuTraceEnabled; - } - FetchValue("PROF_CPU_TRACE_PROC", new_config.CpuTraceProcessEnabled); - FetchValue("PROF_CPU_TRACE_THREAD", new_config.CpuTraceThreadEnabled); - if (!new_config.CpuTraceProcessEnabled && !new_config.CpuTraceThreadEnabled) - { - new_config.CpuTraceTimeoutMs = 0; - } - FetchValue("PROF_CPU_TRACE_TIMEOUT", new_config.CpuTraceTimeoutMs); - - FetchValue("PROF_EXECUTION_TRACE", new_config.ExecutionTraceEnabled); - FetchValue("PROF_MEMORY_TRACE", new_config.MemoryTraceEnabled); - if (new_config.MemoryTraceEnabled && - new_config.ExecutionTraceEnabled && - new_config.CollectionMethod == CollectionMethod::Sampling) - { - new_config.StackTrackingEnabled = true; - } - - FetchValue("PROF_STACK_TRACK", new_config.StackTrackingEnabled); - - bool GcTraceEnabled; - if (FetchValue("PROF_GC_TRACE", GcTraceEnabled)) + const char *env_str = getenv(name.c_str()); + if (env_str) { - new_config.GcAllocTableTraceEnabled = GcTraceEnabled; + value = env_str; } - FetchValue("PROF_GC_TRACE_ALT", new_config.GcAllocTableTraceEnabled); - // Apply changes to the current configuration. - config = new_config; + return env_str != nullptr; } diff --git a/src/config/environmentconfigprovider.h b/src/config/environmentconfigprovider.h index 36d8d71..b6bde01 100644 --- a/src/config/environmentconfigprovider.h +++ b/src/config/environmentconfigprovider.h @@ -17,36 +17,14 @@ #ifndef _ENVIRONMENT_CONFIG_PROVIDER_H_ #define _ENVIRONMENT_CONFIG_PROVIDER_H_ -#include "loggerconfig.h" -#include "tracelogconfig.h" -#include "profilerconfig.h" +#include class EnvironmentConfigProvider { -private: - // Internal template method that takes name of the environment variable and - // tries to fetch it and convert to type T. If the value of the variable - // is incorrect, bad_conversion exception should be thrown. - // - // FetchValue() will return true on success convertion or false if specified - // variable is not presented. - template - bool FetchValue(const char *name, T &value) const; - public: - // - // FetchConfig() overrides the configuration with values fetched from the - // environment. Other values are not changed. The configuration wouldn't - // chang if exception were thrown. Error messages of runtime exceptions are - // complemented by information about the variable that caused the problem. - // config_error class is used for this exceptions. - // - - void FetchConfig(LoggerConfig &config) const; - - void FetchConfig(TraceLogConfig &config) const; - - void FetchConfig(ProfilerConfig &config) const; + // FetchValue() will return false if specified variable is not presented. + // Otherwise returns true. + bool FetchValue(const std::string &name, std::string &value) const; }; #endif // _ENVIRONMENT_CONFIG_PROVIDER_H_ diff --git a/src/config/fileconfigprovider.cpp b/src/config/fileconfigprovider.cpp new file mode 100644 index 0000000..8ba4ef0 --- /dev/null +++ b/src/config/fileconfigprovider.cpp @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "fileconfigprovider.h" + +FileConfigProvider::FileConfigProvider(const std::string &filename) + : m_data() +{ + std::ifstream stream; + stream.exceptions(std::ios::badbit); + stream.open(filename, std::ios::in); + + std::string line; + while (std::getline(stream, line)) + { + std::string name; + std::string value; + bool is_name = true; + auto parse_error = std::runtime_error( + "FileConfigProvider::FileConfigProvider(): " + "can't parse config file (syntax error)" + ); + + if (line[0] == '=') + { + throw parse_error; + } + + if (line.empty()) + { + continue; + } + + for (char c : line) + { + if (is_name) + { + if (c == '_' || isalnum(c)) + { + name.push_back(c); + } + else if (c == '=') + { + is_name = false; + } + else + { + throw parse_error; + } + } + else + { + value.push_back(c); + } + } + + if (is_name) + { + throw parse_error; + } + + m_data[name] = std::make_pair(value, false); + } + + if (!stream.eof()) + { + assert(stream.fail()); + + if (errno) + { + throw std::system_error( + errno, std::system_category(), + "FileConfigProvider::FileConfigProvider(): " + "can't parse config file" + ); + } + else + { + throw std::runtime_error( + "FileConfigProvider::FileConfigProvider(): " + "can't parse config file (unknown error)" + ); + } + } +} + +bool FileConfigProvider::FetchValue( + const std::string &name, std::string &value) +{ + auto it = m_data.find(name); + if (it != m_data.end()) + { + auto ¶m_name = it->first; + auto ¶m_value = it->second.first; + auto ¶m_is_used = it->second.second; + + value = param_value; + param_is_used = true; + + return true; + } + + return false; +} + +std::unordered_map +FileConfigProvider::GetUnused() const +{ + std::unordered_map unused; + for (const auto ¶m : m_data) + { + auto ¶m_name = param.first; + auto ¶m_value = param.second.first; + auto ¶m_is_used = param.second.second; + + if (!param_is_used) + { + unused[param_name] = param_value; + } + } + + return unused; +} diff --git a/src/config/fileconfigprovider.h b/src/config/fileconfigprovider.h new file mode 100644 index 0000000..e5aeb9b --- /dev/null +++ b/src/config/fileconfigprovider.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _FILE_CONFIG_PROVIDER_H_ +#define _FILE_CONFIG_PROVIDER_H_ + +#include +#include +#include + +class FileConfigProvider +{ +public: + FileConfigProvider(const std::string &filename); + + // FetchValue() will return false if specified variable is not presented. + // Otherwise returns true. + bool FetchValue(const std::string &name, std::string &value); + + // Returns map of name-value pairs of unused parameters. + std::unordered_map GetUnused() const; + +private: + std::unordered_map< + std::string, // Name of parameter. + std::pair // Value of parameter and usage flag. + > m_data; +}; + +#endif // _FILE_CONFIG_PROVIDER_H_ diff --git a/src/profiler.cpp b/src/profiler.cpp index 262e1c2..06be2b8 100644 --- a/src/profiler.cpp +++ b/src/profiler.cpp @@ -25,6 +25,7 @@ #include "localtime.h" #include "profilermanager.h" +#include "configurationmanager.h" #include "profiler.h" #include "commontrace.h" @@ -374,12 +375,17 @@ HRESULT STDMETHODCALLTYPE Profiler::Initialize( // Fetching the Configuration and setup logging. // - m_loggerConfig = ProfilerManager::Instance().FetchLoggerConfig(this); - this->SetupLogging(m_loggerConfig); + { + ConfigurationManager cm(LOG()); + + m_loggerConfig = cm.FetchLoggerConfig(); + this->SetupLogging(m_loggerConfig); - m_traceLogConfig = - ProfilerManager::Instance().FetchTraceLogConfig(this); - m_profConfig = ProfilerManager::Instance().FetchProfilerConfig(this); + m_traceLogConfig = cm.FetchTraceLogConfig(); + m_profConfig = cm.FetchProfilerConfig(); + + cm.CheckUnused(); + } // // Applying the Configuration to the TraceLog. diff --git a/src/profilermanager.cpp b/src/profilermanager.cpp index 6aa0ee3..53660e3 100644 --- a/src/profilermanager.cpp +++ b/src/profilermanager.cpp @@ -48,33 +48,6 @@ ProfilerManager::~ProfilerManager() assert(g_pProfilerObject == nullptr); } -template -T ProfilerManager::FetchConfig(const Profiler *pProfiler) -{ - // Ensure method is called for the global profiler instance; - assert(g_pProfilerObject == pProfiler); - - T config; - - // Currently only environment is used as source of the configuration. - EnvironmentConfigProvider().FetchConfig(config); - - config.Validate(); - - auto warnings = config.Verify(); - if (!warnings.empty()) - { - auto logLine = pProfiler->LOG().Warn(); - logLine << "Some errors detected in " << config.Name() << ":"; - for (const auto &warning : warnings) - { - logLine << "\n\t\t" << warning; - } - } - - return config; -} - bool ProfilerManager::IsProfilerRegistered( const Profiler *pProfiler) const noexcept { @@ -103,21 +76,6 @@ void ProfilerManager::UnregisterProfiler(const Profiler *pProfiler) } } -LoggerConfig ProfilerManager::FetchLoggerConfig(const Profiler *pProfiler) -{ - return FetchConfig(pProfiler); -} - -TraceLogConfig ProfilerManager::FetchTraceLogConfig(const Profiler *pProfiler) -{ - return FetchConfig(pProfiler); -} - -ProfilerConfig ProfilerManager::FetchProfilerConfig(const Profiler *pProfiler) -{ - return FetchConfig(pProfiler); -} - void ProfilerManager::DllDetachShutdown() noexcept { // diff --git a/src/profilermanager.h b/src/profilermanager.h index ba8d9a8..8d4173e 100644 --- a/src/profilermanager.h +++ b/src/profilermanager.h @@ -37,9 +37,6 @@ private: // Singleton can be destroyed only during process termination. ~ProfilerManager(); - template - T FetchConfig(const Profiler *pProfiler); - public: // Check if the Profiler is registered in the Profiler Manager. bool IsProfilerRegistered(const Profiler *pProfiler) const noexcept; @@ -50,15 +47,6 @@ public: // Remove the Profiler from the Profiler Manager. void UnregisterProfiler(const Profiler *pProfiler); - // Get logger configuration from the Global Area for the specified Profiler. - LoggerConfig FetchLoggerConfig(const Profiler *pProfiler); - - // Get trace configuration from the Global Area for the specified Profiler. - TraceLogConfig FetchTraceLogConfig(const Profiler *pProfiler); - - // Get configuration from the Global Area for the specified Profiler. - ProfilerConfig FetchProfilerConfig(const Profiler *pProfiler); - // This function is called when DLL is detached and we should perform // cleanup of the Global Area. void DllDetachShutdown() noexcept; -- 2.34.1