From 9a8e5a190e42415ad225f419d55450463d7db8ce Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Tue, 14 Nov 2017 18:27:26 +0300 Subject: [PATCH] CLI: make 'function_inst' optional in instrumentation config Change-Id: I6aac79c0f227d4bad3a7b77dd3f572e5040b9e87 Signed-off-by: Vyacheslav Cherkashin --- src/cli/swap_cli/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli/swap_cli/config.py b/src/cli/swap_cli/config.py index ce0eaad..bed88c7 100644 --- a/src/cli/swap_cli/config.py +++ b/src/cli/swap_cli/config.py @@ -157,7 +157,7 @@ class ApplicationConfig: self.__intr = intr self.__app_info = AppInfo.get_info(config['app_info'], self.__intr) app_path = self.__app_info.get_path() - if app_path in config['function_inst']: + if 'function_inst' in config and app_path in config['function_inst']: self.__func_array = config['function_inst'][app_path] else: self.__func_array = None @@ -220,6 +220,10 @@ class _InstrumentationConfig: def lib_list(self, libs_set=None): app = ApplicationConfig('app', self.__settings['app'], self.__intr, self.__denote) + + if 'function_inst' not in self.__settings['app']: + return [] + func_inst = self.__settings['app']['function_inst'] lib_dict = {} @@ -316,7 +320,7 @@ class Config: features.extend(self.__features.resolve_features(probe_features)) - if app['function_inst'] is not None: + if app.get('function_inst') is not None: features.append('FUNCTION_PROFILING') if sampler is not None and any(sampler): -- 2.7.4