diff options
author | 2020-12-07 15:07:00 -0800 | |
---|---|---|
committer | 2020-12-21 18:09:31 +0000 | |
commit | 51a9283984b05511bd98f9bcbd1f2f18900239cc (patch) | |
tree | 09b25eb574b2c93f4e940bfab423b58acdf340bd /runtime/parsed_options.cc | |
parent | 20cadbf2a204a029b595cd44f9298f6570b5c812 (diff) |
[metrics] Add file output support
Adds a new command line option, -Xwrite-metrics-to-file=_, which
specifies a file for writing metrics to. This can be used in conjunction
with -Xwrite-metrics-to-log, which will cause the output to go to both
logcat and the file.
Writing metrics to a file can be helpful for testing or benchmarking
environments.
Access to the file is protected using advisory locking, so it is safe to
have multiple processes write metrics to the same file.
Test: test/run-test --host test/2234-write-metrics-to-file
Bug: 175025360, 170149255
Change-Id: I83a4f959cbb96847dc71188035c050a73b915064
Diffstat (limited to 'runtime/parsed_options.cc')
-rw-r--r-- | runtime/parsed_options.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 508e697f7f..5b8c9d3bc1 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -395,7 +395,12 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize .Define("-Xuse-stderr-logger") .IntoKey(M::UseStderrLogger) .Define("-Xwrite-metrics-to-log") + .WithHelp("Enables writing ART metrics to logcat") .IntoKey(M::WriteMetricsToLog) + .Define("-Xwrite-metrics-to-file=_") + .WithHelp("Enables writing ART metrics to the given file") + .WithType<std::string>() + .IntoKey(M::WriteMetricsToFile) .Define("-Xonly-use-system-oat-files") .IntoKey(M::OnlyUseSystemOatFiles) .Define("-Xverifier-logging-threshold=_") |