This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Alejandro Leal gerrit-no-reply at lists.osmocom.orgAlejandro Leal has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24270 ) Change subject: ms-srs: change the cpu governor before launching the ms. ...................................................................... ms-srs: change the cpu governor before launching the ms. Added the feature to change the cpu governor to the given one before executing the ms-srs. When the execution finishes, the cpu governor will be set to powersave. Change-Id: I86ec4fbba8a965e60103b30e2aa60cd2c3f348c9 --- M src/osmo_gsm_tester/core/remote.py M src/osmo_gsm_tester/obj/ms_srs.py A utils/bin/osmo-gsm-tester_change_cpu_governor.sh A utils/sudoers.d/osmo-gsm-tester_change_cpu_governor 4 files changed, 38 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/70/24270/1 diff --git a/src/osmo_gsm_tester/core/remote.py b/src/osmo_gsm_tester/core/remote.py index 0ea873d..fb446a6 100644 --- a/src/osmo_gsm_tester/core/remote.py +++ b/src/osmo_gsm_tester/core/remote.py @@ -158,6 +158,15 @@ def scpfrom(self, name, remote_path, local_path): process.run_local_sync(self.run_dir, name, ('scp', '-r', '%s@%s:%s' % (self.user(), self.host(), remote_path), local_path)) + def set_cpu_governor(self, mode): + ''' + This functionality requires specific setup on the host running + osmo-gsm-tester. See osmo-gsm-tester manual for more information. + ''' + self.log(f'Set cpu governor to {mode}') + SET_CPU_GOVERNOR_BIN = 'osmo-gsm-tester_change_cpu_governor.sh' + self.run_remote_sync('change-cpu-governor', ('sudo', SET_CPU_GOVERNOR_BIN, mode)) + def setcap_net_admin(self, binary_path): ''' This functionality requires specific setup on the host running diff --git a/src/osmo_gsm_tester/obj/ms_srs.py b/src/osmo_gsm_tester/obj/ms_srs.py index ec4486f..6aaa1c9 100644 --- a/src/osmo_gsm_tester/obj/ms_srs.py +++ b/src/osmo_gsm_tester/obj/ms_srs.py @@ -45,7 +45,8 @@ 'freq_offset': schema.INT, 'force_ul_amplitude': schema.STR, 'dl_freq': schema.STR, - 'ul_freq': schema.STR + 'ul_freq': schema.STR, + 'cpu_governor': schema.STR } for key, val in RunNode.schema().items(): resource_schema['run_node.%s' % key] = val @@ -104,6 +105,7 @@ self.remote_log_file = None self.remote_pcap_file = None self.remote_metrics_file = None + self.remote_cpu_governor = None self.enable_pcap = False self.num_carriers = 1 self.num_nr_carriers = 0 @@ -121,6 +123,10 @@ if self._run_node.is_local(): return + # Restore the cpu governor. + if self.remote_cpu_governor: + self.rem_host.set_cpu_governor('powersave') + # Make sure we give the UE time to tear down self.sleep_after_stop() @@ -186,6 +192,10 @@ self.process.stdin_write('t\n') def start_remotely(self): + # Set the cpu governor to performance. + if self.remote_cpu_governor: + self.rem_host.set_cpu_governor(self.remote_cpu_governor) + remote_lib = self.remote_inst.child('lib') remote_binary = self.remote_inst.child('bin', srsUE.BINFILE) # setting capabilities will later disable use of LD_LIBRARY_PATH from ELF loader -> modify RPATH instead. @@ -271,6 +281,8 @@ self.enable_pcap = util.str2bool(values['ue'].get('enable_pcap', 'false')) config.overlay(values, dict(ue={'enable_pcap': self.enable_pcap})) + self.remote_cpu_governor = self._conf.get('cpu_governor', None) + self._additional_args = [] for add_args in values['ue'].get('additional_args', []): self._additional_args += add_args.split() diff --git a/utils/bin/osmo-gsm-tester_change_cpu_governor.sh b/utils/bin/osmo-gsm-tester_change_cpu_governor.sh new file mode 100755 index 0000000..92e797c --- /dev/null +++ b/utils/bin/osmo-gsm-tester_change_cpu_governor.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# This script changes the cpu governor mode to the given first argument. + +echo "Script to change the cpu governor" +echo "changing the cpu governor to $1" + +for f in /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_governor ; do + echo $1 > $f + cat $f +done + +exit $? + diff --git a/utils/sudoers.d/osmo-gsm-tester_change_cpu_governor b/utils/sudoers.d/osmo-gsm-tester_change_cpu_governor new file mode 100644 index 0000000..aba27a7 --- /dev/null +++ b/utils/sudoers.d/osmo-gsm-tester_change_cpu_governor @@ -0,0 +1,2 @@ +%osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_change_cpu_governor.sh + -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24270 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Change-Id: I86ec4fbba8a965e60103b30e2aa60cd2c3f348c9 Gerrit-Change-Number: 24270 Gerrit-PatchSet: 1 Gerrit-Owner: Alejandro Leal <alejandro.leal at srs.io> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210519/72766126/attachment.htm>