Commit 8626a1bd authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[builtins] Add builtins PGO profile for arm64

Bug: v8:10470
Change-Id: Icbd4c052b8d39300e45ab6fbee422839d852132b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3788207Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82010}
parent b8fe2724
...@@ -452,6 +452,8 @@ if (v8_builtins_profiling_log_file == "default") { ...@@ -452,6 +452,8 @@ if (v8_builtins_profiling_log_file == "default") {
if (is_debug == false) { if (is_debug == false) {
if (v8_current_cpu == "x64") { if (v8_current_cpu == "x64") {
v8_builtins_profiling_log_file = "tools/builtins-pgo/x64.profile" v8_builtins_profiling_log_file = "tools/builtins-pgo/x64.profile"
} else if (v8_current_cpu == "arm64") {
v8_builtins_profiling_log_file = "tools/builtins-pgo/arm64.profile"
} }
} }
} }
......
This diff is collapsed.
...@@ -12,6 +12,13 @@ parser = argparse.ArgumentParser( ...@@ -12,6 +12,13 @@ parser = argparse.ArgumentParser(
description='Generate builtin PGO profiles. ' + description='Generate builtin PGO profiles. ' +
'The script has to be run from the root of a V8 checkout and updates the profiles in `tools/builtins-pgo`.' 'The script has to be run from the root of a V8 checkout and updates the profiles in `tools/builtins-pgo`.'
) )
parser.add_argument(
'arch', help='target cpu to build the profile for: x64 or arm64')
parser.add_argument(
'--target-cpu',
default=None,
help='target cpu for V8 binary (for simulator builds), by default it\'s equal to `arch`'
)
parser.add_argument( parser.add_argument(
'benchmark_path', 'benchmark_path',
help='path to benchmark runner .js file, usually JetStream2\'s `cli.js`') help='path to benchmark runner .js file, usually JetStream2\'s `cli.js`')
...@@ -22,6 +29,9 @@ parser.add_argument( ...@@ -22,6 +29,9 @@ parser.add_argument(
args = parser.parse_args() args = parser.parse_args()
if args.target_cpu == None:
args.target_cpu = args.arch
def try_start_goma(): def try_start_goma():
res = subprocess.run(["goma_ctl", "ensure_start"]) res = subprocess.run(["goma_ctl", "ensure_start"])
...@@ -56,14 +66,18 @@ v8_path = os.getcwd() ...@@ -56,14 +66,18 @@ v8_path = os.getcwd()
has_goma = try_start_goma() has_goma = try_start_goma()
X64_ARGS_TEMPLATE = """\ ARGS_TEMPLATE = """\
is_debug = false is_debug = false
target_cpu = "x64" target_cpu = "{target_cpu}"
v8_target_cpu = "{v8_target_cpu}"
use_goma = {has_goma} use_goma = {has_goma}
v8_enable_builtins_profiling = true v8_enable_builtins_profiling = true
""".format(has_goma="true" if has_goma else "false") """.format(
v8_target_cpu=args.arch,
target_cpu=args.target_cpu,
has_goma="true" if has_goma else "false")
for arch, gn_args in [("x64", X64_ARGS_TEMPLATE)]: for arch, gn_args in [(args.arch, ARGS_TEMPLATE)]:
build_dir = os.path.join(args.out_path, build_dir = os.path.join(args.out_path,
arch + ".release.generate_builtin_pgo_profile") arch + ".release.generate_builtin_pgo_profile")
d8_path = build_d8(build_dir, gn_args) d8_path = build_d8(build_dir, gn_args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment