CLI: make 'sampling' optional in instrumentation config 02/160302/6
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 14 Nov 2017 15:15:26 +0000 (18:15 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Fri, 8 Dec 2017 09:12:28 +0000 (09:12 +0000)
Set default preiod (100) if sampling option is not set

Change-Id: I3cbd486f5ce190222df42982bc127e94e20e6596
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
src/cli/swap_cli/protocol/v_none.py

index 4deb6ca..6864312 100644 (file)
@@ -325,8 +325,12 @@ class Commands(object):
         config = {
             'features': self.__fd.features_to_bits(self._config['features']),
             'system_trace_period': 100,         # System info period
-            'data_message_period': self._config['sampling']['period'],
+            'data_message_period': 100,         # Set default sampling period
         }
+
+        if self._config['sampling'] is not None:
+            config['data_message_period'] = self._config['sampling']['period']
+
         self._request('MSG_CONFIG', config)
 
     def binary_info(self):