summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2021-05-17 11:56:40 -0700
committer Treehugger Robot <treehugger-gerrit@google.com> 2021-05-24 23:22:57 +0000
commit3156695aa5a69e3ca27b5befcaf0934e7e62e9fb (patch)
tree64977ebf92e992ce978cd1d5a4e378a12463522b /cmdline
parent61ffd049d8d6946ba52884a8f679dde0e3a6654d (diff)
Enable ProfileSaver to have a different delay for the first ever save
The runtime now supports -Xps-first-save-ms, which when configured may alter the delay for the first ever profile save. Subsequent saves will proceed based on the existing -Xps-min-save-period-ms. The first ever save is an approximation, and computed by checking the profiles size. Test: gtest & manual Bug: 185979271 Change-Id: I7119b9d2b8829653046565426090c89f6a619a27
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline_parser_test.cc15
-rw-r--r--cmdline/cmdline_types.h6
2 files changed, 14 insertions, 7 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index 779e3e0fb6..10c651b8e5 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -487,17 +487,18 @@ TEST_F(CmdlineParserTest, TestJitOptions) {
* -Xps-*
*/
TEST_F(CmdlineParserTest, ProfileSaverOptions) {
- ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, "abc", true);
+ ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, 8, "abc", true);
EXPECT_SINGLE_PARSE_VALUE(opt,
"-Xjitsaveprofilinginfo "
"-Xps-min-save-period-ms:1 "
- "-Xps-save-resolved-classes-delay-ms:2 "
- "-Xps-hot-startup-method-samples: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-min-first-save-ms:2 "
+ "-Xps-save-resolved-classes-delay-ms:3 "
+ "-Xps-hot-startup-method-samples:4 "
+ "-Xps-min-methods-to-save:5 "
+ "-Xps-min-classes-to-save:6 "
+ "-Xps-min-notification-before-wake:7 "
+ "-Xps-max-notification-before-wake:8 "
"-Xps-profile-path:abc "
"-Xps-profile-boot-class-path",
M::ProfileSaverOpts);
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index 7b38b8ebe0..c506e03e27 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -788,6 +788,12 @@ struct CmdlineType<ProfileSaverOptions> : CmdlineTypeParser<ProfileSaverOptions>
&ProfileSaverOptions::min_save_period_ms_,
type_parser.Parse(suffix));
}
+ if (android::base::StartsWith(option, "min-first-save-ms:")) {
+ CmdlineType<unsigned int> type_parser;
+ return ParseInto(existing,
+ &ProfileSaverOptions::min_first_save_ms_,
+ type_parser.Parse(suffix));
+ }
if (android::base::StartsWith(option, "save-resolved-classes-delay-ms:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,