[go: nahoru, domu]

cygprofile: Add run group processing to process_profiles.py

The new orderfile work will require dealing with phased
instrumentation (eg, startup vs steady state profiles) as well as
combining profiles from multiple instrumentation runs. This extends
process_profiles to deal with that consistently with how production
orderfiles are generated.

The extensive class comment for ProfileManager explains it all in more
detail.

Bug: 758566
Change-Id: Ia360769d9ffefceea53eeb09f02ba16ae768c539
Reviewed-on: https://chromium-review.googlesource.com/873210
Commit-Queue: Matthew Cary <mattcary@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530832}
diff --git a/tools/cygprofile/orderfile_generator_backend.py b/tools/cygprofile/orderfile_generator_backend.py
index 45db9aae..147a067 100755
--- a/tools/cygprofile/orderfile_generator_backend.py
+++ b/tools/cygprofile/orderfile_generator_backend.py
@@ -541,6 +541,9 @@
         assert os.path.exists(self._compiler.lib_chrome_so)
         offsets = process_profiles.GetReachedOffsetsFromDumpFiles(
             files, self._compiler.lib_chrome_so)
+        if not offsets:
+          raise Exception('No profiler offsets found in {}'.format(
+                          '\n'.join(files)))
         with open(self._MERGED_CYGLOG_FILENAME, 'w') as f:
           f.write('\n'.join(map(str, offsets)))
       else:
@@ -548,7 +551,7 @@
           self._step_recorder.RunCommand([self._MERGE_TRACES_SCRIPT] + files,
                                          constants.DIR_SOURCE_ROOT,
                                          stdout=merged_cyglog)
-    except CommandError:
+    except Exception:
       for f in files:
         self._SaveForDebugging(f)
       raise