tools/heap_profile: Fix for Windows
Skip gzipping on Windows. Also improve final messages.
Bug: https://github.com/google/perfetto/issues/133
Test: manual on Windows 10
Change-Id: I59453c8e2cd8cde886eb495cde0aa044c2188150
diff --git a/tools/heap_profile b/tools/heap_profile
index 09bd96c..630f9ff 100755
--- a/tools/heap_profile
+++ b/tools/heap_profile
@@ -551,16 +551,16 @@
for profile_file in profile_files:
shutil.copy(os.path.join(profile_path, profile_file), profile_target)
- subprocess.check_call(
- ['gzip'] + [os.path.join(profile_target, x) for x in profile_files])
-
symlink_path = None
- if args.output is None:
- symlink_path = os.path.join(
- os.path.dirname(profile_target), "heap_profile-latest")
- if os.path.lexists(symlink_path):
- os.unlink(symlink_path)
- os.symlink(profile_target, symlink_path)
+ if not sys.platform.startswith('win'):
+ subprocess.check_call(
+ ['gzip'] + [os.path.join(profile_target, x) for x in profile_files])
+ if args.output is None:
+ symlink_path = os.path.join(
+ os.path.dirname(profile_target), "heap_profile-latest")
+ if os.path.lexists(symlink_path):
+ os.unlink(symlink_path)
+ os.symlink(profile_target, symlink_path)
if symlink_path is not None:
print("Wrote profiles to {} (symlink {})".format(profile_target,
@@ -568,8 +568,11 @@
else:
print("Wrote profiles to {}".format(profile_target))
- print("These can be viewed using pprof. Googlers: head to pprof/ and "
- "upload them.")
+ print("The raw-trace file can be viewed using https://ui.perfetto.dev.")
+ print("The heap_dump.* files can be viewed using pprof/ (Googlers only) " +
+ "or https://www.speedscope.app/.")
+ print("The two above are equivalent. The raw-trace contains the union of " +
+ "all the heap dumps.")
# BEGIN_SECTION_GENERATED_BY(roll-prebuilts)