summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-16 04:24:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-16 04:24:05 +0000
commit8e8bb8aab6f19ccb5b5869a632d9bc882891e17e (patch)
treeff39a8bb3a813e907ed354a474b917302e7cf2be /runtime/runtime.cc
parenta76a08fed88bd081bcc4d240f1ba3472a2acbbab (diff)
parent40da286d3207d88ed8ff3f5caac4873874603428 (diff)
downloadart-8e8bb8aab6f19ccb5b5869a632d9bc882891e17e.zip
art-8e8bb8aab6f19ccb5b5869a632d9bc882891e17e.tar.gz
art-8e8bb8aab6f19ccb5b5869a632d9bc882891e17e.tar.bz2
Merge "ART: Streaming trace mode"
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 543b9dc..7bebb96 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -552,6 +552,17 @@ bool Runtime::Start() {
StartProfiler(profile_output_filename_.c_str());
}
+ if (trace_config_.get() != nullptr && trace_config_->trace_file != "") {
+ ScopedThreadStateChange tsc(self, kWaitingForMethodTracingStart);
+ Trace::Start(trace_config_->trace_file.c_str(),
+ -1,
+ static_cast<int>(trace_config_->trace_file_size),
+ 0,
+ trace_config_->trace_output_mode,
+ trace_config_->trace_mode,
+ 0);
+ }
+
return true;
}
@@ -1000,7 +1011,9 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
trace_config_->trace_file = runtime_options.ReleaseOrDefault(Opt::MethodTraceFile);
trace_config_->trace_file_size = runtime_options.ReleaseOrDefault(Opt::MethodTraceFileSize);
trace_config_->trace_mode = Trace::TraceMode::kMethodTracing;
- trace_config_->trace_output_mode = Trace::TraceOutputMode::kFile;
+ trace_config_->trace_output_mode = runtime_options.Exists(Opt::MethodTraceStreaming) ?
+ Trace::TraceOutputMode::kStreaming :
+ Trace::TraceOutputMode::kFile;
}
{
@@ -1026,17 +1039,6 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
// TODO: move this to just be an Trace::Start argument
Trace::SetDefaultClockSource(runtime_options.GetOrDefault(Opt::ProfileClock));
- if (trace_config_.get() != nullptr) {
- ScopedThreadStateChange tsc(self, kWaitingForMethodTracingStart);
- Trace::Start(trace_config_->trace_file.c_str(),
- -1,
- static_cast<int>(trace_config_->trace_file_size),
- 0,
- trace_config_->trace_output_mode,
- trace_config_->trace_mode,
- 0);
- }
-
// Pre-allocate an OutOfMemoryError for the double-OOME case.
self->ThrowNewException("Ljava/lang/OutOfMemoryError;",
"OutOfMemoryError thrown while trying to throw OutOfMemoryError; "