From 358ce1c1a19146a3b23e0224ccf743ca06795de8 Mon Sep 17 00:00:00 2001 From: zhangsizheng Date: Sun, 29 Sep 2024 20:31:59 +0800 Subject: [PATCH 1/4] enable pgo --- BUILD.gn | 8 ++++++++ tools/builtins-pgo/check_pgo.py | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tools/builtins-pgo/check_pgo.py diff --git a/BUILD.gn b/BUILD.gn index f7ca30dd9..b12fd1700 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -201,6 +201,7 @@ declare_args() { # 5. Build again with v8_builtins_profiling_log_file set to the file created # in step 3 or 4. v8_builtins_profiling_log_file = "default" + pgo_exists_flag = false # Enables various testing features. v8_enable_test_features = "" @@ -402,6 +403,13 @@ declare_args() { } # Derived defaults. +pgo_exists_flag = exec_script("tools/builtins-pgo/check_pgo.py", ["--pgo_path", "profiles/ohos.profile"], "value") +if (pgo_exists_flag) { + v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/ohos.profile" +} else { + v8_builtins_profiling_log_file = "default" +} +print(v8_builtins_profiling_log_file) if (cppgc_enable_verify_heap == "") { cppgc_enable_verify_heap = v8_enable_debugging_features || dcheck_always_on } diff --git a/tools/builtins-pgo/check_pgo.py b/tools/builtins-pgo/check_pgo.py new file mode 100644 index 000000000..d8757d954 --- /dev/null +++ b/tools/builtins-pgo/check_pgo.py @@ -0,0 +1,20 @@ +import argparse +import os + +def check_pgo_exists(path): + return os.path.exists(path) + +def main(): + parser = argparse.ArgumentParser(description="Check if pgo profile exists") + parser.add_argument('--pgo_path', type=str, required=True, help='pgo path') + args = parser.parse_args() + path = args.pgo_path + abs_path = os.path.join(os.path.dirname(__file__), path) + return check_pgo_exists(abs_path) + +if __name__ == '__main__': + value = main() + if value: + print("true") + else: + print("false") \ No newline at end of file -- Gitee From 20e04e2c346a837b7416dec8ef22f8dc500378f7 Mon Sep 17 00:00:00 2001 From: zhangsizheng Date: Sun, 29 Sep 2024 20:31:59 +0800 Subject: [PATCH 2/4] enable pgo Signed-off-by: zhangsizheng --- BUILD.gn | 8 ++++++++ tools/builtins-pgo/check_pgo.py | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tools/builtins-pgo/check_pgo.py diff --git a/BUILD.gn b/BUILD.gn index f7ca30dd9..b12fd1700 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -201,6 +201,7 @@ declare_args() { # 5. Build again with v8_builtins_profiling_log_file set to the file created # in step 3 or 4. v8_builtins_profiling_log_file = "default" + pgo_exists_flag = false # Enables various testing features. v8_enable_test_features = "" @@ -402,6 +403,13 @@ declare_args() { } # Derived defaults. +pgo_exists_flag = exec_script("tools/builtins-pgo/check_pgo.py", ["--pgo_path", "profiles/ohos.profile"], "value") +if (pgo_exists_flag) { + v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/ohos.profile" +} else { + v8_builtins_profiling_log_file = "default" +} +print(v8_builtins_profiling_log_file) if (cppgc_enable_verify_heap == "") { cppgc_enable_verify_heap = v8_enable_debugging_features || dcheck_always_on } diff --git a/tools/builtins-pgo/check_pgo.py b/tools/builtins-pgo/check_pgo.py new file mode 100644 index 000000000..d8757d954 --- /dev/null +++ b/tools/builtins-pgo/check_pgo.py @@ -0,0 +1,20 @@ +import argparse +import os + +def check_pgo_exists(path): + return os.path.exists(path) + +def main(): + parser = argparse.ArgumentParser(description="Check if pgo profile exists") + parser.add_argument('--pgo_path', type=str, required=True, help='pgo path') + args = parser.parse_args() + path = args.pgo_path + abs_path = os.path.join(os.path.dirname(__file__), path) + return check_pgo_exists(abs_path) + +if __name__ == '__main__': + value = main() + if value: + print("true") + else: + print("false") \ No newline at end of file -- Gitee From b78da73c1c8d46fbd4f4081777bf00db7cdb3c5d Mon Sep 17 00:00:00 2001 From: Sizheng <14739595+string_sz@user.noreply.gitee.com> Date: Sun, 29 Sep 2024 14:11:57 +0000 Subject: [PATCH 3/4] Revert "enable pgo" This reverts commit 20e04e2c346a837b7416dec8ef22f8dc500378f7. --- BUILD.gn | 8 -------- tools/builtins-pgo/check_pgo.py | 20 -------------------- 2 files changed, 28 deletions(-) delete mode 100644 tools/builtins-pgo/check_pgo.py diff --git a/BUILD.gn b/BUILD.gn index b12fd1700..f7ca30dd9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -201,7 +201,6 @@ declare_args() { # 5. Build again with v8_builtins_profiling_log_file set to the file created # in step 3 or 4. v8_builtins_profiling_log_file = "default" - pgo_exists_flag = false # Enables various testing features. v8_enable_test_features = "" @@ -403,13 +402,6 @@ declare_args() { } # Derived defaults. -pgo_exists_flag = exec_script("tools/builtins-pgo/check_pgo.py", ["--pgo_path", "profiles/ohos.profile"], "value") -if (pgo_exists_flag) { - v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/ohos.profile" -} else { - v8_builtins_profiling_log_file = "default" -} -print(v8_builtins_profiling_log_file) if (cppgc_enable_verify_heap == "") { cppgc_enable_verify_heap = v8_enable_debugging_features || dcheck_always_on } diff --git a/tools/builtins-pgo/check_pgo.py b/tools/builtins-pgo/check_pgo.py deleted file mode 100644 index d8757d954..000000000 --- a/tools/builtins-pgo/check_pgo.py +++ /dev/null @@ -1,20 +0,0 @@ -import argparse -import os - -def check_pgo_exists(path): - return os.path.exists(path) - -def main(): - parser = argparse.ArgumentParser(description="Check if pgo profile exists") - parser.add_argument('--pgo_path', type=str, required=True, help='pgo path') - args = parser.parse_args() - path = args.pgo_path - abs_path = os.path.join(os.path.dirname(__file__), path) - return check_pgo_exists(abs_path) - -if __name__ == '__main__': - value = main() - if value: - print("true") - else: - print("false") \ No newline at end of file -- Gitee From df663b4fd585c53240e277b47b6837f354b13e73 Mon Sep 17 00:00:00 2001 From: Sizheng <14739595+string_sz@user.noreply.gitee.com> Date: Sun, 29 Sep 2024 14:22:16 +0000 Subject: [PATCH 4/4] Revert "Revert "enable pgo"" This reverts commit b78da73c1c8d46fbd4f4081777bf00db7cdb3c5d. --- BUILD.gn | 8 ++++++++ tools/builtins-pgo/check_pgo.py | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tools/builtins-pgo/check_pgo.py diff --git a/BUILD.gn b/BUILD.gn index f7ca30dd9..b12fd1700 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -201,6 +201,7 @@ declare_args() { # 5. Build again with v8_builtins_profiling_log_file set to the file created # in step 3 or 4. v8_builtins_profiling_log_file = "default" + pgo_exists_flag = false # Enables various testing features. v8_enable_test_features = "" @@ -402,6 +403,13 @@ declare_args() { } # Derived defaults. +pgo_exists_flag = exec_script("tools/builtins-pgo/check_pgo.py", ["--pgo_path", "profiles/ohos.profile"], "value") +if (pgo_exists_flag) { + v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/ohos.profile" +} else { + v8_builtins_profiling_log_file = "default" +} +print(v8_builtins_profiling_log_file) if (cppgc_enable_verify_heap == "") { cppgc_enable_verify_heap = v8_enable_debugging_features || dcheck_always_on } diff --git a/tools/builtins-pgo/check_pgo.py b/tools/builtins-pgo/check_pgo.py new file mode 100644 index 000000000..d8757d954 --- /dev/null +++ b/tools/builtins-pgo/check_pgo.py @@ -0,0 +1,20 @@ +import argparse +import os + +def check_pgo_exists(path): + return os.path.exists(path) + +def main(): + parser = argparse.ArgumentParser(description="Check if pgo profile exists") + parser.add_argument('--pgo_path', type=str, required=True, help='pgo path') + args = parser.parse_args() + path = args.pgo_path + abs_path = os.path.join(os.path.dirname(__file__), path) + return check_pgo_exists(abs_path) + +if __name__ == '__main__': + value = main() + if value: + print("true") + else: + print("false") \ No newline at end of file -- Gitee