libs/utils/env: add required tools dependencies

Once the user defined a tool in the configuration file that tool
can have dependencies on other tools. Currently we require the
user to know and list all that dependencies.

This patch simplify things by automatically adding all the known
dependencies of each user tool the user can specify.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
diff --git a/ipynb/devlib/examples/cgroups.ipynb b/ipynb/devlib/examples/cgroups.ipynb
index a91f588..26b6e2a 100644
--- a/ipynb/devlib/examples/cgroups.ipynb
+++ b/ipynb/devlib/examples/cgroups.ipynb
@@ -337,7 +337,6 @@
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "06:19:18  ERROR   : Assuming taskset is preinstalled\n",
       "06:19:18  INFO    : Setup new workload simple\n",
       "06:19:18  INFO    : Workload duration defined by longest task\n",
       "06:19:18  INFO    : Default policy: SCHED_OTHER\n",
diff --git a/ipynb/sched_dvfs/smoke_test.ipynb b/ipynb/sched_dvfs/smoke_test.ipynb
index b73408d..a1f3195 100644
--- a/ipynb/sched_dvfs/smoke_test.ipynb
+++ b/ipynb/sched_dvfs/smoke_test.ipynb
@@ -402,7 +402,6 @@
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "04:38:33  ERROR   : Assuming taskset is preinstalled\n",
       "04:38:33  INFO    : Setup new workload smoke\n",
       "04:38:33  INFO    : Workload duration defined by longest task\n",
       "04:38:33  INFO    : Default policy: SCHED_OTHER\n",
@@ -730,7 +729,6 @@
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "04:39:51  ERROR   : Assuming taskset is preinstalled\n",
       "04:39:51  INFO    : Setup new workload smoke\n",
       "04:39:51  INFO    : Workload duration defined by longest task\n",
       "04:39:51  INFO    : Default policy: SCHED_OTHER\n",
diff --git a/ipynb/utils/testenv_example.ipynb b/ipynb/utils/testenv_example.ipynb
index d47502b..3c9c772 100644
--- a/ipynb/utils/testenv_example.ipynb
+++ b/ipynb/utils/testenv_example.ipynb
@@ -193,7 +193,6 @@
       "07:17:07  DEBUG   : sudo -- sh -c 'cat '\\''/sys/devices/system/cpu/online'\\'''\n",
       "07:17:08  INFO    : CPU0 calibration...\n",
       "07:17:08  DEBUG   : ulimit -Hr\n",
-      "07:17:08  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:08  INFO    : Setup new workload rta_calib\n",
       "07:17:08  INFO    : Workload duration defined by longest task\n",
       "07:17:08  INFO    : Default policy: SCHED_OTHER\n",
@@ -211,7 +210,6 @@
       "07:17:10  INFO    : Executor [end]: /root/devlib-target/bin/taskset 0x1 /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_00.json\n",
       "07:17:10  INFO    : CPU1 calibration...\n",
       "07:17:10  DEBUG   : ulimit -Hr\n",
-      "07:17:10  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:10  INFO    : Setup new workload rta_calib\n",
       "07:17:10  INFO    : Workload duration defined by longest task\n",
       "07:17:10  INFO    : Default policy: SCHED_OTHER\n",
@@ -229,7 +227,6 @@
       "07:17:12  INFO    : Executor [end]: /root/devlib-target/bin/taskset 0x2 /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_00.json\n",
       "07:17:12  INFO    : CPU2 calibration...\n",
       "07:17:12  DEBUG   : ulimit -Hr\n",
-      "07:17:12  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:12  INFO    : Setup new workload rta_calib\n",
       "07:17:12  INFO    : Workload duration defined by longest task\n",
       "07:17:12  INFO    : Default policy: SCHED_OTHER\n",
@@ -247,7 +244,6 @@
       "07:17:14  INFO    : Executor [end]: /root/devlib-target/bin/taskset 0x4 /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_00.json\n",
       "07:17:14  INFO    : CPU3 calibration...\n",
       "07:17:14  DEBUG   : ulimit -Hr\n",
-      "07:17:14  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:14  INFO    : Setup new workload rta_calib\n",
       "07:17:14  INFO    : Workload duration defined by longest task\n",
       "07:17:14  INFO    : Default policy: SCHED_OTHER\n",
@@ -265,7 +261,6 @@
       "07:17:16  INFO    : Executor [end]: /root/devlib-target/bin/taskset 0x8 /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_00.json\n",
       "07:17:16  INFO    : CPU4 calibration...\n",
       "07:17:16  DEBUG   : ulimit -Hr\n",
-      "07:17:17  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:17  INFO    : Setup new workload rta_calib\n",
       "07:17:17  INFO    : Workload duration defined by longest task\n",
       "07:17:17  INFO    : Default policy: SCHED_OTHER\n",
@@ -283,7 +278,6 @@
       "07:17:18  INFO    : Executor [end]: /root/devlib-target/bin/taskset 0x10 /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_00.json\n",
       "07:17:18  INFO    : CPU5 calibration...\n",
       "07:17:18  DEBUG   : ulimit -Hr\n",
-      "07:17:19  ERROR   : Assuming taskset is preinstalled\n",
       "07:17:19  INFO    : Setup new workload rta_calib\n",
       "07:17:19  INFO    : Workload duration defined by longest task\n",
       "07:17:19  INFO    : Default policy: SCHED_OTHER\n",
diff --git a/ipynb/wlgen/simple_rtapp.ipynb b/ipynb/wlgen/simple_rtapp.ipynb
index 0754bad..5172713 100644
--- a/ipynb/wlgen/simple_rtapp.ipynb
+++ b/ipynb/wlgen/simple_rtapp.ipynb
@@ -284,7 +284,6 @@
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "04:36:36  ERROR   : Assuming taskset is preinstalled\n",
       "04:36:36  INFO    : Setup new workload simple\n",
       "04:36:36  INFO    : Workload duration defined by longest task\n",
       "04:36:36  INFO    : Default policy: SCHED_OTHER\n",
diff --git a/libs/utils/env.py b/libs/utils/env.py
index fa3c7ee..9629860 100644
--- a/libs/utils/env.py
+++ b/libs/utils/env.py
@@ -136,6 +136,16 @@
         # Initialize ftrace events
         if test_conf and 'ftrace' in test_conf:
             self.conf['ftrace'] = test_conf['ftrace']
+            self.__tools.append('trace-cmd')
+
+        # Add tools dependencies
+        if 'rt-app' in self.__tools:
+            self.__tools.append('taskset')
+            self.__tools.append('trace-cmd')
+            self.__tools.append('perf')
+            self.__tools.append('cgroup_run_into.sh')
+        # Sanitize list of dependencies to remove duplicates
+        self.__tools = list(set(self.__tools))
 
         # Initialize features
         if '__features__' not in self.conf:
diff --git a/libs/wlgen/wlgen/workload.py b/libs/wlgen/wlgen/workload.py
index b173bcd..ccb3871 100644
--- a/libs/wlgen/wlgen/workload.py
+++ b/libs/wlgen/wlgen/workload.py
@@ -58,9 +58,6 @@
         self.taskset = None
         self.taskset_cmd = ''
 
-        # target.deploy(target.tools, ['taskset'])
-        logging.error('Assuming taskset is preinstalled')
-
         # The command to execute a workload (defined by a derived class)
         self.command = None
 
diff --git a/tests/eas/hmp_parity.config b/tests/eas/hmp_parity.config
index a981311..495241d 100644
--- a/tests/eas/hmp_parity.config
+++ b/tests/eas/hmp_parity.config
@@ -10,7 +10,7 @@
     "EXPECTED_RESIDENCY_PCT" : 85,
     "TEST_CONF" : {
         "modules"  : [ "bl", "cpufreq" ],
-        "tools"    : [ "rt-app", "taskset" ],
+        "tools"    : [ "rt-app" ],
         "ftrace" : {
              "events" : [
                  "sched_switch"
diff --git a/tests/eas/rfc_eas.config b/tests/eas/rfc_eas.config
index 9aa2dfa..b24467d 100644
--- a/tests/eas/rfc_eas.config
+++ b/tests/eas/rfc_eas.config
@@ -3,7 +3,7 @@
     "modules"  : ["cpufreq", "hwmon", "bl"],
 
     /* Binary tools required by the experiments */
-    "tools"    : ["rt-app", "trace-cmd", "taskset", "perf"],
+    "tools"    : ["rt-app"],
 
     /* FTrace events required by the experiments */
     /* NOTE: Uncoment this section if you do not want to collect FTrace */
diff --git a/tests/eas/rfc_sfreq.config b/tests/eas/rfc_sfreq.config
index 5a9f4a6..d3bc880 100644
--- a/tests/eas/rfc_sfreq.config
+++ b/tests/eas/rfc_sfreq.config
@@ -4,7 +4,7 @@
     "modules"  : ["cpufreq", "hwmon", "bl"],
 
     /* Binary tools required by the experiments */
-    "tools"    : ["rt-app", "trace-cmd", "taskset", "perf"],
+    "tools"    : ["rt-app"],
 
     /* Set of platform configuraitons to test */
     "confs" : [
diff --git a/tests/eas/rfc_stune.config b/tests/eas/rfc_stune.config
index 4345b2b..8bee841 100644
--- a/tests/eas/rfc_stune.config
+++ b/tests/eas/rfc_stune.config
@@ -3,7 +3,7 @@
     "modules"  : ["cpufreq", "hwmon", "bl", "cgroups"],
 
     /* Binary tools required by the experiments */
-    "tools"    : ["rt-app", "trace-cmd", "taskset", "cgroup_run_into.sh"],
+    "tools"    : ["rt-app"],
 
     /* FTrace configuration */
     "ftrace" : {