[tools] linux-perf-d8.py: Add option to skip pprof

Change-Id: I2ee7c6feeae8f410ae6b9a1214bf387f321c25e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3963274
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83798}
This commit is contained in:
Matthias Liedtke 2022-10-19 14:20:47 +02:00 committed by V8 LUCI CQ
parent 48bc3505f0
commit 02de5c49cb

View File

@ -39,6 +39,11 @@ parser.add_option(
metavar="OUT_DIR", metavar="OUT_DIR",
help="Output directory for linux perf profile files") help="Output directory for linux perf profile files")
parser.add_option("--timeout", type=float, help="Stop d8 after N seconds") parser.add_option("--timeout", type=float, help="Stop d8 after N seconds")
parser.add_option(
"--skip-pprof",
action="store_true",
default=False,
help="Skip pprof upload (relevant for Googlers only)")
d8_options = optparse.OptionGroup( d8_options = optparse.OptionGroup(
parser, "d8-forwarded Options", parser, "d8-forwarded Options",
@ -232,14 +237,14 @@ def inject_v8_symbols(perf_dat_file):
result = inject_v8_symbols(perf_data_file) result = inject_v8_symbols(perf_data_file)
if result is None: if result is None:
print("No perf files were successfully processed" print("No perf files were successfully processed"
" Check for errors or partial results in '{options.perf_data_dir}'") f" Check for errors or partial results in '{options.perf_data_dir}'")
exit(1) exit(1)
log(f"RESULTS in '{options.perf_data_dir}'") log(f"RESULTS in '{options.perf_data_dir}'")
BYTES_TO_MIB = 1 / 1024 / 1024 BYTES_TO_MIB = 1 / 1024 / 1024
print(f"{result.name:67}{(result.stat().st_size*BYTES_TO_MIB):10.2f}MiB") print(f"{result.name:67}{(result.stat().st_size*BYTES_TO_MIB):10.2f}MiB")
# ============================================================================== # ==============================================================================
if not shutil.which('gcertstatus'): if not shutil.which('gcertstatus') or options.skip_pprof:
log("ANALYSIS") log("ANALYSIS")
print(f"perf report --input='{result}'") print(f"perf report --input='{result}'")
print(f"pprof '{result}'") print(f"pprof '{result}'")