Commit 7a7c0ec5 authored by lpy's avatar lpy Committed by Commit bot

[Tracing] Re-add trace-events used by metrics accidentally removed.

We removed some TRACE_EVENT0 instrumentation when we landed runtime call stats
tracing, however some of them are used in metrics, this patch adds these
TRACE_EVENT0 back.

BUG=642373
LOG=N

Review-Url: https://codereview.chromium.org/2301743002
Cr-Commit-Position: refs/heads/master@{#39104}
parent 25504a22
......@@ -555,6 +555,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
......@@ -610,6 +612,8 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(info->isolate(),
&RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
......@@ -688,6 +692,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::OptimizeCode);
......@@ -744,6 +749,8 @@ CompilationJob::Status FinalizeOptimizedCompilationJob(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
......@@ -961,6 +968,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
TimerEventScope<TimerEventCompileCode> compile_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileCodeLazy);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileCodeLazy);
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
......@@ -1023,6 +1031,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Isolate* isolate = info->isolate();
TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileCode);
PostponeInterruptsScope postpone(isolate);
......@@ -1097,6 +1106,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
? info->isolate()->counters()->compile_eval()
: info->isolate()->counters()->compile();
HistogramTimerScope timer(rate);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate,
(parse_info->is_eval() ? &tracing::TraceEventStatsTable::CompileEval
......@@ -1583,6 +1594,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
HistogramTimerScope timer(isolate->counters()->compile_deserialize());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileDeserialize);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompileDeserialize");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileDeserialize);
Handle<SharedFunctionInfo> result;
......@@ -1657,6 +1670,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
isolate->counters()->compile_serialize());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileSerialize);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompileSerialize");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileSerialize);
*cached_data = CodeSerializer::Serialize(isolate, result, source);
......@@ -1776,6 +1791,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
// Generate code
TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileCode);
......
......@@ -361,6 +361,7 @@ void Deoptimizer::DeoptimizeAll(Isolate* isolate) {
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::DeoptimizeCode);
TimerEventScope<TimerEventDeoptimizeCode> timer(isolate);
TRACE_EVENT0("v8", "V8.DeoptimizeCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::DeoptimizeCode);
if (FLAG_trace_deopt) {
......@@ -383,6 +384,7 @@ void Deoptimizer::DeoptimizeMarkedCode(Isolate* isolate) {
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::DeoptimizeCode);
TimerEventScope<TimerEventDeoptimizeCode> timer(isolate);
TRACE_EVENT0("v8", "V8.DeoptimizeCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::DeoptimizeCode);
if (FLAG_trace_deopt) {
......@@ -417,6 +419,7 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::DeoptimizeCode);
TimerEventScope<TimerEventDeoptimizeCode> timer(isolate);
TRACE_EVENT0("v8", "V8.DeoptimizeCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::DeoptimizeCode);
Code* code = function->code();
......
......@@ -88,6 +88,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info, uintptr_t stack_limit) {
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileFullCode);
TimerEventScope<TimerEventCompileFullCode> timer(info->isolate());
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileFullCode");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::CompileFullCode);
......
......@@ -181,6 +181,7 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() {
RuntimeCallTimerScope runtimeTimer(info()->isolate(),
&RuntimeCallStats::CompileIgnition);
TimerEventScope<TimerEventCompileIgnition> timer(info()->isolate());
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnition");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
info()->isolate(), &tracing::TraceEventStatsTable::CompileIgnition);
......
......@@ -589,6 +589,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
HistogramTimerScope timer_scope(isolate->counters()->parse(), true);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::Parse);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.Parse");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::Parse);
Handle<String> source(String::cast(info->script()->source()));
......@@ -755,6 +756,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) {
DCHECK(parsing_on_main_thread_);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseLazy);
HistogramTimerScope timer_scope(isolate->counters()->parse_lazy());
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.ParseLazy");
TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
isolate, &tracing::TraceEventStatsTable::ParseLazy);
Handle<String> source(String::cast(info->script()->source()));
......
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