Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: src/parsing/parser.cc

Issue 2559403002: [Tracing] Show background parsing runtime statistics in tracing. (Closed)
Patch Set: Use instant trace event Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 842d3520330f80965b332222072408b5d4f0bdf8..b8c780fc0823cb7f4aad2b85b75581da033fbd66 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -3809,8 +3809,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_);
}
}
@@ -3873,9 +3871,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));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698