Commit dca99f4f authored by lpy's avatar lpy Committed by Commit bot

[Tracing] Show background parsing runtime statistics in tracing

When ParseOnBackground is done, we should construct a trace event and dump all
background parsing runtime statistics as argument. In tracing we don't want to
merge it back to to main thread, instead we show the trace event together with
background parsing trace event on script streamer thread track in Trace Viewer.

To perf sheriff: A series of counters ParseBackgroundxxx and
PreparseBackgroundxxx will be taken into account in this patch, thus runtime
statistics graph will increase after this patch gets landed.

BUG=v8:5089

Review-Url: https://codereview.chromium.org/2559403002
Cr-Commit-Position: refs/heads/master@{#41658}
parent 2bdd0feb
......@@ -3810,8 +3810,6 @@ void Parser::Internalize(Isolate* isolate, Handle<Script> script, bool error) {
v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE) {
// Copy over the counters from the background thread to the main counters on
// the isolate.
// TODO(cbruni,lpy): properly attach the runtime stats to the trace for
// background parsing.
isolate->counters()->runtime_call_stats()->Add(runtime_call_stats_);
}
}
......@@ -3874,9 +3872,13 @@ void Parser::ParseOnBackground(ParseInfo* info) {
if (result != NULL) *info->cached_data() = logger.GetScriptData();
log_ = NULL;
}
if (FLAG_runtime_stats) {
// TODO(cbruni,lpy): properly attach the runtime stats to the trace for
// background parsing.
if (FLAG_runtime_stats &
v8::tracing::TracingCategoryObserver::ENABLED_BY_TRACING) {
auto value = v8::tracing::TracedValue::Create();
runtime_call_stats_->Dump(value.get());
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats"),
"V8.RuntimeStats", TRACE_EVENT_SCOPE_THREAD,
"runtime-call-stats", std::move(value));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment