Fix bug introduced with the --show_all_results flag, using cache.

The call to self._ProcessResults is supposed to take the show_all_results
flag as an argument.  This was overlooked in the read-it-out-of-the-cache
path when this change was first introduced.  This CL fixes that.

BUG=None
TEST=I tested cached and non-cached runs, with and without the
--show_all_results option.  Everything worked as it should.

Change-Id: Ibf8f206406b0a4535d48b598709e62135289f993
Reviewed-on: https://chrome-internal-review.googlesource.com/156367
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
diff --git a/crosperf/benchmark_run.py b/crosperf/benchmark_run.py
index d06f2bf..fa40997 100644
--- a/crosperf/benchmark_run.py
+++ b/crosperf/benchmark_run.py
@@ -76,7 +76,8 @@
                     self._logger,
                     self.label,
                     self.share_users,
-                    self.benchmark.suite
+                    self.benchmark.suite,
+                    self.benchmark.show_all_results
                    )
 
     self.result = self.cache.ReadResult()
@@ -215,7 +216,8 @@
                     self._logger,
                     self.label,
                     self.share_users,
-                    self.benchmark.suite
+                    self.benchmark.suite,
+                    self.benchmark.show_all_results
                    )
 
     self.result = self.cache.ReadResult()
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index 3c644d0..2402c2e 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -313,7 +313,9 @@
     # Now parse all perf report files and include them in keyvals.
     self._GatherPerfResults()
 
-  def _PopulateFromCacheDir(self, cache_dir):
+  def _PopulateFromCacheDir(self, cache_dir, show_all, test, suite):
+    self.test_name = test
+    self.suite = suite
     # Read in everything from the cache directory.
     with open(os.path.join(cache_dir, RESULTS_FILE), "r") as f:
       self.out = pickle.load(f)
@@ -333,7 +335,7 @@
     self.results_dir = self._temp_dir
     self.perf_data_files = self._GetPerfDataFiles()
     self.perf_report_files = self._GetPerfReportFiles()
-    self._ProcessResults()
+    self._ProcessResults(show_all)
 
   def CleanUp(self, rm_chroot_tmp):
     if rm_chroot_tmp and self.results_dir:
@@ -394,14 +396,14 @@
     return result
 
   @classmethod
-  def CreateFromCacheHit(cls, logger, label, cache_dir,
+  def CreateFromCacheHit(cls, logger, label, cache_dir, show_all, test,
                          suite="pyauto"):
     if suite == "telemetry":
       result = TelemetryResult(logger, label)
     else:
       result = cls(logger, label)
     try:
-      result._PopulateFromCacheDir(cache_dir)
+      result._PopulateFromCacheDir(cache_dir, show_all, test, suite)
 
     except Exception as e:
       logger.LogError("Exception while using cache: %s" % e)
@@ -496,7 +498,7 @@
 
   def Init(self, chromeos_image, chromeos_root, test_name, iteration,
            test_args, profiler_args, machine_manager, board, cache_conditions,
-           logger_to_use, label, share_users, suite):
+           logger_to_use, label, share_users, suite, show_all_results):
     self.chromeos_image = chromeos_image
     self.chromeos_root = chromeos_root
     self.test_name = test_name
@@ -511,6 +513,7 @@
     self.label = label
     self.share_users = share_users
     self.suite = suite
+    self.show_all = show_all_results
 
   def _GetCacheDirForRead(self):
     matching_dirs = []
@@ -598,6 +601,8 @@
     result = Result.CreateFromCacheHit(self._logger,
                                        self.label,
                                        cache_dir,
+                                       self.show_all,
+                                       self.test_name,
                                        self.suite)
     if not result:
       return None