Fix problem with looking for 'perf' in the wrong directory.

BUG=None
TEST=Tested with old and new chroots; seems to work.

Change-Id: Id1a7fc9d6b1dea0b96fe51032bb25d4722dd8b48
Reviewed-on: https://chrome-internal-review.googlesource.com/156381
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/results_cache.py b/crosperf/results_cache.py
index fb66e5c..3c644d0 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -243,14 +243,23 @@
                         perf_report_file)
       chroot_perf_report_file = misc.GetInsideChrootPath(self._chromeos_root,
                                                          perf_report_file)
-      command = ("/usr/sbin/perf report "
+      perf_path = os.path.join (self._chromeos_root,
+                                "chroot",
+                                "usr/bin/perf")
+
+      perf_file = "/usr/sbin/perf"
+      if os.path.exists(perf_path):
+        perf_file = "/usr/bin/perf"
+
+      command = ("%s report "
                  "-n "
                  "--symfs /build/%s "
                  "--vmlinux /build/%s/usr/lib/debug/boot/vmlinux "
                  "--kallsyms /build/%s/boot/System.map-* "
                  "-i %s --stdio "
                  "> %s" %
-                 (self._board,
+                 (perf_file,
+                  self._board,
                   self._board,
                   self._board,
                   chroot_perf_data_file,