diff options
author | 2024-05-24 12:04:48 +0000 | |
---|---|---|
committer | 2024-06-20 16:48:02 +0000 | |
commit | 65535f73cd4a37f902167e0150a3a5dc30ea5e06 (patch) | |
tree | 9d8d775da28c4c9529051c4d76a06d22cbf58860 /cmdline | |
parent | 05a5ff2a4152571e8e82ba4c407cf0fba0a57ddd (diff) |
Make sure to mark classes/methods as startup.
The GetMinFirstSaveMs() which depends on the system property
`dalvik.vm.ps-min-first-save-ms` should only impact the waiting
time to dump the profile to disk, but it shouldn't impact marking
classes/methods as startup.
With this change, even if `dalvik.vm.ps-min-first-save-ms` is
more than the startup time, we will still mark classes/methods
as startup when startup is completed (either calling
reportFullyDrawn or reaching the 5 seconds). Before this change
the classes/methods were marked as startup only after
`dalvik.vm.ps-min-first-save-ms`.
With this change if `dalvik.vm.ps-min-first-save-ms` was set, then
dumping the profile could take more time than
`dalvik.vm.ps-min-first-save-ms`, since we could wait for JIT
notifications for sometime. This is expected since
`dalvik.vm.ps-min-first-save-ms` is the min time to dump the
first profile not the exact time. Before this change the profile
was dumped right after `dalvik.vm.ps-min-first-save-ms`.
Bug: 319911625
Test: Running the BaselineProfileRuleTest `adb shell am instrument -w -e androidx.benchmark.targetPackageName androidx.benchmark.integration.macrobenchmark.target -e class androidx.benchmark.integration.macrobenchmark.BaselineProfileRuleTest androidx.benchmark.integration.macrobenchmark/androidx.test.runner.AndroidJUnitRunner`
Change-Id: Ic9e727f449fe7feb858de6d2f55460804b774cff
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/cmdline_parser_test.cc | 24 | ||||
-rw-r--r-- | cmdline/cmdline_types.h | 6 |
2 files changed, 13 insertions, 17 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index e586dd4292..ea688d650c 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -36,12 +36,11 @@ namespace art { // This has a gtest dependency, which is why it's in the gtest only. bool operator==(const ProfileSaverOptions& lhs, const ProfileSaverOptions& rhs) { return lhs.enabled_ == rhs.enabled_ && - lhs.min_save_period_ms_ == rhs.min_save_period_ms_ && - lhs.save_resolved_classes_delay_ms_ == rhs.save_resolved_classes_delay_ms_ && - lhs.min_methods_to_save_ == rhs.min_methods_to_save_ && - lhs.min_classes_to_save_ == rhs.min_classes_to_save_ && - lhs.min_notification_before_wake_ == rhs.min_notification_before_wake_ && - lhs.max_notification_before_wake_ == rhs.max_notification_before_wake_; + lhs.min_save_period_ms_ == rhs.min_save_period_ms_ && + lhs.min_methods_to_save_ == rhs.min_methods_to_save_ && + lhs.min_classes_to_save_ == rhs.min_classes_to_save_ && + lhs.min_notification_before_wake_ == rhs.min_notification_before_wake_ && + lhs.max_notification_before_wake_ == rhs.max_notification_before_wake_; } bool UsuallyEquals(double expected, double actual) { @@ -489,18 +488,17 @@ TEST_F(CmdlineParserTest, TestJitOptions) { * -Xps-* */ TEST_F(CmdlineParserTest, ProfileSaverOptions) { - ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, 8, "abc", true); + ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, "abc", true); EXPECT_SINGLE_PARSE_VALUE(opt, "-Xjitsaveprofilinginfo " "-Xps-min-save-period-ms:1 " "-Xps-min-first-save-ms:2 " - "-Xps-save-resolved-classes-delay-ms:3 " - "-Xps-min-methods-to-save:4 " - "-Xps-min-classes-to-save:5 " - "-Xps-min-notification-before-wake:6 " - "-Xps-max-notification-before-wake:7 " - "-Xps-inline-cache-threshold:8 " + "-Xps-min-methods-to-save:3 " + "-Xps-min-classes-to-save:4 " + "-Xps-min-notification-before-wake:5 " + "-Xps-max-notification-before-wake:6 " + "-Xps-inline-cache-threshold:7 " "-Xps-profile-path:abc " "-Xps-profile-boot-class-path", M::ProfileSaverOpts); diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h index 4a33fb8b55..fe7a55d559 100644 --- a/cmdline/cmdline_types.h +++ b/cmdline/cmdline_types.h @@ -826,10 +826,8 @@ struct CmdlineType<ProfileSaverOptions> : CmdlineTypeParser<ProfileSaverOptions> type_parser.Parse(suffix)); } if (option.starts_with("save-resolved-classes-delay-ms:")) { - CmdlineType<unsigned int> type_parser; - return ParseInto(existing, - &ProfileSaverOptions::save_resolved_classes_delay_ms_, - type_parser.Parse(suffix)); + LOG(WARNING) << "-Xps-save-resolved-classes-delay-ms is deprecated"; + return Result::SuccessNoValue(); } if (option.starts_with("hot-startup-method-samples:")) { LOG(WARNING) << "-Xps-hot-startup-method-samples option is deprecated"; |