Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6220166ee3276948b72e46b3b81e0c6eb2282b7
      
https://github.com/WebKit/WebKit/commit/d6220166ee3276948b72e46b3b81e0c6eb2282b7
  Author: Dewei Zhu <[email protected]>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M Tools/Scripts/pgo-profile
    M Tools/Scripts/webkitpy/llvm_profile_utils.py
    A Tools/Scripts/webkitpy/llvm_profile_utils_unittest.py

  Log Message:
  -----------
  pgo-profile should discover optional frameworks from the profile directory.
https://bugs.webkit.org/show_bug.cgi?id=324264
rdar://187484488

Rubber-stamped by Elliott Williams.

pgo-profile hard-coded PROFILED_DYLIBS = [JavaScriptCore, WebCore, WebKit] and
threw away every other framework's profiles. That list stays, as
REQUIRED_FRAMEWORK_NAMES, and is still processed whether or not a profile is
found, so existing invocations behave exactly as before.

Any other framework is now discovered from the profiles each sub-command reads
and treated as optional: combine drops the benchmark groups with no profile for
it and re-simplifies the weights over the groups that have one.

* Tools/Scripts/pgo-profile:
(merge):
(combine):
(compress_parser):
(decompress_parser):
(compress):
(decompress):
* Tools/Scripts/webkitpy/llvm_profile_utils.py:
(ProfiledFramework):
(resolve_profiled_frameworks):
(weighted_profiles_for_framework):
(merge_raw_profiles_in_directory):
(merge_raw_profiles_in_directory_by_prefixes): Deleted.
* Tools/Scripts/webkitpy/llvm_profile_utils_unittest.py: Added.
(write_file):
(ResolveProfiledFrameworksTest):
(ResolveProfiledFrameworksTest._directory):
(ResolveProfiledFrameworksTest._names):
(ResolveProfiledFrameworksTest.test_the_required_frameworks_are_the_three_instrumented_ones):
(ResolveProfiledFrameworksTest.test_an_empty_directory_still_yields_the_required_frameworks):
(ResolveProfiledFrameworksTest.test_a_required_framework_with_no_profile_is_still_returned_and_still_required):
(ResolveProfiledFrameworksTest.test_discovered_frameworks_are_optional_sorted_and_after_the_required_ones):
(ResolveProfiledFrameworksTest.test_a_discovered_required_framework_is_not_repeated_as_optional):
(ResolveProfiledFrameworksTest.test_frameworks_are_unioned_across_directories_and_de_duplicated):
(ResolveProfiledFrameworksTest.test_raw_profile_names_are_parsed_back_into_framework_names):
(ResolveProfiledFrameworksTest.test_raw_profile_names_are_parsed_whatever_the_expansions_produced):
(ResolveProfiledFrameworksTest.test_several_raw_profiles_of_one_framework_discover_it_once):
(ResolveProfiledFrameworksTest.test_a_raw_profile_with_no_underscore_is_ignored_with_a_warning):
(ResolveProfiledFrameworksTest.test_every_discovered_raw_profile_name_is_one_merges_glob_matches):
(ResolveProfiledFrameworksTest.test_only_raw_profiles_must_carry_the_naming_convention):
(ResolveProfiledFrameworksTest.test_a_discovered_profdata_name_rebuilds_the_path_it_came_from):
(ResolveProfiledFrameworksTest.test_profdata_and_profdata_compressed_do_not_cross_match):
(ResolveProfiledFrameworksTest.test_files_that_are_not_profiles_are_ignored):
(ResolveProfiledFrameworksTest.test_a_directory_named_like_a_profile_is_not_discovered):
(ResolveProfiledFrameworksTest.test_a_filename_that_is_not_a_valid_framework_name_is_skipped_with_a_warning):
(ResolveProfiledFrameworksTest.test_framework_name_pattern_rejects_embedded_or_trailing_newline):
(ResolveProfiledFrameworksTest.test_plausible_framework_names_are_discovered):
(ResolveProfiledFrameworksTest.test_the_resolved_list_is_logged_once):
(ResolveProfiledFrameworksTest.test_a_single_directory_passed_as_a_string_is_rejected):
(WeightedProfilesForFrameworkTest):
(WeightedProfilesForFrameworkTest._group_directories):
(WeightedProfilesForFrameworkTest.test_required_framework_uses_every_group_even_when_a_profile_is_missing):
(WeightedProfilesForFrameworkTest.test_optional_framework_drops_missing_groups_and_reweights):
(WeightedProfilesForFrameworkTest.test_optional_framework_present_in_a_single_group_uses_it_alone):
(WeightedProfilesForFrameworkTest.test_a_group_whose_profile_is_a_directory_or_a_dangling_symlink_is_dropped):
(WeightedProfilesForFrameworkTest.test_optional_framework_present_everywhere_matches_required_weights):
(WeightedProfilesForFrameworkTest.test_no_groups_at_all_is_rejected):
(MergeRawProfilesTest):
(MergeRawProfilesTest._recording_merge):
(MergeRawProfilesTest._recording_merge.merge):
(MergeRawProfilesTest._write_raw_profiles):
(MergeRawProfilesTest.test_every_framework_it_is_given_is_merged_and_its_output_returned):
(MergeRawProfilesTest.test_required_framework_without_raw_profiles_still_invokes_llvm_profdata):
(MergeRawProfilesTest.test_a_framework_does_not_swallow_a_longer_named_frameworks_profiles):
(PGOProfileSubCommandTest):
(PGOProfileSubCommandTest._run):
(PGOProfileSubCommandTest._write_raw_profile):
(PGOProfileSubCommandTest._write_raw_profiles):
(PGOProfileSubCommandTest.test_merge_also_merges_a_framework_it_discovered):
(PGOProfileSubCommandTest.test_merge_ignores_a_raw_profile_that_does_not_follow_the_naming_convention):
(PGOProfileSubCommandTest.test_merge_still_fails_when_a_required_framework_produced_nothing):
(PGOProfileSubCommandTest.test_combine_drops_the_groups_without_a_discovered_framework_and_reweights):
(PGOProfileSubCommandTest.test_combine_drops_the_groups_without_a_discovered_framework_and_reweights.weights_line):
(PGOProfileSubCommandTest.test_combine_uses_a_discovered_framework_from_the_single_group_that_has_it):
(PGOProfileSubCommandTest.test_compress_also_compresses_a_framework_it_discovered):
(PGOProfileSubCommandTest.test_decompress_round_trips_a_framework_it_discovered):
(PGOProfileSubCommandTest.test_compress_still_fails_for_a_missing_required_framework):
(PGOProfileSubCommandTest.test_a_compression_tool_failure_reports_what_the_tool_said):
(PGOProfileSubCommandTest.test_every_sub_command_logs_the_framework_list_it_resolved):

Canonical link: https://commits.webkit.org/321347@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to