Commit 34a47649 authored by jochen's avatar jochen Committed by Commit bot

Annotate runtime call stats with trace events

I used a new category "v8.runtime" and all events are disabled by
default, so there shouldn't be any perf impact.

BUG=none
R=fmeawad@chromium.org,cbruni@chromium.org

Review URL: https://codereview.chromium.org/1770353002

Cr-Commit-Position: refs/heads/master@{#34620}
parent 6975f77b
......@@ -7,6 +7,7 @@
#include "src/allocation.h"
#include "src/isolate.h"
#include "src/tracing/trace-event.h"
namespace v8 {
namespace internal {
......@@ -277,6 +278,7 @@ double ClobberDoubleRegisters(double x1, double x2, double x3, double x4);
CLOBBER_DOUBLE_REGISTERS(); \
Arguments args(args_length, args_object); \
Type value; \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8." #Name); \
if (FLAG_runtime_call_stats) { \
RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
RuntimeCallTimerScope timer(isolate, &stats->Name); \
......
......@@ -145,6 +145,8 @@ BUILTIN_LIST_C(DEF_ARG_TYPE)
isolate->counters()->runtime_calls()->Increment(); \
RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
RuntimeCallTimerScope timer(isolate, &stats->Builtin_##name); \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
"V8.Builtin_" #name); \
name##ArgumentsType args(args_length, args_object); \
Object* value = Builtin_Impl_##name(args, isolate); \
return value; \
......
......@@ -68,6 +68,8 @@ ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
timer_.Initialize(&stats->ExternalCallback, stats->current_timer());
stats->Enter(&timer_);
}
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"),
"V8.ExternalCallback");
}
ExternalCallbackScope::~ExternalCallbackScope() {
......@@ -75,6 +77,8 @@ ExternalCallbackScope::~ExternalCallbackScope() {
isolate_->counters()->runtime_call_stats()->Leave(&timer_);
}
isolate_->set_external_callback_scope(previous_scope_);
TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"),
"V8.ExternalCallback");
}
Address ExternalCallbackScope::scope_address() {
......
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