toolchain_utils: Make DUT config in nightly crosperf default

Remove experiment arguments reducing performance noise from the
buildbot_test_toolchains script and make the values default in
experiment settings.
Add descriptions about default values.

BUG=None
TEST=Tested on local DUT.

Change-Id: I5fa3d5bf36a2ca37da713b42b49c1f2ad4f08c98
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2197549
Tested-by: Denis Nikitin <denik@chromium.org>
Reviewed-by: Zhizhou Yang <zhizhouy@google.com>
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index b02fc44..e4784a6 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -160,10 +160,6 @@
     board: %s
     remote: %s
     retries: 1
-    cooldown_temp: 40
-    cooldown_time: 10
-    cpu_freq_pct: 95
-    top_interval: 1
     """ % (self._board, self._remotes)
     experiment_tests = """
     benchmark: all_toolchain_perf {
@@ -231,8 +227,8 @@
     crosperf = os.path.join(TOOLCHAIN_DIR, 'crosperf', 'crosperf')
     noschedv2_opts = '--noschedv2' if self._noschedv2 else ''
     command = ('{crosperf} --no_email={no_email} --results_dir={r_dir} '
-               '--intel_pstate=no_hwp --logging_level=verbose '
-               '--json_report=True {noschedv2_opts} {exp_file}').format(
+               '--logging_level=verbose --json_report=True {noschedv2_opts} '
+               '{exp_file}').format(
                    crosperf=crosperf,
                    no_email=not self._test,
                    r_dir=self._reports_dir,
diff --git a/crosperf/settings_factory.py b/crosperf/settings_factory.py
index cfc4013..16e21a7 100644
--- a/crosperf/settings_factory.py
+++ b/crosperf/settings_factory.py
@@ -344,16 +344,16 @@
         TextField(
             'intel_pstate',
             description='Intel Pstate mode.\n'
-            'Supported modes: passive, no_hwp.\n'
-            'By default kernel works in active HWP mode if HWP is supported'
-            " by CPU. This corresponds to a default intel_pstate=''",
+            'Supported modes: "active", "passive", "no_hwp".\n'
+            'Default is "no_hwp" which disables hardware pstates to avoid '
+            'noise in benchmarks.',
             required=False,
-            default=''))
+            default='no_hwp'))
     self.AddField(
         BooleanField(
             'turbostat',
             description='Run turbostat process in the background'
-            ' of a benchmark',
+            ' of a benchmark. Enabled by default.',
             required=False,
             default=True))
     self.AddField(
@@ -366,9 +366,10 @@
             'With 0 - do not run top.\n'
             'NOTE: Running top with interval 1-5 sec has insignificant'
             ' performance impact (performance degradation does not exceed'
-            ' 0.3%%, measured on x86_64, ARM32, and ARM64).',
+            ' 0.3%%, measured on x86_64, ARM32, and ARM64). '
+            'The default value is 1.',
             required=False,
-            default=0))
+            default=1))
     self.AddField(
         IntegerField(
             'cooldown_temp',
@@ -376,14 +377,16 @@
             default=40,
             description='Wait until CPU temperature goes down below'
             ' specified temperature in Celsius'
-            ' prior starting a benchmark.'))
+            ' prior starting a benchmark. '
+            'By default the value is set to 40 degrees.'))
     self.AddField(
         IntegerField(
             'cooldown_time',
             required=False,
-            default=0,
+            default=10,
             description='Wait specified time in minutes allowing'
-            ' CPU to cool down. Zero value disables cooldown.'))
+            ' CPU to cool down. Zero value disables cooldown. '
+            'The default value is 10 minutes.'))
     self.AddField(
         EnumField(
             'governor',
@@ -401,7 +404,8 @@
             required=False,
             description='Setup CPU governor for all cores.\n'
             'For more details refer to:\n'
-            'https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt'))
+            'https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt. '
+            'Default is "performance" governor.'))
     self.AddField(
         EnumField(
             'cpu_usage',
@@ -413,19 +417,22 @@
             ],
             default='all',
             required=False,
-            description='Restrict usage CPUs to decrease CPU interference.\n'
-            'all - no restrictions;\n'
-            'big-only, little-only - enable only big/little cores,'
+            description='Restrict usage of CPUs to decrease CPU interference.\n'
+            '"all" - no restrictions;\n'
+            '"big-only", "little-only" - enable only big/little cores,'
             ' applicable only on ARM;\n'
-            'exclusive-cores - (for future use)'
-            ' isolate cores for exclusive use of benchmark processes.'))
+            '"exclusive-cores" - (for future use)'
+            ' isolate cores for exclusive use of benchmark processes. '
+            'By default use all CPUs.'))
     self.AddField(
         IntegerField(
             'cpu_freq_pct',
             required=False,
-            default=100,
+            default=95,
             description='Setup CPU frequency to a supported value less than'
-            ' or equal to a percent of max_freq.'))
+            ' or equal to a percent of max_freq. '
+            'CPU frequency is reduced to 95%% by default to reduce thermal '
+            'throttling.'))
 
 
 class SettingsFactory(object):
diff --git a/crosperf/settings_factory_unittest.py b/crosperf/settings_factory_unittest.py
index a633903..f190095 100755
--- a/crosperf/settings_factory_unittest.py
+++ b/crosperf/settings_factory_unittest.py
@@ -77,14 +77,14 @@
     self.assertEqual(res.GetField('cwp_dso'), '')
     self.assertEqual(res.GetField('enable_aslr'), False)
     self.assertEqual(res.GetField('ignore_min_max'), False)
-    self.assertEqual(res.GetField('intel_pstate'), '')
+    self.assertEqual(res.GetField('intel_pstate'), 'no_hwp')
     self.assertEqual(res.GetField('turbostat'), True)
-    self.assertEqual(res.GetField('top_interval'), 0)
-    self.assertEqual(res.GetField('cooldown_time'), 0)
+    self.assertEqual(res.GetField('top_interval'), 1)
+    self.assertEqual(res.GetField('cooldown_time'), 10)
     self.assertEqual(res.GetField('cooldown_temp'), 40)
     self.assertEqual(res.GetField('governor'), 'performance')
     self.assertEqual(res.GetField('cpu_usage'), 'all')
-    self.assertEqual(res.GetField('cpu_freq_pct'), 100)
+    self.assertEqual(res.GetField('cpu_freq_pct'), 95)
 
 
 class SettingsFactoryTest(unittest.TestCase):