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

Unified Diff: src/tracing/trace-event.cc

Issue 2418303002: Use TracedValue in runtime statistics. (Closed)
Patch Set: rebase Created 4 years, 2 months 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 | « src/counters.cc ('k') | src/tracing/traced-value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tracing/trace-event.cc
diff --git a/src/tracing/trace-event.cc b/src/tracing/trace-event.cc
index 440af193e921c5aaa8052cd2eb74acb590cf9d77..a24ebc0d975b2fb75c61fc30b2d4b8db74315b74 100644
--- a/src/tracing/trace-event.cc
+++ b/src/tracing/trace-event.cc
@@ -8,6 +8,7 @@
#include "src/counters.h"
#include "src/isolate.h"
+#include "src/tracing/traced-value.h"
#include "src/v8.h"
namespace v8 {
@@ -24,14 +25,13 @@ v8::Platform* TraceEventHelper::GetCurrentPlatform() {
void CallStatsScopedTracer::AddEndTraceEvent() {
if (!has_parent_scope_ && p_data_->isolate) {
+ auto value = v8::tracing::TracedValue::Create();
+ p_data_->isolate->counters()->runtime_call_stats()->Dump(value.get());
v8::internal::tracing::AddTraceEvent(
TRACE_EVENT_PHASE_END, p_data_->category_group_enabled, p_data_->name,
v8::internal::tracing::kGlobalScope, v8::internal::tracing::kNoId,
v8::internal::tracing::kNoId, TRACE_EVENT_FLAG_NONE,
- "runtime-call-stats", TRACE_STR_COPY(p_data_->isolate->counters()
- ->runtime_call_stats()
- ->Dump()
- .c_str()));
+ "runtime-call-stats", std::move(value));
} else {
v8::internal::tracing::AddTraceEvent(
TRACE_EVENT_PHASE_END, p_data_->category_group_enabled, p_data_->name,
« no previous file with comments | « src/counters.cc ('k') | src/tracing/traced-value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698