Fix small bugs with non-autotest Telemetry; other cleanups.

This CL fixes various small problems found during recent testing:
- Force show_all_results to be true for 'pure' telemetry case (the
results filtering needs the autotest results to work properly)
- Fix bug that was inserting extra 'src' into Chrome src path sometimes
- Since non-autotest Telemetry and non-Telemetry-Crosperf tests can't
handle 'perf' make it a Fatal error to call them with perf args.
- Add missing field to example experiment file.
- Add status output messages to downlaod_images.py for non-verbose logging.

BUG=None
TEST=Tested all these fixes on multiple test runs.

Change-Id: If8209356c695dc8b21f8627399a1cbd4a858df23
Reviewed-on: https://chrome-internal-review.googlesource.com/161759
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
diff --git a/crosperf/benchmark.py b/crosperf/benchmark.py
index c8a26bb..93462fa 100644
--- a/crosperf/benchmark.py
+++ b/crosperf/benchmark.py
@@ -29,3 +29,5 @@
     self.iteration_adjusted = False
     self.suite = suite
     self.show_all_results = show_all_results
+    if self.suite == "telemetry":
+      self.show_all_results = True
diff --git a/crosperf/download_images.py b/crosperf/download_images.py
index ac8fd3a..3927000 100644
--- a/crosperf/download_images.py
+++ b/crosperf/download_images.py
@@ -26,6 +26,9 @@
     build_id_tuple = eval(build_id_tuple_str)
     build_id = build_id_tuple[0]
 
+    if self.log_level == "average":
+      self._logger.LogOutput ("Preparing to download %s image to local directory." % build_id)
+
     # Make sure the directory for downloading the image exists.
     download_path = os.path.join(chromeos_root, "chroot/tmp",
                                  build_id)
@@ -42,11 +45,20 @@
                  "/chromiumos_test_image.tar.xz /tmp/%s" % (build_id,
                                                             build_id))
 
+      if self.log_level != "verbose":
+        self._logger.LogOutput ("CMD: %s" % command)
       retval = self._ce.ChrootRunCommand(chromeos_root, command)
 
       # Uncompress and untar the downloaded image.
       command = ("cd /tmp/%s ;unxz chromiumos_test_image.tar.xz; "
                  "tar -xvf chromiumos_test_image.tar" % build_id)
+      if self.log_level != "verbose":
+        self._logger.LogOutput("CMD: %s" % command)
+        print("(Uncompressing and un-tarring may take a couple of minutes..."
+              "please be patient.)")
       retval = self._ce.ChrootRunCommand(chromeos_root, command)
 
+    if retval == 0 and self.log_level != "quiet":
+      self._logger.LogOutput("Using image from %s." % image_path)
+
     return retval, image_path
diff --git a/crosperf/experiment_files/telemetry-crosperf-with-external-chrome-src.exp b/crosperf/experiment_files/telemetry-crosperf-with-external-chrome-src.exp
index 551fac6..517c13f 100644
--- a/crosperf/experiment_files/telemetry-crosperf-with-external-chrome-src.exp
+++ b/crosperf/experiment_files/telemetry-crosperf-with-external-chrome-src.exp
@@ -23,5 +23,9 @@
 # Replace the chromeos image below with the actual path to your test imnage.
 test_image {
   chromeos_image:<path-to-your-chroot>/src/build/images/<board>/test-image/chromiumos_test_image.bin
+  # Replace '/usr/local/google/chrome-top' with the path to the
+  # top of your Chrome source tree. From that directory
+  # "./src/tools/perf/run_benchmark" should be a valid file path.
+  chrome_src:/usr/local/google/chrome-top
 }
 
diff --git a/crosperf/label.py b/crosperf/label.py
index 52f98ce..bbcf18a 100644
--- a/crosperf/label.py
+++ b/crosperf/label.py
@@ -45,10 +45,10 @@
     self.chromeos_root = chromeos_root
     if not chrome_src:
       self.chrome_src = os.path.join(self.chromeos_root,
-          ".cache/distfiles/target/chrome-src-internal/src")
+          ".cache/distfiles/target/chrome-src-internal")
       if not os.path.exists(self.chrome_src):
         self.chrome_src = os.path.join(self.chromeos_root,
-          ".cache/distfiles/target/chrome-src/src")
+          ".cache/distfiles/target/chrome-src")
     else:
       chromeos_src = misc.CanonicalizePath(chrome_src)
       if not chromeos_src:
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 8e2847e..1f816e4 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -53,7 +53,7 @@
   def Run(self, machine, label, benchmark, test_args, profiler_args):
     self.PinGovernorExecutionFrequencies(machine, label.chromeos_root)
     if benchmark.suite == "telemetry":
-      return self.Telemetry_Run(machine, label, benchmark)
+      return self.Telemetry_Run(machine, label, benchmark, profiler_args)
     elif benchmark.suite == "telemetry_Crosperf":
       return self.Telemetry_Crosperf_Run(machine, label, benchmark,
                                          test_args, profiler_args)
@@ -126,7 +126,7 @@
     if test_args:
       options += " %s" % test_args
     if profiler_args:
-      self._logger.LogError("test_that does not support profiler.")
+      self._logger.LogFatal("test_that does not support profiler.")
     command = "rm -rf /usr/local/autotest/results/*"
     self._ce.CrosRunCommand(command, machine=machine, username="root",
                             chromeos_root=label.chromeos_root)
@@ -188,7 +188,7 @@
                                       cros_sdk_options=chrome_root_options)
 
 
-  def Telemetry_Run(self, machine, label, benchmark):
+  def Telemetry_Run(self, machine, label, benchmark, profiler_args):
     telemetry_run_path = ""
     if not os.path.isdir(label.chrome_src):
       self._logger.LogFatal("Cannot find chrome src dir to"
@@ -198,6 +198,9 @@
       if not os.path.exists(telemetry_run_path):
         self._logger.LogFatal("Cannot find %s directory." % telemetry_run_path)
 
+    if profiler_args:
+      self._logger.LogFatal("Telemetry does not support the perf profiler.")
+
     rsa_key = os.path.join(label.chromeos_root,
         "src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa")